Switch per language support to manual

The current automatic support setup has a bug where the app language will change for users with Android 15 when there is a configuration change like rotating a screen. It seems that that using generateLocaleConfig on AGP 8.8+ triggers a bug in Android 15 (android:defaultLocale) which causes this issue

(cherry picked from commit 104d8da655)
This commit is contained in:
kadirkid
2025-05-07 22:51:10 +04:00
committed by Koitharu
parent a3cc5726ee
commit c1e84715fb
3 changed files with 124 additions and 2 deletions

View File

@@ -27,8 +27,72 @@ android {
arg('room.generateKotlin', 'true')
}
androidResources {
generateLocaleConfig true
generateLocaleConfig false
}
resourceConfigurations += [
"en",
"ab",
"ar",
"arq",
"as",
"be",
"bn",
"ca",
"cs",
"de",
"el",
"en-rGB",
"enm",
"es",
"et",
"eu",
"fa",
"fi",
"fil",
"fr",
"frp",
"gu",
"hi",
"hr",
"hu",
"in",
"it",
"iw",
"ja",
"kk",
"km",
"ko",
"lt",
"lv",
"lzh",
"ml",
"ms",
"my",
"nb-rNO",
"ne",
"nn",
"or",
"pa",
"pa-rPK",
"pl",
"pt",
"pt-rBR",
"ro",
"ru",
"si",
"sr",
"sv",
"ta",
"th",
"tr",
"uk",
"vi",
"zh-rCN",
"zh-rTW",
// Specific BCP 47 locales
"b+zh+Hans+MO",
"b+zh+Hant+MO"
]
}
buildTypes {
debug {

View File

@@ -1 +0,0 @@
unqualifiedResLocale=en-US

View File

@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="ab"/>
<locale android:name="ar"/>
<locale android:name="arq"/>
<locale android:name="as"/>
<locale android:name="be"/>
<locale android:name="bn"/>
<locale android:name="ca"/>
<locale android:name="cs"/>
<locale android:name="de"/>
<locale android:name="el"/>
<locale android:name="en-GB"/>
<locale android:name="enm"/>
<locale android:name="es"/>
<locale android:name="et"/>
<locale android:name="eu"/>
<locale android:name="fa"/>
<locale android:name="fi"/>
<locale android:name="fil"/>
<locale android:name="fr"/>
<locale android:name="frp"/>
<locale android:name="gu"/>
<locale android:name="he"/> <locale android:name="hi"/>
<locale android:name="hr"/>
<locale android:name="hu"/>
<locale android:name="id"/> <locale android:name="it"/>
<locale android:name="ja"/>
<locale android:name="kk"/>
<locale android:name="km"/>
<locale android:name="ko"/>
<locale android:name="lt"/>
<locale android:name="lv"/>
<locale android:name="lzh"/>
<locale android:name="ml"/>
<locale android:name="ms"/>
<locale android:name="my"/>
<locale android:name="nb-NO"/>
<locale android:name="ne"/>
<locale android:name="nn"/>
<locale android:name="or"/>
<locale android:name="pa"/>
<locale android:name="pa-PK"/>
<locale android:name="pl"/>
<locale android:name="pt"/>
<locale android:name="pt-BR"/>
<locale android:name="ro"/>
<locale android:name="ru"/>
<locale android:name="si"/>
<locale android:name="sr"/>
<locale android:name="sv"/>
<locale android:name="ta"/>
<locale android:name="th"/>
<locale android:name="tr"/>
<locale android:name="uk"/>
<locale android:name="vi"/>
<locale android:name="zh-CN"/>
<locale android:name="zh-TW"/>
</locale-config>