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