mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-24 03:42:15 +00:00
Fix: Applying main locale language
This commit is contained in:
parent
6acdacd483
commit
ebb3ea7731
@ -123,7 +123,7 @@ object Utils {
|
|||||||
}
|
}
|
||||||
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
|
||||||
if (setLocalCode != sysLocale.language || setLocalCode != "${sysLocale.language}-r${sysLocale.country}") {
|
if (setLocalCode != sysLocale.toString() || setLocalCode != "${sysLocale.language}-r${sysLocale.country}") {
|
||||||
val newLocale = getLocaleOfCode(setLocalCode)
|
val newLocale = getLocaleOfCode(setLocalCode)
|
||||||
Locale.setDefault(newLocale)
|
Locale.setDefault(newLocale)
|
||||||
config.setLocale(newLocale)
|
config.setLocale(newLocale)
|
||||||
@ -156,6 +156,10 @@ object Utils {
|
|||||||
localeCode.substring(0, 2),
|
localeCode.substring(0, 2),
|
||||||
localeCode.substring(4)
|
localeCode.substring(4)
|
||||||
)
|
)
|
||||||
|
localeCode.contains("_") -> Locale(
|
||||||
|
localeCode.substring(0, 2),
|
||||||
|
localeCode.substring(3)
|
||||||
|
)
|
||||||
else -> Locale(localeCode)
|
else -> Locale(localeCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user