From ab8422d8e88e96add58492aaf9fec9dd4c8452ff Mon Sep 17 00:00:00 2001 From: Bnyro Date: Sat, 5 Nov 2022 14:28:33 +0100 Subject: [PATCH] fix the region detector --- .../main/java/com/github/libretube/util/LocaleHelper.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt index c0c4778e5..dcc71810d 100644 --- a/app/src/main/java/com/github/libretube/util/LocaleHelper.kt +++ b/app/src/main/java/com/github/libretube/util/LocaleHelper.kt @@ -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