From 39685dac13aeb7d1716a2d7e264ec7441f18728f Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Tue, 29 Nov 2022 20:43:02 +0100 Subject: [PATCH] fixed settings for language --- .../main/java/com/lagradost/cloudstream3/CommonActivity.kt | 2 +- .../com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt b/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt index 6d585cf1..5f02661d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/CommonActivity.kt @@ -114,7 +114,7 @@ object CommonActivity { * when setting the app language. **/ val appLanguageExceptions = hashMapOf( - "zh-TW" to Locale.TRADITIONAL_CHINESE + "zh_TW" to Locale.TRADITIONAL_CHINESE ) fun setLocale(context: Context?, languageCode: String?) { diff --git a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt index 56140a18..551a80ab 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsGeneral.kt @@ -47,7 +47,7 @@ fun getCurrentLocale(context: Context): String { // Change locale settings in the app. // val dm = res.displayMetrics val conf = res.configuration - return conf?.locale?.language ?: "en" + return conf?.locale?.toString() ?: "en" } // idk, if you find a way of automating this it would be great @@ -76,7 +76,7 @@ val appLanguages = arrayListOf( Triple("", "Romanian", "ro"), Triple("", "Italian", "it"), Triple("", "Chinese Simplified", "zh"), - Triple("\uD83C\uDDF9\uD83C\uDDFC", "Chinese Traditional", "zh-TW"), + Triple("\uD83C\uDDF9\uD83C\uDDFC", "Chinese Traditional", "zh_TW"), Triple("\uD83C\uDDEE\uD83C\uDDE9", "Indonesian", "in"), Triple("", "Czech", "cs"), Triple("", "Croatian", "hr"),