mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-05 13:37:36 +01:00
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) {
|
||||
|
||||
fun current(): Locale {
|
||||
return ConfigurationCompat.getLocales(resources.configuration)[0]
|
||||
return ConfigurationCompat.getLocales(resources.configuration).get(0) ?: Locale.getDefault()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user