fix the region detector

This commit is contained in:
Bnyro 2022-11-05 14:28:33 +01:00
parent 1049669cb8
commit ab8422d8e8

View File

@ -21,7 +21,7 @@ object LocaleHelper {
)
updateLocaleConf(context, locale)
} else {
val locale = Locale(languageName.toString())
val locale = Locale(languageName)
updateLocaleConf(context, locale)
}
}
@ -41,15 +41,15 @@ object LocaleHelper {
fun getDetectedCountry(context: Context, defaultCountryIsoCode: String): String {
detectSIMCountry(context)?.let {
return it
if (it != "") return it
}
detectNetworkCountry(context)?.let {
return it
if (it != "") return it
}
detectLocaleCountry(context)?.let {
return it
if (it != "") return it
}
return defaultCountryIsoCode