Skip to content

Commit

Permalink
fix(jans-auth-server): added faces context as source of locale (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Milton-Ch authored Apr 11, 2022
1 parent 438c896 commit ce770ae
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void setLocaleCode(String requestedLocaleCode) {

public Locale getLocale() {
try {
Locale locale = getCookieLocale();
Locale locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
if (locale != null) {
return locale;
}
Expand Down Expand Up @@ -152,6 +152,8 @@ private void setCookieValue(String value) {
response.addCookie(cookie);
}

@Deprecated
// Cookie is not storing value first time. This is causing default language setting
private Locale getCookieLocale() {
String cookieValue = getCookieValue();
if (StringHelper.isEmpty(cookieValue)) {
Expand Down

0 comments on commit ce770ae

Please sign in to comment.