Repository navigation
web/i18n: load the locale catalog before boot and remove msg() thunks - #27618
Merged
Merged
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Contributor
Playwright e2eDownload this run's HTML report and traces, then open the report: gh run download 42095087788 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-reportInstallation instructionsInstructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-3588040a65d778d4d7d64ad7bd5f00d77f1ae15c
# Distroless image: AUTHENTIK_TAG=gh-3588040a65d778d4d7d64ad7bd5f00d77f1ae15c-distroless
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-3588040a65d778d4d7d64ad7bd5f00d77f1ae15c
# Distroless image: tag: gh-3588040a65d778d4d7d64ad7bd5f00d77f1ae15c-distrolessAfterwards, run the upgrade commands from the latest release notes. |
kensternberg-authentik
approved these changes
Nov 5, 2026
kensternberg-authentik
left a comment
Contributor
There was a problem hiding this comment.
This looks coherent. It's a lot of just shuffling things around; the win isn't quite clear to me.
Entrypoints import the moved module, with no change in behavior. This lets a later change run code before the interface modules evaluate.
The locale is fixed per page since #25156, but the catalog still loaded from a component lifecycle hook, after every statically imported module had evaluated. Module-level msg() calls returned English. - each entrypoint awaits initializeLocale() before importing the interface - the lit-localize runtime moves to #common/ui/locale/runtime
Switching locale reloads the page since #25156, and the catalog now loads before boot, so nothing observes a locale change after startup. - LocaleContextController only provides the runtime; drop the lang observer - drop the activeLanguageTag setter from WithLocale - drop LOCALE_STATUS_EVENT listeners in the admin interface, API locale middleware, captcha stage, and locale select
The catalog now loads before any interface module evaluates, so label records can hold translated strings directly. - label records hold strings instead of MessageFormatter thunks - call sites read the value instead of calling it
GirlBossRush
force-pushed
the
web/locale-boot-modules
branch
from
November 5, 2026 19:31
1ef8fbb to
4bdced4
Compare
This was referenced Nov 5, 2026
GirlBossRush
enabled auto-merge (squash)
November 5, 2026 19:54
GirlBossRush
disabled auto-merge
November 5, 2026 22:07
kensternberg-authentik
added a commit
that referenced
this pull request
Nov 6, 2026
* main: website/docs: dry run: move :ak-version to header (#27678) web: policy dry run UI (#26621) providers/oauth2: fix max_age=0 not forcing reauth (#27518) ci: bump pnpm/action-setup from 6.1.0 to 6.1.1 (#27666) core: bump oauthlib from 4.0.0 to 4.0.1 (#27658) core: bump psycopg[c,pool] from 3.3.6 to 3.3.7 (#27672) core: bump selenium from 4.51.0 to 4.52.0 (#27670) ci: bump helm/kind-action from 1.15.1 to 1.15.2 (#27667) ci: bump pnpm/action-setup from 6.1.0 to 6.1.1 in /.github/actions/setup (#27668) ci: bump the codeql group across 1 directory with 3 updates (#27665) ci: bump taiki-e/install-action from 2.89.1 to 2.90.0 in /.github/actions/setup (#27669) core: bump goauthentik/fips-python from `69e7058` to `b203e83` in /lifecycle/container (#27664) core: bump openapitools/openapi-generator-cli from v7.26.0 to v7.27.0 in /packages/client-go (#27661) stages/authenticator_validate: prevent WebAuthn challenge races (#26291) web/i18n: load the locale catalog before boot and remove msg() thunks (#27618)
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
This PR fixes the order in which authentik loads translations in its frontend. Previously, authentik could evaluate frontend modules before the translation catalog was ready.
For example, a component defines a label at module level:
If the translation catalog hasn't loaded yet,
msg("Username")can return the English fallback instead of the translated value.Changes
A. Load translations before frontend initialization
The PR changes the startup sequence:
Previously:
Now:
The important change is that
initializeLocale()is awaited before importing the interfaceB. Move entrypoint code into separate modules
The bodies of these entrypoints are moved into importable modules:
boot.tsak-rac.tsak-api-browser.tsThe original entrypoints import these modules.
This allows authentik to execute initialization logic before the interface modules are evaluated.
C. Move the Lit Localize runtime
The Lit Localize runtime is moved to
#common/ui/locale/runtime. This centralizes access to the localization runtime.D. Remove live locale switching
The PR removes several mechanisms that listened for locale changes:
langobserveractiveLanguageTagsetterLOCALE_STATUS_EVENTlisteners in the admin interface, API locale middleware, captcha stage, and locale selectorWhy?
authentik already reloads the page when the language, removing the need to dynamically update the language throughout an already-running frontend
E. Remove
msg()thunks from label recordsPreviously, label records stored functions that needed to be executed to retrieve translated strings
For example:
Now, they can store the translated string directly: