From d2d126e9d913641edfab2c0290383d6a5efec419 Mon Sep 17 00:00:00 2001 From: darken Date: Sun, 7 Sep 2025 11:32:39 +0200 Subject: [PATCH] Enable per-app language preferences This commit enables the automatic generation of per-app language preferences by configuring the Android Gradle Plugin. A `resources.properties` file is added to specify `en` as the `unqualifiedResLocale`, which serves as the default/fallback locale. Additionally, `.kotlin` is added to `.gitignore` to exclude Kotlin build-related files. --- .gitignore | 3 ++- app/build.gradle.kts | 5 +++++ app/src/main/res/resources.properties | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/resources.properties diff --git a/.gitignore b/.gitignore index d352fa1d..309818b9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ .local/* /fastlane/report.xml /fastlane/Appfile -/fastlane/README.md \ No newline at end of file +/fastlane/README.md +.kotlin \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index cca23e61..1e678a0c 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,6 +24,11 @@ android { testInstrumentationRunner = "eu.darken.capod.HiltTestRunner" } + // Enable automatic per-app language preferences generation + androidResources { + generateLocaleConfig = true + } + signingConfigs { val basePath = File(System.getProperty("user.home"), ".appconfig/${ProjectConfig.packageName}") create("releaseFoss") { diff --git a/app/src/main/res/resources.properties b/app/src/main/res/resources.properties new file mode 100644 index 00000000..534385b1 --- /dev/null +++ b/app/src/main/res/resources.properties @@ -0,0 +1,4 @@ +# This file configures automatic per-app language preference support +# It tells AGP to generate LocaleConfig automatically from available translations +# The unqualifiedResLocale is the default/fallback locale (from res/values/strings.xml) +unqualifiedResLocale=en \ No newline at end of file