keycloak/keycloak

Locale change (Language selection) does not work first time for email link page with custom theme

Open

#46.931 geöffnet am 6. März 2026

Auf GitHub ansehen
 (1 Kommentar) (4 Reaktionen) (0 zugewiesene Personen)Java (8.346 Forks)batch import
area/authenticationarea/login/uihelp wantedkind/bugpriority/normalstatus/auto-bumpstatus/auto-expireteam/core-authnteam/core-clients

Repository-Metriken

Stars
 (34.398 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 19h) (384 gemergte PRs in 30 T)

Beschreibung

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

login/ui

Describe the bug

When using a custom login theme (with only CSS overrides), the locale selector dropdown works but the selected language is not applied on the first-time selection when the page is opened through an email action link.

The page reloads after selecting a language from the dropdown, but the content remains in the previous language.

If the user selects the language again (second attempt by choosing same language), the language is applied correctly.

This behaviour is observed on pages opened via action-token email links, such as email verification.

Version

26.5.4

Regression

  • The issue is a regression

Expected behavior

The language should change each time (including first time) when user select from language drop down.

Actual behavior

When first time user change language, the kc_locale is appended into the query param and request made to server but response contains older language content (not the one provided into kc_locale).

When user tries to change next time, it works well and content change in selected language.

How to Reproduce?

  1. Enable Internationalization in the realm.
  2. Configure a custom login theme extending the base parent theme.
  3. Configure an Identity Provider (IdP) (e.g., Github).
  4. Configure First Broker Login flow with Verify Email enabled.
  5. Initiate login using the configured IdP.
  6. During the login process, Keycloak sends a verification email containing a login continuation link.
  7. Open the login link from the email. It will open verification page.
  8. Try changing language by using language drop-down

Anything else?

It seems the kc_locale send in request does not work first time.

Contributor Guide