mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 16:01:49 +01:00
LocaleHelper: use argument for a when
expression (#8131)
This commit is contained in:
parent
e24501da09
commit
ff4fb83bff
@ -34,10 +34,10 @@ object LocaleHelper {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
val locale = when {
|
val locale = when (lang) {
|
||||||
lang.isEmpty() -> LocaleListCompat.getAdjustedDefault()[0]
|
"" -> LocaleListCompat.getAdjustedDefault()[0]
|
||||||
lang == "zh-CN" -> Locale.forLanguageTag("zh-Hans")
|
"zh-CN" -> Locale.forLanguageTag("zh-Hans")
|
||||||
lang == "zh-TW" -> Locale.forLanguageTag("zh-Hant")
|
"zh-TW" -> Locale.forLanguageTag("zh-Hant")
|
||||||
else -> Locale.forLanguageTag(lang)
|
else -> Locale.forLanguageTag(lang)
|
||||||
}
|
}
|
||||||
return locale!!.getDisplayName(locale).replaceFirstChar { it.uppercase(locale) }
|
return locale!!.getDisplayName(locale).replaceFirstChar { it.uppercase(locale) }
|
||||||
|
Loading…
Reference in New Issue
Block a user