mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 14:17:57 +01:00
Fix change locale.
This commit is contained in:
parent
dd74a7a63d
commit
43aa3e2aea
@ -5,6 +5,7 @@
|
||||
div#headerInfo {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
div#header {
|
||||
height: 35px;
|
||||
}
|
||||
|
@ -43,16 +43,9 @@ public class UserLocaleInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
if (user != null && session != null) {
|
||||
String userLocale = user.getLocale();
|
||||
final String sessionLocale = (String) session.getAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME);
|
||||
if (userLocale != null && !userLocale.equals(sessionLocale)) {
|
||||
// LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
|
||||
// if (localeResolver == null) {
|
||||
// throw new IllegalStateException("No LocaleResolver found: not in a DispatcherServlet request?");
|
||||
// }
|
||||
// LocaleEditor localeEditor = new LocaleEditor();
|
||||
// localeEditor.setAsText(userLocale);
|
||||
// localeResolver.setLocale(request, response, (Locale) localeEditor.getValue());
|
||||
session.setAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME, userLocale);
|
||||
final Locale sessionLocale = (Locale) session.getAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME);
|
||||
if ((userLocale != null) && ((sessionLocale == null) || (!userLocale.equals(sessionLocale.getISO3Language())))) {
|
||||
session.setAttribute(SessionLocaleResolver.LOCALE_SESSION_ATTRIBUTE_NAME, new Locale(userLocale));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -261,3 +261,4 @@ LAST_UPDATE=Ultima Actualización
|
||||
LAST_UPDATE_BY=Ultima Actualización Por
|
||||
SIZE=Tamaño
|
||||
NO_PRODUCTION_DATABASE_CONFIGURED=COMPLETE
|
||||
CHANGE_LANGUAGE=Cambiar Idioma
|
||||
|
@ -70,9 +70,7 @@
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
|
||||
<property name="defaultLocale" value="en"/>
|
||||
</bean>
|
||||
class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/>
|
||||
|
||||
<bean id="reCaptcha" class="net.tanesha.recaptcha.ReCaptchaImpl">
|
||||
<property name="privateKey" value="${registration.recaptcha.privateKey}"/>
|
||||
|
@ -1,6 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@ page import="org.apache.log4j.Logger" %>
|
||||
<%@ page import="com.wisemapping.security.Utils" %>
|
||||
<%@ page import="com.wisemapping.model.User" %>
|
||||
<%@ page autoFlush="true" buffer="none" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
@ -20,6 +22,7 @@
|
||||
if (exception != null) {
|
||||
exception.printStackTrace(response.getWriter());
|
||||
String usrMail = "anonymous";
|
||||
final User user = Utils.getUser(false);
|
||||
if(user!=null)
|
||||
{
|
||||
usrMail = user.getEmail();
|
||||
|
Loading…
Reference in New Issue
Block a user