Repository navigation
web: fix email angle brackets rendering as HTML entities in localized UI - #23262
Conversation
… UI (#22857) The user details page rendered the email portion of a user's display name as literal "<[email protected]>" text under any locale other than English. The root cause sits upstream in @lit/localize-tools 0.8.2. Its "escapeTextContentToEmbedInTemplateLiteral" helper HTML-escapes "<", ">", and "&" in every message string it emits into the compiled locale TS modules, including plain "str" (non-HTML) messages. The same helper also runs against the source content when a locale has no <target> for a given trans-unit, so the escaped text is baked into the fallback. English avoided the issue only because the runtime uses the live source template literal rather than the compiled module. The simplest fix is to keep the angle brackets out of the "msg(str…)" wrapper so they survive as literal characters in the JS string at runtime. RFC-style <email> notation does not need translating, and the existing "user.display.emailInAngleBrackets" trans-units had no actual translations anyway. Running "npm run extract-locales" sweeps the now-unused entries out of every XLIFF file. Co-Authored-By: Agent (authentik-i22857-kind-broad-vanilla) <[email protected]>
authentik translations instructionsThanks for your pull request! authentik translations are handled using Transifex. Please edit translations over there and they'll be included automatically. |
✅ 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 #23262 +/- ##
==========================================
- Coverage 93.28% 93.22% -0.07%
==========================================
Files 1036 1036
Lines 60421 60421
Branches 400 400
==========================================
- Hits 56364 56325 -39
- Misses 4057 4096 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
authentik PR Installation instructions Instructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-6c96540a542477fa213b9c37de8d0d2e3cd4a2a9
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-6c96540a542477fa213b9c37de8d0d2e3cd4a2a9Afterwards, run the upgrade commands from the latest release notes. |
What changed
formatDisambiguatedUserDisplayNamebuilt the email segment by wrapping the angle brackets in a localizable message:The brackets are now emitted directly, outside any
msg():The orphaned
user.display.emailInAngleBracketstrans-unit was then swept from every XLIFF file vianpm run extract-locales.Why is this change needed?
On the user details page, a user's email rendered as literal
<[email protected]>in every non-English locale (German, Dutch, and others) instead of<[email protected]>. English was unaffected.When
@lit/localize-toolsexports messages to XLIFF,escapeTextContentToEmbedInTemplateLiteralHTML-escapes<,>, and&for every message, not onlyhtml-tagged ones. The source (English) locale renders from the original TypeScript template and stays correct; non-source locales render the escaped XLIFF text, so the entities surface verbatim.The angle brackets are structural punctuation, not translatable copy, so the fix is to keep them out of the localization pipeline entirely.
Follow-ups (out of scope)
&quot;). A lint over the compiledweb/src/locales/*.tsthat flags</>/&quot;insidestrtemplates would catch this class before it ships.escapeTextContentToEmbedInTemplateLiteraltohtml-tagged messages.Linked issues
Closes #22857
Disclosure
Triaged and authored end-to-end by an agent running in a sandbox against
goauthentik/authentik@main.