Repository navigation
web, locale: Normalize legacy locale file names - #24024
Merged
GirlBossRush merged 2 commits intoJul 15, 2026
Merged
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #24024 +/- ##
==========================================
- Coverage 93.31% 93.25% -0.06%
==========================================
Files 1045 1045
Lines 61401 61401
Branches 424 424
==========================================
- Hits 57296 57261 -35
- Misses 4105 4140 +35
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
The old Transifex config named locale files with underscores (cs_CZ.xlf, pt_BR.xlf, ...) alongside the hyphenated BCP-47 form the current lit-localize pipeline actually reads. That config was fixed months ago, so the underscore files are either stale duplicates of a current kebab-case sibling or orphaned contributions for locales the project never enabled. Deleted 11 legacy files that already have a kebab-case equivalent in web/xliff/. Kebab wins even where the two diverged, so 2,220 legacy-only <trans-unit> targets get dropped along the way (fr_FR carried the bulk at 954; the rest of the languages contribute the remaining 1,266). Renamed 3 legacy files with no kebab counterpart and added their locale codes to web/lit-localize.json targetLocales: - ar_AA.xlf -> ar.xlf (AA was a bogus private-use region; landed on the plain language code). - bg_BG.xlf -> bg-BG.xlf. - no_NO.xlf -> nb-NO.xlf (no is the Norwegian macrolanguage; the translation is Bokmal, so nb is the correct language subtag). Each renamed file also has its internal target-language attribute updated to match its new locale code, so lit-localize keeps recognising the existing translations instead of treating everything as absent. Wired the new locales into LocaleLoaderRecord in web/src/common/ui/locale/definitions.ts so the runtime can import the emitted modules; lit-localize regenerates web/src/locale-codes.ts to match. locale/ (Django gettext) stays exactly as it was. Verified with: cd web && npm run build-locales && npm run precommit. Co-Authored-By: Agent (authentik-m-remove-legacy-intended-nominal-mahogany) <[email protected]>
GirlBossRush
force-pushed
the
task-remove-legacy-transifex
branch
from
July 14, 2026 15:19
71a999b to
0ec1654
Compare
GirlBossRush
force-pushed
the
task-remove-legacy-transifex
branch
from
July 14, 2026 15:52
ca537c5 to
0ec1654
Compare
…O to nb_NO)
Mirror the two locale-code changes just landed on the web/xliff side
into the Django gettext tree, in Django's ll_CC underscore form:
- locale/ar_AA -> locale/ar (drop the bogus AA private-use region;
matches web ar).
- locale/no_NO -> locale/nb_NO (Norwegian macrolanguage to Bokmal,
which is the writing system the contributed translation uses;
matches web nb-NO).
bg_BG is left alone (already equals the underscore form of the web
bg-BG), and every other Django locale directory - including zh-Hans
and zh-Hant - stays exactly as it was.
Both catalogs also had their in-file Language header updated to match
the new directory (Language: ar_AA -> ar, Language: no_NO -> nb_NO)
and the .mo binaries were recompiled via manage.py compilemessages so
runtime lookups get the correct language metadata.
No functional LANGUAGES / LANGUAGE_CODE settings referenced the old
codes: only historical Transifex team URLs in the .po Language-Team
headers and past release-notes lines mention them, and those are
metadata / audit trail rather than config.
Verified: to_locale('nb-no') -> 'nb_NO', to_locale('ar') -> 'ar', and
gettext.translation loads locale/ar/LC_MESSAGES/django.mo (1,122
entries, language=ar) and locale/nb_NO/LC_MESSAGES/django.mo (1,116
entries, language=nb_NO).
Co-Authored-By: Agent (authentik-m-remove-legacy-intended-nominal-mahogany) <[email protected]>
kensternberg-authentik
approved these changes
Jul 14, 2026
kensternberg-authentik
left a comment
Contributor
There was a problem hiding this comment.
Straightforward and mechanical.
kensternberg-authentik
added a commit
that referenced
this pull request
Jul 15, 2026
* main: website/docs: release notes for 2026.5.5 (#24070) website/docs: release notes for 2026.2.6 (#24069) web, locale: Normalize legacy locale file names (#24024) web/bug: harmonize and make routine the display of tasks (part 4: schedule-list cards) (#23855) security: automated internal backport of patch 1822.sec.patch to authentik-main (#24064) security: automated internal backport of patch 1934.sec.patch to authentik-main (#24067) security: automated internal backport of patch 1887.sec.patch to authentik-main (#24065) security: automated internal backport of patch 1919.sec.patch to authentik-main (#24066) security: automated internal backport of patch 1817.sec.patch to authentik-main (#24063)
kensternberg-authentik
added a commit
that referenced
this pull request
Jul 15, 2026
…card-3-problem-children * web/cleanup/schedule-card-2: (113 commits) website/docs: release notes for 2026.5.5 (#24070) website/docs: release notes for 2026.2.6 (#24069) web, locale: Normalize legacy locale file names (#24024) web/bug: harmonize and make routine the display of tasks (part 4: schedule-list cards) (#23855) security: automated internal backport of patch 1822.sec.patch to authentik-main (#24064) security: automated internal backport of patch 1934.sec.patch to authentik-main (#24067) security: automated internal backport of patch 1887.sec.patch to authentik-main (#24065) security: automated internal backport of patch 1919.sec.patch to authentik-main (#24066) security: automated internal backport of patch 1817.sec.patch to authentik-main (#24063) web/flow: revert locale-driven flow re-request from FlowExecutor (#24050) web/bug: harmonize and make routine the display of tasks (part 3: problem children) (#23840) root: PostgreSQL direct-endpoint support for LISTEN/NOTIFY and advisory locks (#23013) docs/social-logins: Add jumpcloud oidc and saml (#24048) core, web: update translations (#24037) web: bump @goauthentik/eslint-config from 2.0.0 to 2.0.2 in /web in the goauthentik group across 1 directory (#24007) ci: bump taiki-e/install-action from 2.82.9 to 2.83.2 in /.github/actions/setup (#24045) website: bump openapi-to-postmanv2 from 6.2.0 to 6.3.0 in /website (#24041) core: bump pnpm/pnpm from 11.11.0 to 11.12.0 in /lifecycle/container (#24042) core: bump pnpm/pnpm from 11.11.0 to 11.12.0 in /website (#24043) web: bump @sentry/browser from 10.63.0 to 10.64.0 in /web in the sentry group across 1 directory (#24044) ...
kensternberg-authentik
added a commit
that referenced
this pull request
Jul 15, 2026
* main: website/docs: release notes for 2026.5.5 (#24070) website/docs: release notes for 2026.2.6 (#24069) web, locale: Normalize legacy locale file names (#24024) web/bug: harmonize and make routine the display of tasks (part 4: schedule-list cards) (#23855) security: automated internal backport of patch 1822.sec.patch to authentik-main (#24064) security: automated internal backport of patch 1934.sec.patch to authentik-main (#24067) security: automated internal backport of patch 1887.sec.patch to authentik-main (#24065) security: automated internal backport of patch 1919.sec.patch to authentik-main (#24066) security: automated internal backport of patch 1817.sec.patch to authentik-main (#24063)
7 tasks
GirlBossRush
added a commit
that referenced
this pull request
Oct 7, 2026
Transifex writes web/xliff/<lang>.xlf with underscore codes (cs_CZ.xlf), but lit-localize only reads the hyphenated files named in targetLocales. Translator work landing in the underscore files never shipped. Fold each underscore file into its canonical sibling, following the #24563 recovery rule: a stranded target wins over the existing one. A donor target is only taken when its <source> matches the canonical source and its placeholder ids match; placeholders are rewritten from the canonical source so equiv-text stays current. - In-tree duplicates: cs_CZ, de_DE, fi_FI, fr_FR, it_IT, ja_JP, pt_BR, bg_BG, pl_PL, plus ar_AA -> ar and no_NO -> nb-NO. - Files deleted by #24024, recovered from 1dc509d^: es_ES, ko_KR, ru_RU, tr_TR (and the older cs/de/fi/fr/it/ja/pt_BR copies as a lower-priority donor). 2,478 targets filled and 167 replaced across 15 locales. The underscore duplicates are removed. Orphans for unshipped locales (bn_BD, cy_GB, da_DK, hr_HR, sk_SK, sv_SE) are left for their enablement PRs.
GirlBossRush
added a commit
that referenced
this pull request
Oct 8, 2026
…es (#26735) * web: recover stranded Transifex translations into canonical xliff files Transifex writes web/xliff/<lang>.xlf with underscore codes (cs_CZ.xlf), but lit-localize only reads the hyphenated files named in targetLocales. Translator work landing in the underscore files never shipped. Fold each underscore file into its canonical sibling, following the #24563 recovery rule: a stranded target wins over the existing one. A donor target is only taken when its <source> matches the canonical source and its placeholder ids match; placeholders are rewritten from the canonical source so equiv-text stays current. - In-tree duplicates: cs_CZ, de_DE, fi_FI, fr_FR, it_IT, ja_JP, pt_BR, bg_BG, pl_PL, plus ar_AA -> ar and no_NO -> nb-NO. - Files deleted by #24024, recovered from 1dc509d^: es_ES, ko_KR, ru_RU, tr_TR (and the older cs/de/fi/fr/it/ja/pt_BR copies as a lower-priority donor). 2,478 targets filled and 167 replaced across 15 locales. The underscore duplicates are removed. Orphans for unshipped locales (bn_BD, cy_GB, da_DK, hr_HR, sk_SK, sv_SE) are left for their enablement PRs. * web: fix recovered French Kerberos help and typos The recovered fr-FR Kerberos sync help described a password or keytab cache instead of the alternative credentials. Also fixes a French typo and a German formal/informal mix. * core, web: register locales in locales.yaml and normalize Transifex paths Transifex substitutes its own language code into both translation paths, and its language_mapping is global, so it can't satisfy lit-localize (pt-BR.xlf) and Django (locale/pt_BR/) at once. Files landed under names neither build reads, and nothing reported it. - locales.yaml is the source of truth: tag, Django directory, Transifex code, and whether the locale ships. - `make gen-locales` writes targetLocales, the LocaleLoaderRecord region, and the Transifex language_mapping (code -> web tag). - `make locales-normalize` moves locale/<tag>/ to locale/<to_locale(tag)>/ and folds stray xliff files into their canonical file. - `make lint-locales` / ci-lint-locales fail on unregistered paths and stale generated files. A Django test checks each shipped catalog loads. - A workflow normalizes Transifex PRs and pushes the correction. Migration: ar_AA -> ar and no_NO -> nb_NO backend catalogs merged; locale/zh-Hans and zh-Hant renamed to zh_Hans/zh_Hant, which Django can now find (it served 37 of 1043 zh-Hans strings before); unshipped xliff orphans renamed to their tags. Refs #24563 * core: address locale pipeline review - Normalize xliff target-language on every recognized file, not only renamed ones, and fail the check on a mismatch. Transifex's mapping renames files but keeps aliases like ar-AA inside them, and lit-localize keys catalogs by that attribute. - Merge every file from a Transifex locale directory, not only django.po. A conflicting non-catalog file stops the merge before anything is deleted. - Set each catalog's Language header to its directory, and check it. - Type the merge callback for mypy --strict. - Ignore msgstr == msgid in the catalog test, so an English fallback can't count as a served translation. * core, web: ship bn-BD and sk-SK through locales.yaml Bengali and Slovak were enabled on main by hand. Register them as shipped so the generated lists stay in sync. * web: re-extract locales Normalizes Transifex entity escaping in recovered targets and drops the removed base-URL banner strings. * ci: harden translation normalize workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
web/xliff/carried two naming conventions at once. The current lit-localize pipeline writes hyphenated BCP-47 filenames (de-DE.xlf,pt-BR.xlf), while an older Transifex config wrote underscores (de_DE.xlf,pt_BR.xlf). That Transifex config was fixed months ago, so the underscore files are just leftovers. Each one is either an exact duplicate of a file that already exists in the correct form, or a one-off translation someone contributed for a locale that was never enabled.This clears them out:
cs_CZ,de_DE,es_ES,fi_FI,fr_FR,it_IT,ja_JP,ko_KR,pt_BR,ru_RU,tr_TR). lit-localize reads the hyphenated versions; the underscore copies were dead weight.lit-localize.json:bg_BGbecomesbg-BG,no_NObecomesnb-NO(the file is Bokmål, sonbis the right language subtag), andar_AAbecomesar(theAAregion is a private-use placeholder, so this keeps the plain language code).locale-codes.tsand the locale definitions regenerate to match.The Django gettext catalogs under
locale/keep their underscore convention, but two directories carried language codes that no longer line up with the web tags.locale/ar_AAbecomeslocale/arandlocale/no_NObecomeslocale/nb_NO, mirroring thearandnb-NOdecisions above (Django usesnbfor Bokmål, and neitherar_AAnorno_NOis a code Django recognizes, so these load where they previously might not have). The.poLanguageheaders move with them. Every other directory, includingbg_BGand the Chinese catalogs, is left alone.Why is this change needed?
Duplicate files drift apart. A translator updates
de-DE.xlf, the stalede_DE.xlfsits behind it, and it's not obvious which one is live. Clearing them leaves one file per locale. Folding in the three orphaned contributions also means translation work people already did actually ships, instead of sitting unreferenced in the tree.How was this tested?
build-localesregenerates cleanly and precommit passes; the source locale (en) was not renamed or removed. On the Django side,arandnb_NOcompile and load after the rename, and nothing in authentik's config referenced the oldar_AA/no_NOcodes.