Skip to content

web, locale: Normalize legacy locale file names - #24024

Merged
GirlBossRush merged 2 commits into
goauthentik:mainfrom
GirlBossRush:task-remove-legacy-transifex
Jul 15, 2026
Merged

GirlBossRush merged 2 commits into
goauthentik:mainfrom
GirlBossRush:task-remove-legacy-transifex

Conversation

@GirlBossRush

@GirlBossRush GirlBossRush commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Eleven underscore files that already had a hyphenated counterpart are removed (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.
  • Three had no hyphenated counterpart, so they were orphaned contributions for locales that were never turned on. Those get renamed to their BCP-47 form and enabled in lit-localize.json: bg_BG becomes bg-BG, no_NO becomes nb-NO (the file is Bokmål, so nb is the right language subtag), and ar_AA becomes ar (the AA region is a private-use placeholder, so this keeps the plain language code). locale-codes.ts and 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_AA becomes locale/ar and locale/no_NO becomes locale/nb_NO, mirroring the ar and nb-NO decisions above (Django uses nb for Bokmål, and neither ar_AA nor no_NO is a code Django recognizes, so these load where they previously might not have). The .po Language headers move with them. Every other directory, including bg_BG and the Chinese catalogs, is left alone.

Why is this change needed?

Duplicate files drift apart. A translator updates de-DE.xlf, the stale de_DE.xlf sits 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-locales regenerates cleanly and precommit passes; the source locale (en) was not renamed or removed. On the Django side, ar and nb_NO compile and load after the rename, and nothing in authentik's config referenced the old ar_AA / no_NO codes.

@GirlBossRush
GirlBossRush requested review from a team as code owners July 14, 2026 15:09
@netlify

netlify Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 0ec1654
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a565b36572bbd000928c3ad
😎 Deploy Preview https://deploy-preview-24024--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 71a999b
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a565119cdb98600086d8843
😎 Deploy Preview https://deploy-preview-24024--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.25%. Comparing base (ba4d3ab) to head (d4824f8).

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     
Flag Coverage Δ
conformance 36.12% <ø> (+<0.01%) ⬆️
e2e 41.28% <ø> (-0.01%) ⬇️
integration 32.06% <ø> (-0.49%) ⬇️
rust 0.00% <ø> (ø)
unit 92.41% <ø> (+<0.01%) ⬆️
unit-migrate 92.45% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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
GirlBossRush force-pushed the task-remove-legacy-transifex branch from 71a999b to 0ec1654 Compare July 14, 2026 15:19
@GirlBossRush GirlBossRush changed the title web: Remove legacy Transifex-named XLIFF locale files web, locale: Normalize legacy locale file names Jul 14, 2026
@GirlBossRush GirlBossRush changed the title web, locale: Normalize legacy locale file names web: Remove legacy Transifex-named XLIFF locale files Jul 14, 2026
@GirlBossRush
GirlBossRush force-pushed the task-remove-legacy-transifex branch from ca537c5 to 0ec1654 Compare July 14, 2026 15:52
…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]>
@GirlBossRush GirlBossRush changed the title web: Remove legacy Transifex-named XLIFF locale files web, locale: Normalize legacy locale file names Jul 14, 2026

@kensternberg-authentik kensternberg-authentik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Straightforward and mechanical.

@GirlBossRush
GirlBossRush merged commit 1dc509d into goauthentik:main Jul 15, 2026
116 of 117 checks passed
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)
@GirlBossRush GirlBossRush mentioned this pull request Jul 31, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants