[keycloak-dev] Locale selection logic

Stian Thorgersen sthorger at redhat.com
Thu Feb 21 15:10:01 EST 2019


There has been a few issues reported around the logic of setting the
locale.

I've tried to add the issues to a single issue
https://issues.jboss.org/browse/KEYCLOAK-9632 where we can come up with a
new and improved logic. If you have observed other issues please comment on
the issue.

Something like this may work:

1. From authentication session if set
1. From user if set
2. From ui_locales if set
3. KEYCLOAK_LOCALE cookie if set
4. Browser header if set
5. Realm default
6. Fallback to en

When the locale is changed through the login pages the locale should be set
in authentication session as a note to update user locale. Note: ui_locales
should not update the users locale.

When user is authenticated update the users locale from authentication
session if set. If authenticated user has locale set, update
KEYCLOAK_LOCALE cookie.


More information about the keycloak-dev mailing list