Skip to content

Commit

Permalink
WW-4722 Checks proper scope for stored locale
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszlenart committed Dec 2, 2016
1 parent 484ce1d commit baffa9a
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,21 @@ protected void storeLocaleInSession(ActionInvocation invocation, Locale locale)
* @return the read locale
*/
protected Locale readStoredLocale(ActionInvocation invocation) {
Locale locale = readStoredLocalFromSession(invocation);
if (locale != null) {
LOG.debug("Found stored Locale {} in session, using it!", locale);
return locale;
Locale locale;
if (storage == Storage.COOKIE) {
locale = readStoredLocalFromSession(invocation);
if (locale != null) {
LOG.debug("Found stored Locale {} in session, using it!", locale);
return locale;
}
}

Locale cookie = readStoredLocaleFromCookie(invocation);
if (cookie != null) {
LOG.debug("Found stored Locale {} in cookies, using it!", locale);
return cookie;
if (storage == Storage.SESSION) {
locale = readStoredLocaleFromCookie(invocation);
if (locale != null) {
LOG.debug("Found stored Locale {} in cookies, using it!", locale);
return locale;
}
}

LOG.debug("Neither locale was in session nor in cookies, searching current Invocation context");
Expand Down

0 comments on commit baffa9a

Please sign in to comment.