Hello,
I have my internationalization working correctly locally (Windows 7), that is, externalContext.locale and resourceBundle return the correct values according to the selected locale. I can change the locale by adding ?locale=<locale> to the URL, so all is fine.
However, now I've installed the app on a preproduction server (Centos linux), externalContext.locale still shows the correct locale (even when I change it), but the resourceBundle always returns the english text.
My message files are organized as messages.properties (Spanish messages) and messages_en.properties (English messages).
web-application-config.xml contains the following:
So it seems the interceptor is working correctly on linux, externalContext is updated correctly, but resourceBundle doesn't pick up the locale; it chooses the messages_en.properties file instead of the default one.Code:<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list> <value>messages</value> <value>org/springframework/security/messages</value> </list> </property> <property name="useCodeAsDefaultMessage" value="true"/> </bean> <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"> <property name="paramName" value="locale" /> </bean> <!-- Declare the Resolver --> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver" />
My local machine has Spanish language installed, the server is English based, although in theory that shouldn't influence..
Any ideas?
Regards, Bo


Reply With Quote