Repository navigation
web/flows: fix hardcoded locale in identification stage's OR_LIST_FORMATTERS - #26017
Merged
BeryJu merged 1 commit intoSep 14, 2026
Conversation
…MATTERS OR_LIST_FORMATTERS was constructed once at module load with the locale string "default", which resolves to the browser's own locale rather than authentik's active locale. Individual field labels (e.g. "Username") are translated correctly via msg(), but the "or" connecting them never was. Move construction to render time via a createOrListFormatter(locale) factory, using the stage's already-available this.activeLanguageTag (BaseStage extends WithLocale(AKElement)) so it follows the active locale, including changes at runtime. Fixes goauthentik#20632
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
GirlBossRush
self-requested a review
September 10, 2026 13:37
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
BeryJu
approved these changes
Sep 14, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26017 +/- ##
==========================================
- Coverage 91.86% 91.25% -0.61%
==========================================
Files 1169 1169
Lines 75451 75451
Branches 4054 4054
==========================================
- Hits 69310 68854 -456
- Misses 6099 6555 +456
Partials 42 42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Contributor
|
🍒 Cherry-pick to |
BeryJu
added a commit
that referenced
this pull request
Sep 15, 2026
…MATTERS (cherry-pick #26017 to version-2026.8) (#26131) * web/flows: fix hardcoded locale in identification stage's OR_LIST_FORMATTERS (#26017) OR_LIST_FORMATTERS was constructed once at module load with the locale string "default", which resolves to the browser's own locale rather than authentik's active locale. Individual field labels (e.g. "Username") are translated correctly via msg(), but the "or" connecting them never was. Move construction to render time via a createOrListFormatter(locale) factory, using the stage's already-available this.activeLanguageTag (BaseStage extends WithLocale(AKElement)) so it follows the active locale, including changes at runtime. Fixes #20632 * sigh Signed-off-by: Jens Langhammer <[email protected]> --------- Signed-off-by: Jens Langhammer <[email protected]> Co-authored-by: nejedly-jan <[email protected]> Co-authored-by: Jens Langhammer <[email protected]>
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
What does this PR change?
Moves the "or" list formatter in the identification stage from a module-level constant to a function built at render time with the stage's active locale.
Why is this change needed?
OR_LIST_FORMATTERSwas built once withIntl.ListFormat("default", ...). That resolves to the browser's own locale, not authentik's active locale. Field labels like "Email" and "Username" translate correctly throughmsg(), but the "or" joining them stays in the browser's language no matter what locale is active.Verified directly in Node:
Intl.ListFormat("default", ...)followsLANG/LC_ALL, not anything authentik sets.How was this tested?
utils.unit.test.ts: covers en-US, cs-CZ, de-DE, plus a regression check against the old "default" locale bug.tsc --noEmit,eslint,prettier --check, andvitest runon the changed files - all pass.Linked issues
Closes #20632
AI disclosure
Root cause investigation, fix, and test were done with Claude Code (Anthropic). I reviewed the diagnosis, reproduced the locale bug myself in Node before accepting it, and verified the fix.
Checklist
make all)make docs) - no docs needed, this restores existing intended behavior, not a new/changed feature