-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
we do this in our project (but can't really remember now where we have messagebox for testing)
@Command("setLocale")
public void setLocale(@BindingParam("locale") String locale) {
Locales.setThreadLocal(Locales.getLocale(locale));
Executions.getCurrent().getSession().setAttribute(Attributes.PREFERRED_LOCALE,
Locales.getLocale(locale));
Executions.sendRedirect(null);
}
(only difference is the setThreadLocal)
Greetz chill. Hope this can be use for you.
2 | No.2 Revision |
we do The only thing I see in mine project that could make a difference is this in our project (but can't really remember now where we have messagebox for testing)the xml :
@Command("setLocale")
public void setLocale(@BindingParam("locale") String locale) {
<bean id="localeChangeInterceptor"
Locales.setThreadLocal(Locales.getLocale(locale));
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
Executions.getCurrent().getSession().setAttribute(Attributes.PREFERRED_LOCALE,
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
Locales.getLocale(locale));
Executions.sendRedirect(null);
}
</property>
</bean>
(only difference is the setThreadLocal)
Greetz chill. Hope this can be use for you.
3 | No.3 Revision |
The only thing I see in mine project that could make a difference is this in the xml :
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
edit :
After a while searching I found also this :
Labels.reset();
in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())
Greetz chill.
4 | No.4 Revision |
The only thing I see in mine project that could make a difference is this in the xml :
<bean id="localeChangeInterceptor"
:
Edit Subodh: This below line of config may be used when you are using Spring with ZK If only ZK Do not need to write below line of code.
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
value="lang"/>
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
edit :
After a while searching I found also this :
Labels.reset();
in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())
Greetz chill.
5 | No.5 Revision |
The only thing I see in mine project that could make a difference is this in the xml :
Edit Subodh: This below line of config may be used when you are using Spring with ZK If only ZK Do not need to write below line of code.
code.
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"> <property name="paramName" value="lang"/> </bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
edit :
After a while searching I found also this :
Labels.reset();
in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())
Greetz chill.
6 | No.6 Revision |
The only thing I see in mine project that could make a difference is this in the xml :
:
Edit Subodh: This below line of config may be used when you are using Spring with ZK If only ZK Do not need to write below line of code. code.
<bean id="localeChangeInterceptor" id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang"/>
</bean>
value="lang" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
edit :
After a while searching I found also this :
Labels.reset();
in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())
Greetz chill.
7 | No.7 Revision |
The only thing I see in mine project that could make a difference is this in the xml :
Edit Subodh: This below line of config may be used when you are using Spring with ZK If only ZK Do not need to write below line of code.
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
edit :
After a while searching I found also this :
Labels.reset();
in : http://www.zkoss.org/javadoc/6.5.2/zk/org/zkoss/util/resource/Labels.html#reset())
Greetz chill.