use getLocales() for Android >= Nougat

This commit is contained in:
IndusAryan 2023-12-09 19:38:30 +05:30
parent 982dc38b00
commit 333868ed22

View file

@ -49,7 +49,7 @@ fun getCurrentLocale(context: Context): String {
val conf = res.configuration
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
conf?.locales?.toString() ?: "en"
conf?.locales?.get(0)?.toString() ?: "en"
} else {
@Suppress("DEPRECATION")
conf?.locale?.toString() ?: "en"