Skip to content

Instantly share code, notes, and snippets.

@obfusk
Created September 3, 2023 20:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save obfusk/64523e795d02a2c171ae288fe7504c3b to your computer and use it in GitHub Desktop.
Save obfusk/64523e795d02a2c171ae288fe7504c3b to your computer and use it in GitHub Desktop.
catima locales
diff --git a/app/build.gradle b/app/build.gradle
index 1758fc5d..7bbf65c8 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -24,6 +24,8 @@ android {
vectorDrawables.useSupportLibrary true
multiDexEnabled true
+
+ resourceConfigurations += ["ar", "bg", "bn", "bn-rIN", "bs", "ca", "cs", "cy", "da", "de", "el-rGR", "en", "eo", "es", "es-rAR", "fi", "fr", "he-rIL", "hi", "hr", "hu", "in-rID", "is", "it", "ja", "ko", "lt", "lv", "nb-rNO", "nl", "oc", "pl", "pt", "ro-rRO", "ru", "sk", "sl", "sv", "tr", "uk", "zh-rCN", "zh-rTW"]
}
buildTypes {
@@ -81,11 +83,6 @@ android {
lintConfig file('lint.xml')
}
namespace 'protect.card_locker'
-
- androidResources {
- generateLocaleConfig true
- }
-
}
dependencies {
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8680c5c4..19f97e81 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -27,7 +27,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
- android:theme="@style/AppTheme">
+ android:theme="@style/AppTheme"
+ android:localeConfig="@xml/locales_config">
<activity
android:name=".MainActivity"
android:exported="true"
diff --git a/app/src/main/res/xml/locales_config.xml b/app/src/main/res/xml/locales_config.xml
new file mode 100644
index 00000000..d3e7fc20
--- /dev/null
+++ b/app/src/main/res/xml/locales_config.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
+ <locale android:name="en-US" />
+ <locale android:name="ar" />
+ <locale android:name="bg" />
+ <locale android:name="bn" />
+ <locale android:name="bn-IN" />
+ <locale android:name="bs" />
+ <locale android:name="ca" />
+ <locale android:name="cs" />
+ <locale android:name="cy" />
+ <locale android:name="da" />
+ <locale android:name="de" />
+ <locale android:name="el-GR" />
+ <locale android:name="eo" />
+ <locale android:name="es" />
+ <locale android:name="es-AR" />
+ <locale android:name="fi" />
+ <locale android:name="fr" />
+ <locale android:name="he-IL" />
+ <locale android:name="hi" />
+ <locale android:name="hr" />
+ <locale android:name="hu" />
+ <locale android:name="in-ID" />
+ <locale android:name="is" />
+ <locale android:name="it" />
+ <locale android:name="ja" />
+ <locale android:name="ko" />
+ <locale android:name="lt" />
+ <locale android:name="lv" />
+ <locale android:name="nb-NO" />
+ <locale android:name="nl" />
+ <locale android:name="oc" />
+ <locale android:name="pl" />
+ <locale android:name="pt" />
+ <locale android:name="ro-RO" />
+ <locale android:name="ru" />
+ <locale android:name="sk" />
+ <locale android:name="sl" />
+ <locale android:name="sv" />
+ <locale android:name="tr" />
+ <locale android:name="uk" />
+ <locale android:name="zh-CN" />
+ <locale android:name="zh-TW" />
+</locale-config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment