mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
WW-4722 Checks proper scope for stored locale
This commit is contained in:
@@ -235,16 +235,21 @@ public class I18nInterceptor extends AbstractInterceptor {
|
||||
* @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");
|
||||
|
||||
Reference in New Issue
Block a user