Add 15 new locales to Android resource and build config - #15961
Add 15 new locales to Android resource and build config#15961JorgeMucientes wants to merge 3 commits into
Conversation
|
|
|
Addressed both Danger errors: added |
2e9d14f to
d148979
Compare
Adds pl, pt-rPT, cs, da, nb, fi, el, hu, ro, uk, bg, th, vi, hi, ms to resConfigs, locales_config.xml and available_languages.xml so the new languages are bundled and selectable in the in-app language picker. Translated strings.xml files are produced by the AI translation engine (later phase); generation of available_languages.xml moves into the engine in the Fastfile phase.
d148979 to
3e3c5e9
Compare
toupper
left a comment
There was a problem hiding this comment.
Thanks for the careful staging here — splitting the locale declaration off from the translation engine, sidecar baseline, and Play Store metadata into its own atomic PR is the right move and made this very easy to verify.
I checked the three changed files against the localeConfig registered in AndroidManifest.xml, the existing LocaleProvider, the Fastfile's SUPPORTED_LOCALES, and the wear app's build config. Nothing here looks like a blocker.
Suggestions
-
WooCommerce/src/main/res/values/available_languages.xml— The new entries are appended to the end of the array (bg,cs, …vi) rather than alphabetized with the existing ones. The legacy block keepsen_USpinned first and then runs alphabetically fromartozh_TW. Two minor consequences: (a) anything that consumes this array in display order would now show the new locales grouped at the bottom rather than interleaved, and (b) future maintainers diffing this list will have a harder time spotting duplicates. I couldn't find a Kotlin consumer forR.array.available_languagesanywhere inWooCommerce/src/main/kotlin/, so this seems to be informational only (the actual system language picker is driven byxml/locales_config.xml). If that's correct, the ordering is a stylistic nit; if the array is consumed downstream by the translation engine in #15962, it might be worth interleaving alphabetically to keep diffs clean. Same observation applies to the ordering chosen inresConfigsandlocales_config.xml, though those are clearly machine-consumed and order doesn't matter functionally. -
fastlane/Fastfile—SUPPORTED_LOCALES(line 101) still lists only the 16 existing locales. I see from the PR description that GlotPress / metadata wiring is intentionally split into #15962 and #15983, so this is expected — flagging only so we don't forget that without those follow-ups, Android resources will know about the 15 new locales but no Fastlane lane (e.g.download_translations, screenshots) will. A short comment in the Fastfile pointing to the follow-up PRs could help, but it's optional. -
No
values-xx/directories yet for the new locales — confirmed intentional per the PR description (translation backfill comes via #16004). The runtime effect today: if a user picks e.g. Polish from the system language picker, the app will render English strings because Android resource fallback kicks in. That's fine for an interim state, but worth being aware of in case this PR ships ahead of #16004. Consider holding the rollout (or guarding the new entries) until the backfilled strings.xml files land so users don't end up with a "Polish" selection that produces English text.
Positives
- Single-purpose PR with a tight diff (32 LOC across 3 files) — easy to reason about and easy to revert if needed.
- The three files stay in lockstep: every new locale appears in
resConfigs,locales_config.xml, andavailable_languages.xml. I cross-checked the 15 new codes in all three and they match. - Android-format codes are correct throughout:
pt-rBR/pt-rPTuse the-rregion prefix forresConfigs(Gradle/AAPT format) whilelocales_config.xmlusespt-BR/pt-PT(BCP 47), which is exactly how Android wants those two files to differ. Same forzh-rCN/zh-CN. nb(Norwegian Bokmål) chosen overno— correct, sincenois ambiguous between Bokmål and Nynorsk and Android prefers the specific variant.supportsRtl="true"is already set inAndroidManifest.xml, so no extra RTL wiring is needed (none of the 15 new locales are RTL anyway — Arabic and Hebrew were already in place).- Comments next to each locale entry in
locales_config.xmlmake the file self-documenting.
Reviewed on behalf of @toupper — drafted by Claude Code, please confirm before merging.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #15961 +/- ##
=========================================
Coverage 41.98% 41.98%
Complexity 13529 13529
=========================================
Files 2512 2512
Lines 145990 145990
Branches 21152 21152
=========================================
+ Hits 61297 61298 +1
Misses 78448 78448
+ Partials 6245 6244 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks @toupper. I pushed a small follow-up for the locale ordering feedback. Changed:
Not changed:
|
|
Version |
|
Version |
|
Version |
|
Version |
|
Version |

Summary
Adds the 15 new Android locale declarations to the app build/resource configuration:
resConfigsinWooCommerce/build.gradleWooCommerce/src/main/res/xml/locales_config.xmlWooCommerce/src/main/res/values/available_languages.xmlThis PR only makes the locales available to Android. It does not add generated app-string resources, the AI translation engine, CI wiring, or Play Store metadata.
Follow-up review fix included:
resConfigs,available_languages.xml, andlocales_config.xml, keeping English first.Current Stack
Open PRs in the current stack:
The locale declarations in this PR should ship together with the app-string backfill in #16004 so the newly selectable app languages do not fall back mostly to English.
Test Plan
resConfigs,locales_config.xml, andavailable_languages.xml.available_languages.xmlandlocales_config.xmlwithREXML.