KEYCLOAK-2576 KEYCLOAK-2576
Changing locale on login screen doesn't affect current user
This commit is contained in:
parent
45b940ad2d
commit
13b6c6f507
1 changed files with 10 additions and 10 deletions
|
@ -61,16 +61,6 @@ public class LocaleHelper {
|
|||
}
|
||||
}
|
||||
|
||||
// User profile
|
||||
if (user != null && user.getAttributes().containsKey(UserModel.LOCALE)) {
|
||||
String localeString = user.getFirstAttribute(UserModel.LOCALE);
|
||||
Locale locale = findLocale(realm.getSupportedLocales(), localeString);
|
||||
if (locale != null) {
|
||||
updateLocaleCookie(session, realm, localeString);
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
|
||||
// Locale cookie
|
||||
if (httpHeaders != null && httpHeaders.getCookies().containsKey(LOCALE_COOKIE)) {
|
||||
String localeString = httpHeaders.getCookies().get(LOCALE_COOKIE).getValue();
|
||||
|
@ -83,6 +73,16 @@ public class LocaleHelper {
|
|||
}
|
||||
}
|
||||
|
||||
// User profile
|
||||
if (user != null && user.getAttributes().containsKey(UserModel.LOCALE)) {
|
||||
String localeString = user.getFirstAttribute(UserModel.LOCALE);
|
||||
Locale locale = findLocale(realm.getSupportedLocales(), localeString);
|
||||
if (locale != null) {
|
||||
updateLocaleCookie(session, realm, localeString);
|
||||
return locale;
|
||||
}
|
||||
}
|
||||
|
||||
// ui_locales query parameter
|
||||
if (uriInfo != null && uriInfo.getQueryParameters().containsKey(UI_LOCALES_PARAM)) {
|
||||
String localeString = uriInfo.getQueryParameters().getFirst(UI_LOCALES_PARAM);
|
||||
|
|
Loading…
Reference in a new issue