diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-13 16:33:42 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-04-13 18:07:40 +0200 |
commit | 544e80110fdd0224728ac00b4ceef21d33ecb3fb (patch) | |
tree | 64d4b40dd42f5cd131153c02f8bda0369cb5a715 | |
parent | 4ab7ac51efb14b45dfafda0dbfe177ac64078794 (diff) |
build: generate locales for per-app picking
Enable the per-app locale picking menu by adding the right metadata
automatically to the manifest with new AGP automation.
This attempts to follow:
https://developer.android.com/guide/topics/resources/app-languages#use-localeconfig
Using the new AGP feature:
https://developer.android.com/studio/preview/features#automatic-per-app-languages
It appears to work, and it also should squelch the "W AppCompatDelegate:
Checking for metadata for AppLocalesMetadataHolderService : " warnings
on old Android that syphyr pointed out.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | gradle.properties | 2 | ||||
-rw-r--r-- | settings.gradle | 2 | ||||
-rw-r--r-- | ui/build.gradle | 3 | ||||
-rw-r--r-- | ui/src/main/res/resources.properties | 1 |
4 files changed, 5 insertions, 3 deletions
diff --git a/gradle.properties b/gradle.properties index 2ecf213a..3efc9b38 100644 --- a/gradle.properties +++ b/gradle.properties @@ -42,8 +42,6 @@ android.generateManifestClass=true android.experimental.enableSourceSetPathsMap=true # Use relative paths for better Gradle caching of library build tasks android.experimental.cacheCompileLibResources=true -# Disable automatic creation of publishing components -android.disableAutomaticComponentCreation=true # Default Android build features # Disable BuildConfig generation by default diff --git a/settings.gradle b/settings.gradle index e6dd51a5..48bb8556 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,5 @@ pluginManagement { - def agpVersion = '7.4.2' + def agpVersion = '8.1.0-alpha11' def kotlinVersion = "1.8.0" repositories { gradlePluginPortal() diff --git a/ui/build.gradle b/ui/build.gradle index abd71827..8a553f14 100644 --- a/ui/build.gradle +++ b/ui/build.gradle @@ -49,6 +49,9 @@ android { disable 'LongLogTag' warning 'MissingTranslation', 'ImpliedQuantity' } + androidResources { + generateLocaleConfig true + } } dependencies { diff --git a/ui/src/main/res/resources.properties b/ui/src/main/res/resources.properties new file mode 100644 index 00000000..467b3efe --- /dev/null +++ b/ui/src/main/res/resources.properties @@ -0,0 +1 @@ +unqualifiedResLocale=en-US |