Fixed Languages with specific countries

This commit is contained in:
Bnyro 2022-05-07 21:44:52 +02:00
parent 4f8a84341b
commit 9aad985aea
2 changed files with 4 additions and 2 deletions

View File

@ -43,8 +43,10 @@ class MainActivity : AppCompatActivity() {
DynamicColors.applyToActivitiesIfAvailable(application) DynamicColors.applyToActivitiesIfAvailable(application)
val languageName = sharedPreferences.getString("language", "sys") val languageName = sharedPreferences.getString("language", "sys")
if (languageName != "") { if (languageName != "") {
var locale = if (languageName != "sys") { var locale = if (languageName != "sys" && "$languageName".length < 3 ){
Locale(languageName) Locale(languageName)
} else if ("$languageName".length > 3) {
Locale(languageName?.substring(0,2), languageName?.substring(4,6))
} else { } else {
Locale.getDefault() Locale.getDefault()
} }

View File

@ -452,7 +452,7 @@
<item>fa</item> <item>fa</item>
<item>pl</item> <item>pl</item>
<item>pt</item> <item>pt</item>
<item>pr-rBR</item> <item>pt-rBR</item>
<item>ru</item> <item>ru</item>
<item>ckb</item> <item>ckb</item>
<item>es</item> <item>es</item>