diff --git a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt index b06796848..7f79dd3ed 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/GlobalSearchScreen.kt @@ -77,7 +77,7 @@ internal fun GlobalSearchContent( title = fromSourceId?.let { "▶ ${source.name}".takeIf { source.id == fromSourceId } } ?: source.name, - subtitle = LocaleHelper.getDisplayName(source.lang), + subtitle = LocaleHelper.getLocalizedDisplayName(source.lang), onClick = { onClickSource(source) }, ) { when (result) { diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt index 8fc49cf40..bdba9e15c 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/appearance/AppLanguageScreen.kt @@ -34,7 +34,6 @@ import tachiyomi.core.i18n.stringResource import tachiyomi.i18n.MR import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.i18n.stringResource -import java.util.Locale class AppLanguageScreen : Screen() { @@ -104,9 +103,9 @@ class AppLanguageScreen : Screen() { for (i in 0.. context.stringResource(MR.strings.pinned_sources) "other" -> context.stringResource(MR.strings.other_source) "all" -> context.stringResource(MR.strings.multi_lang) - else -> getDisplayName(lang) + else -> getLocalizedDisplayName(lang) } } + fun getDisplayName(lang: String): String { + val normalizedLang = when (lang) { + "zh-CN" -> "zh-Hans" + "zh-TW" -> "zh-Hant" + else -> lang + } + + return Locale.forLanguageTag(normalizedLang).displayName + } + /** * Returns display name of a string language code. * * @param lang empty for system language */ - fun getDisplayName(lang: String?): String { + fun getLocalizedDisplayName(lang: String?): String { if (lang == null) { return "" }