Keycloak 11.0.3 does not respect kc_locale parameter

Steps to Reproduce
Set up a SAML client with Keycloak as IDP in 11.0.3
Try to login with the user and pass kc_locale=de or any enabled language that is not English.
The login page appears in English, instead of the given locale.

Description
Keycloak docs mention that if you pass kc_locale parameter during SAML login, you should get localized version of login page (ref: https://www.keycloak.org/docs/latest/server_development/#_locale_selector)

We have used this to redirect users in Keycloak 6.0.1 to the localized login page, but this is not working anymore in 11.0.3 . Instead it shows a language dropout and whole page is in English.

Any leads on what’s missing here?

I’m running into this issue as well, also on 11.0.3. This appears to also apply to the “ui_locales” query parameter.
The cookie KEYCLOAK_LOCALE and the request header Accept-Language both work when I’m debugging via postman, but neither of these can be set from the requesting application.
I have also tested this also on 12.0.2 and know the request parameters are still not working; both for SP initiated and IDP initiated URLs for SAML.

I’ve gone through the versions to find out when this behavior changed. 8.0.2 respects the query parameters, but 9.0.0 on don’t.

Still open with keycloak 14. Are there any updates on this? Where can we look to improve on this?

1 Like

I did a workaround that fixed this issue
at template.ftl a class="${properties.kcLocaleItemClass!}" href="${l.url}">${l.label} /a
instead of changing the href to l.locale
i added onClick event and then passed a function that sets a cookie for the selected language before changing href to l.url
li class=“kc-dropdown-item”><a tabindex=“0” onclick=“changeLocale(${l.label}, ${l.url})” ${l.label} /a /li

function changeLocale(label, url) {
if (label == ‘English’) {
document.cookie = “KEYCLOAK_LOCALE=en”;
} else {
document.cookie = “KEYCLOAK_LOCALE=fr”;
}
window.location.href = url
}