Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add note about XML ns for us Spring/Java/XML noobs
Table of Contents

...

LocaleChangeInterceptor configuration

You also need to add the mvc XML namespace to conf/global.xml:

Code Block
languagexml
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
[...]
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="[...]
                           http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
                           [...]"
[...]
Code Block
languagexml
<mvc:interceptors>
  <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
    <property name="paramName" value="lang"/>
  </bean>
</mvc:interceptors>

...

  1. $rpUIContext properties - ie. serviceName, organizationName, getServiceDescription() - are being translated properly according to selected locale.

  2. #springMessageText macro and other $springMacroRequestContext.getMessage() calls always return values from the messages_lang.properties file

  3. Only when you create messages_en.properties and put ie idp.title = Login service there - the value for ‘en’ locale gets selected - otherwise it always fallback as in 4.

...