1 Reply Latest reply on Aug 18, 2010 6:33 AM by ceik

    GateIn localization with Spring mvc

    inventorfam2004

      Hi all,

       

      I am doing a sample on how localization on portlet could be done with GateIn portal and Spring MVC Framework. I am using Spring MVC.

       

      Reading through the documentation by GateIn, I found out that localization can be done with GateIn. But it must be done with the WebUI component, I.E. using the portlet class provided by GateIn.

       

      I am now finding a way to perform localization in the way that I do not use WebUI component, but Spring MVC annotation controller. Is there anyway that I can do to retain the localization mechanism fully to GateIn, while concentrating other parts on Spring MVC, as the localization should be in the purview of the portal level?

       

      Thanks for any tips and information! =)

        • 1. Re: GateIn localization with Spring mvc
          ceik

          Maybe this answer parts of your question: https://jira.jboss.org/browse/GTNPORTAL-1306

           

          If you let the browser take responsibility (as far as I have tested), you can put something like this in your applicationContext.xml:

          <bean id="messageSource"
                  class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
                  <property name="defaultEncoding" value="UTF-8" />
                  <property name="fallbackToSystemLocale" value="false" />
                  <property name="basenames">
                      <list>
                          <value>locale.portlet.custom.SomeProperty</value>
                          <value>locale.portlet.custom.log4j</value>
                      </list>
                  </property>
              </bean>

           

          And then have SomeProperty_xx.properties of what you support.

           

          In you jsp's:

          <fmt:setLocale value="<%=request.getLocale()%>" />
          <fmt:setBundle basename="locale.portlet.custom.SomeProperty" />