From e0b4551bca78908955371fc2fa323d25fc443d0a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 13 Apr 2023 16:33:42 +0200 Subject: [PATCH] gradle: 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 --- ui/build.gradle.kts | 3 +++ ui/src/main/res/resources.properties | 1 + 2 files changed, 4 insertions(+) create mode 100644 ui/src/main/res/resources.properties diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index 94cdf746..065894c1 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -54,6 +54,9 @@ android { matchingFallbacks += "release" } } + androidResources { + generateLocaleConfig = true + } lint { disable += "LongLogTag" warning += "MissingTranslation" 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