Announcement Announcement Module
Collapse
No announcement yet.
strange resourceBundle issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • strange resourceBundle issue

    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:
    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" />
    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.
    My local machine has Spanish language installed, the server is English based, although in theory that shouldn't influence..

    Any ideas?

    Regards, Bo

  • #2
    when I take out <property name="useCodeAsDefaultMessage" value="true"/>

    I get the following error message in the log:
    org.springframework.context.support.ReloadableReso urceBundleMessageSource - No properties file found for [messages] - neither plain properties nor XML

    However, in WEB-INF/classes the files messages.properties and messages_en.properties are present.

    I have it installed on tomcat 7.

    Anybody has any idea?

    Comment

    Working...
    X