Fix: Respect country in locale language (close #151)

This commit is contained in:
machiav3lli 2022-03-25 13:10:49 +01:00
parent 7d9ca23f09
commit 01f8043f6e

View File

@ -119,7 +119,7 @@ object Utils {
fun Context.setLanguage(): Configuration { fun Context.setLanguage(): Configuration {
var setLocalCode = Preferences[Preferences.Key.Language] var setLocalCode = Preferences[Preferences.Key.Language]
if (setLocalCode == PREFS_LANGUAGE_DEFAULT) { if (setLocalCode == PREFS_LANGUAGE_DEFAULT) {
setLocalCode = Locale.getDefault().language setLocalCode = Locale.getDefault().toString()
} }
val config = resources.configuration val config = resources.configuration
val sysLocale = if (Android.sdk(24)) config.locales[0] else config.locale val sysLocale = if (Android.sdk(24)) config.locales[0] else config.locale