From 0ca14c61c256af770fe31c0d0cc8b7111f4b988b Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 1 Oct 2022 23:54:54 -0400 Subject: [PATCH] Explicitly reword some locale names Avoiding some country names in favour of more generic terminology where appropriate. --- .../eu/kanade/tachiyomi/util/system/LocaleHelper.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt index 8925c8f1a..6ee92cf3b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/system/LocaleHelper.kt @@ -12,7 +12,7 @@ import java.util.Locale object LocaleHelper { /** - * Returns Display name of a string language code + * Returns display name of a string language code. */ fun getSourceDisplayName(lang: String?, context: Context): String { return when (lang) { @@ -25,7 +25,7 @@ object LocaleHelper { } /** - * Returns Display name of a string language code + * Returns display name of a string language code. * * @param lang empty for system language */ @@ -34,10 +34,11 @@ object LocaleHelper { return "" } - val locale = if (lang.isEmpty()) { - LocaleListCompat.getAdjustedDefault()[0] - } else { - Locale.forLanguageTag(lang) + val locale = when { + lang.isEmpty() -> LocaleListCompat.getAdjustedDefault()[0] + lang == "zh-CN" -> Locale.forLanguageTag("zh-Hans") + lang == "zh-TW" -> Locale.forLanguageTag("zh-Hant") + else -> Locale.forLanguageTag(lang) } return locale!!.getDisplayName(locale).replaceFirstChar { it.uppercase(locale) } }