Skip to content

web: fix email angle brackets rendering as HTML entities in localized UI - #23262

Merged
BeryJu merged 1 commit into
mainfrom
issue-22857-ui-layout-issue-when-using-localized
Jun 22, 2026
Merged

BeryJu merged 1 commit into
mainfrom
issue-22857-ui-layout-issue-when-using-localized

Conversation

@GirlBossRush

Copy link
Copy Markdown
Contributor

What changed

formatDisambiguatedUserDisplayName built the email segment by wrapping the angle brackets in a localizable message:

msg(str`<${email}>`, { id: "user.display.emailInAngleBrackets", ... })

The brackets are now emitted directly, outside any msg():

segments.push(`<${email}>`);

The orphaned user.display.emailInAngleBrackets trans-unit was then swept from every XLIFF file via npm run extract-locales.

Why is this change needed?

On the user details page, a user's email rendered as literal &lt;[email protected]&gt; in every non-English locale (German, Dutch, and others) instead of <[email protected]>. English was unaffected.

When @lit/localize-tools exports messages to XLIFF, escapeTextContentToEmbedInTemplateLiteral HTML-escapes <, >, and & for every message, not only html-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)

  • The same over-escaping affects translator-supplied entities elsewhere (e.g. &amp;quot;). A lint over the compiled web/src/locales/*.ts that flags &lt; / &gt; / &amp;quot; inside str templates would catch this class before it ships.
  • The durable fix lives upstream: restrict escapeTextContentToEmbedInTemplateLiteral to html-tagged messages.

Linked issues

Closes #22857

Disclosure

Triaged and authored end-to-end by an agent running in a sandbox against goauthentik/authentik@main.

… UI (#22857)

The user details page rendered the email portion of a user's display name as
literal "&lt;[email protected]&gt;" 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]>
@GirlBossRush
GirlBossRush requested review from a team as code owners June 22, 2026 15:31
@github-actions

Copy link
Copy Markdown
Contributor

authentik translations instructions

Thanks for your pull request!

authentik translations are handled using Transifex. Please edit translations over there and they'll be included automatically.

@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 6c96540
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a3955459685c0000783b57f
😎 Deploy Preview https://deploy-preview-23262--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 Jun 22, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 6c96540
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a3955458fb5220008b42a0c
😎 Deploy Preview https://deploy-preview-23262--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 Jun 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (870cc1a) to head (6c96540).
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
conformance 36.41% <ø> (+<0.01%) ⬆️
e2e 41.65% <ø> (+<0.01%) ⬆️
integration 32.38% <ø> (-0.49%) ⬇️
rust 0.00% <ø> (ø)
unit 92.22% <ø> (+<0.01%) ⬆️
unit-migrate 92.23% <ø> (-0.02%) ⬇️

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.

@github-actions

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

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)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

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-6c96540a542477fa213b9c37de8d0d2e3cd4a2a9

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu
BeryJu merged commit 69d358c into main Jun 22, 2026
111 checks passed
@BeryJu
BeryJu deleted the issue-22857-ui-layout-issue-when-using-localized branch June 22, 2026 16:15
kensternberg-authentik added a commit that referenced this pull request Jun 22, 2026
* main:
  website/docs: improve email authenticator docs (#23226)
  web: fix email angle brackets rendering as HTML entities in localized UI (#23262)
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.

UI layout issue when using localized UI on User Details page

2 participants