mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Show languages of providers in alphabetical order to make it consistent with app language selector (#1357)
Co-authored-by: Paweł <pawelmaczalowski@gmail.com>
This commit is contained in:
parent
e54c951bb6
commit
4ac7e0c967
1 changed files with 3 additions and 2 deletions
|
@ -52,7 +52,7 @@ class SettingsLang : PreferenceFragmentCompat() {
|
||||||
|
|
||||||
private fun getCurrentLocale(): String {
|
private fun getCurrentLocale(): String {
|
||||||
val res = requireContext().resources
|
val res = requireContext().resources
|
||||||
// Change locale settings in the app.
|
// Change locale settings in the app.
|
||||||
// val dm = res.displayMetrics
|
// val dm = res.displayMetrics
|
||||||
val conf = res.configuration
|
val conf = res.configuration
|
||||||
return conf?.locale?.language ?: "en"
|
return conf?.locale?.language ?: "en"
|
||||||
|
@ -149,10 +149,11 @@ class SettingsLang : PreferenceFragmentCompat() {
|
||||||
|
|
||||||
getPref(R.string.provider_lang_key)?.setOnPreferenceClickListener {
|
getPref(R.string.provider_lang_key)?.setOnPreferenceClickListener {
|
||||||
activity?.getApiProviderLangSettings()?.let { current ->
|
activity?.getApiProviderLangSettings()?.let { current ->
|
||||||
val allLangs = HashSet<String>()
|
var allLangs: MutableSet<String> = mutableSetOf()
|
||||||
for (api in APIHolder.apis) {
|
for (api in APIHolder.apis) {
|
||||||
allLangs.add(api.lang)
|
allLangs.add(api.lang)
|
||||||
}
|
}
|
||||||
|
allLangs = allLangs.sortedBy { SubtitleHelper.fromTwoLettersToLanguage(it) }.toMutableSet()
|
||||||
|
|
||||||
val currentList = ArrayList<Int>()
|
val currentList = ArrayList<Int>()
|
||||||
for (i in current) {
|
for (i in current) {
|
||||||
|
|
Loading…
Reference in a new issue