Merge pull request #184 from Bnyro/language

Fixed Languages with specific countries
This commit is contained in:
Farbod 2022-05-07 22:24:45 +04:30 committed by GitHub
commit afb56dea21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

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

View File

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