Allow for more language support at an OS level (#998)

This commit is contained in:
David Perez 2024-02-12 14:06:21 -06:00 committed by Álison Fernandes
parent 042b055ecd
commit b434feed0b
4 changed files with 7 additions and 90 deletions

View file

@ -28,52 +28,6 @@ android {
versionCode = 1
versionName = "1.0.0"
// This is so the build system only includes language resources in the APK for these
// languages, preventing translated strings from being included from other libraries that
// might support languages this app does not.
resourceConfigurations += arrayOf(
"af",
"be",
"bg",
"ca",
"cs",
"da",
"de",
"el",
"en",
"en-rGB",
"es",
"et",
"fa",
"fi",
"fr",
"hi",
"hr",
"hu",
"in",
"it",
"iw",
"ja",
"ko",
"lv",
"ml",
"nb",
"nl",
"pl",
"pt-rBR",
"pt-rPT",
"ro",
"ru",
"sk",
"sv",
"th",
"tr",
"uk",
"vi",
"zh-rCN",
"zh-rTW"
)
ksp {
// The location in which the generated Room Database Schemas will be stored in the repo.
arg("room.schemaLocation", "$projectDir/schemas")
@ -82,6 +36,11 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
androidResources {
@Suppress("UnstableApiUsage")
generateLocaleConfig = true
}
signingConfigs {
getByName("debug") {
keyAlias = "androiddebugkey"

View file

@ -18,7 +18,6 @@
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:localeConfig="@xml/locales_config"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@ -104,6 +103,7 @@
</intent-filter>
</service>
<!-- This is required to support in-app language picker in Android 12 (API 32) and below -->
<service
android:name="androidx.appcompat.app.AppLocalesMetadataHolderService"
android:enabled="false"

View file

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

View file

@ -1,43 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="af"/> <!-- Afrikaans -->
<locale android:name="be"/> <!-- Belarusian -->
<locale android:name="bg"/> <!-- Bulgarian -->
<locale android:name="ca"/> <!-- Catalan -->
<locale android:name="cs"/> <!-- Czech -->
<locale android:name="da"/> <!-- Danish -->
<locale android:name="de"/> <!-- German -->
<locale android:name="el"/> <!-- Greek -->
<locale android:name="en"/> <!-- English (US) -->
<locale android:name="en-GB"/> <!-- English (Great Britain) -->
<locale android:name="es"/> <!-- Spanish -->
<locale android:name="et"/> <!-- Estonian -->
<locale android:name="fa"/> <!-- Persian -->
<locale android:name="fi"/> <!-- Finnish -->
<locale android:name="fr"/> <!-- French -->
<locale android:name="hi"/> <!-- Hindi -->
<locale android:name="hr"/> <!-- Croatian -->
<locale android:name="hu"/> <!-- Hungarian -->
<locale android:name="in"/> <!-- Indonesian -->
<locale android:name="it"/> <!-- Italian -->
<locale android:name="iw"/> <!-- Hebrew -->
<locale android:name="ja"/> <!-- Japanese -->
<locale android:name="ko"/> <!-- Korean -->
<locale android:name="lv"/> <!-- Latvian -->
<locale android:name="ml"/> <!-- Malayalam -->
<locale android:name="nb"/> <!-- Norwegian -->
<locale android:name="nl"/> <!-- Dutch -->
<locale android:name="pl"/> <!-- Polish -->
<locale android:name="pt-BR"/> <!-- Portuguese (Brazilian) -->
<locale android:name="pt-PT"/> <!-- Portuguese (Portugal) -->
<locale android:name="ro"/> <!-- Romanian -->
<locale android:name="ru"/> <!-- Russian -->
<locale android:name="sk"/> <!-- Slovak -->
<locale android:name="sv"/> <!-- Swedish -->
<locale android:name="th"/> <!-- Thai -->
<locale android:name="tr"/> <!-- Turkish -->
<locale android:name="uk"/> <!-- Ukrainian -->
<locale android:name="vi"/> <!-- Vietnamese -->
<locale android:name="zh-CN"/> <!-- Chinese (Simplified) -->
<locale android:name="zh-TW"/> <!-- Chinese (Traditional) -->
</locale-config>