mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 20:31:02 -05:00
LocaleHelper: use argument for a when
expression (#8131)
This commit is contained in:
parent
e24501da09
commit
ff4fb83bff
1 changed files with 4 additions and 4 deletions
|
@ -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 a new issue