diff --git a/source/java/org/alfresco/web/app/Application.java b/source/java/org/alfresco/web/app/Application.java index ac0d76656e..aa6129d3f7 100644 --- a/source/java/org/alfresco/web/app/Application.java +++ b/source/java/org/alfresco/web/app/Application.java @@ -759,6 +759,7 @@ public class Application */ public static Locale getLanguage(FacesContext fc) { + boolean useInterfaceLanguage = Application.getClientConfig(fc).isLanguageSelect(); Map sessionMap = fc.getExternalContext().getSessionMap(); Boolean useSessionLocale = (Boolean)sessionMap.get(USE_SESSION_LOCALE); if (useSessionLocale == null) @@ -767,9 +768,9 @@ public class Application sessionMap.put(USE_SESSION_LOCALE, useSessionLocale); } Locale locale = (Locale)sessionMap.get(LOCALE); - if (locale == null) + if (locale == null || (!locale.equals(I18NUtil.getLocale()) && !useInterfaceLanguage)) { - if (useSessionLocale) + if (useSessionLocale && useInterfaceLanguage) { // first check saved user preferences String strLocale = null; @@ -834,9 +835,9 @@ public class Application session.setAttribute(USE_SESSION_LOCALE, useSessionLocale); } Locale locale = (Locale)session.getAttribute(LOCALE); - if (locale == null) + if (locale == null || (!locale.equals(I18NUtil.getLocale()) && !useInterfaceLanguage)) { - if (useSessionLocale) + if (useSessionLocale && useInterfaceLanguage) { // first check saved user preferences String strLocale = null; diff --git a/source/web/jsp/browse/browse.jsp b/source/web/jsp/browse/browse.jsp index c8f73def6c..cffb647ee3 100644 --- a/source/web/jsp/browse/browse.jsp +++ b/source/web/jsp/browse/browse.jsp @@ -19,6 +19,7 @@ <%@ page import="org.alfresco.web.app.Application" %> <%@ page import="javax.faces.context.FacesContext" %> +<%@ page import="java.util.Locale" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator"%> @@ -64,7 +65,12 @@ FacesContext fc = FacesContext.getCurrentInstance(); // set locale for JSF framework usage - fc.getViewRoot().setLocale(Application.getLanguage(fc)); + Locale locale = Application.getLanguage(fc); + fc.getViewRoot().setLocale(locale); + if (!Application.getClientConfig(fc).isLanguageSelect()) + { + Application.setLanguage(fc, locale.toString()); + } %> <%-- load a bundle of properties with I18N strings --%> diff --git a/source/web/jsp/dashboards/container.jsp b/source/web/jsp/dashboards/container.jsp index 39c37a6fe2..021736371e 100644 --- a/source/web/jsp/dashboards/container.jsp +++ b/source/web/jsp/dashboards/container.jsp @@ -27,6 +27,7 @@ <%@ page import="org.alfresco.web.app.Application" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> <%@ page import="javax.faces.context.FacesContext" %> +<%@ page import="java.util.Locale" %> @@ -35,7 +36,12 @@ FacesContext fc = FacesContext.getCurrentInstance(); // set locale for JSF framework usage - fc.getViewRoot().setLocale(Application.getLanguage(fc)); + Locale locale = Application.getLanguage(fc); + fc.getViewRoot().setLocale(locale); + if (!Application.getClientConfig(fc).isLanguageSelect()) + { + Application.setLanguage(fc, locale.toString()); + } %> <%-- load a bundle of properties with I18N strings --%> diff --git a/source/web/jsp/dialog/container.jsp b/source/web/jsp/dialog/container.jsp index f53a1b6e98..488cb4734e 100644 --- a/source/web/jsp/dialog/container.jsp +++ b/source/web/jsp/dialog/container.jsp @@ -26,6 +26,8 @@ <%@ page isELIgnored="false" %> <%@ page import="org.alfresco.web.app.Application" %> <%@ page import="org.alfresco.web.ui.common.PanelGenerator" %> +<%@ page import="javax.faces.context.FacesContext" %> +<%@ page import="java.util.Locale" %> <% if (Application.getDialogManager().getState() == null) @@ -38,7 +40,18 @@ if (Application.getDialogManager().getState() == null) - + <% + FacesContext fc = FacesContext.getCurrentInstance(); + + // set locale for JSF framework usage + Locale locale = Application.getLanguage(fc); + fc.getViewRoot().setLocale(locale); + if (!Application.getClientConfig(fc).isLanguageSelect()) + { + Application.setLanguage(fc, locale.toString()); + } + %> + <%-- load a bundle of properties with I18N strings --%> diff --git a/source/web/jsp/login.jsp b/source/web/jsp/login.jsp index 4c3b92723c..ac8c370525 100644 --- a/source/web/jsp/login.jsp +++ b/source/web/jsp/login.jsp @@ -69,7 +69,12 @@ FacesContext fc = FacesContext.getCurrentInstance(); // set locale for JSF framework usage (passed on by Localization Filter) - fc.getViewRoot().setLocale(I18NUtil.getLocale()); + Locale locale = I18NUtil.getLocale(); + fc.getViewRoot().setLocale(locale); + if (!Application.getClientConfig(fc).isLanguageSelect()) + { + Application.setLanguage(fc, locale.toString()); + } // set permissions error if applicable if (session.getAttribute(LoginBean.LOGIN_NOPERMISSIONS) != null)