mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 10:28:23 +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 ""
|
||||
}
|
||||
|
||||
val locale = when {
|
||||
lang.isEmpty() -> LocaleListCompat.getAdjustedDefault()[0]
|
||||
lang == "zh-CN" -> Locale.forLanguageTag("zh-Hans")
|
||||
lang == "zh-TW" -> Locale.forLanguageTag("zh-Hant")
|
||||
val locale = when (lang) {
|
||||
"" -> LocaleListCompat.getAdjustedDefault()[0]
|
||||
"zh-CN" -> Locale.forLanguageTag("zh-Hans")
|
||||
"zh-TW" -> Locale.forLanguageTag("zh-Hant")
|
||||
else -> Locale.forLanguageTag(lang)
|
||||
}
|
||||
return locale!!.getDisplayName(locale).replaceFirstChar { it.uppercase(locale) }
|
||||
|
Loading…
Reference in New Issue
Block a user