mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-06 15:30:46 -05:00
Fix pre 21 support
This commit is contained in:
@@ -51,7 +51,7 @@ fun String.langTagToLocale(): Locale {
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return Locale.forLanguageTag(this)
|
||||
} else {
|
||||
val tok = split("-".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
val tok = split("[-_]".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
if (tok.isEmpty()) {
|
||||
return Locale("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user