fixed settings for language

This commit is contained in:
Blatzar 2022-11-29 20:43:02 +01:00
parent bab73d1b73
commit 39685dac13
2 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ object CommonActivity {
* when setting the app language. * when setting the app language.
**/ **/
val appLanguageExceptions = hashMapOf( val appLanguageExceptions = hashMapOf(
"zh-TW" to Locale.TRADITIONAL_CHINESE "zh_TW" to Locale.TRADITIONAL_CHINESE
) )
fun setLocale(context: Context?, languageCode: String?) { fun setLocale(context: Context?, languageCode: String?) {

View file

@ -47,7 +47,7 @@ fun getCurrentLocale(context: Context): String {
// Change locale settings in the app. // Change locale settings in the app.
// val dm = res.displayMetrics // val dm = res.displayMetrics
val conf = res.configuration 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 // idk, if you find a way of automating this it would be great
@ -76,7 +76,7 @@ val appLanguages = arrayListOf(
Triple("", "Romanian", "ro"), Triple("", "Romanian", "ro"),
Triple("", "Italian", "it"), Triple("", "Italian", "it"),
Triple("", "Chinese Simplified", "zh"), 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("\uD83C\uDDEE\uD83C\uDDE9", "Indonesian", "in"),
Triple("", "Czech", "cs"), Triple("", "Czech", "cs"),
Triple("", "Croatian", "hr"), Triple("", "Croatian", "hr"),