adding fallback locale for when the configuration locale is missing
This commit is contained in:
parent
524dcbb3d1
commit
4ffce89ef2
@ -26,7 +26,7 @@ import javax.inject.Inject
|
|||||||
class LocaleProvider @Inject constructor(private val resources: Resources) {
|
class LocaleProvider @Inject constructor(private val resources: Resources) {
|
||||||
|
|
||||||
fun current(): Locale {
|
fun current(): Locale {
|
||||||
return ConfigurationCompat.getLocales(resources.configuration)[0]
|
return ConfigurationCompat.getLocales(resources.configuration).get(0) ?: Locale.getDefault()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user