Results 1 to 5 of 5

Thread: MultiLanguage Spring Application

  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Default MultiLanguage Spring Application

    Hi All,

    We are developing a MultiLanguage Application in Spring Framework. When i use the

    <bean id="ms" class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basenames">
    <list>
    <value>msg1</value>
    <value>msg2</value>
    <value>msg3</value>
    </list>
    </property>
    </bean>

    ResourceBundleMessageSource, All the Label in my UI is loded through the Above Property files. If i want to change the Another Language like French What i have to do?


    Thanks in Advance.
    Badhu

  2. #2
    Join Date
    Nov 2005
    Posts
    148

    Default

    hi,

    Do the follwoinbg things in ur projectname-Servlet.xml

    <bean id="localeChangeInterceptor"
    class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor">
    <property name="paramName"><value>siteLanguage</value></property>
    </bean>

    <bean id="localeResolver"
    class="org.springframework.web.servlet.i18n.Sessio nLocaleResolver"/>


    after this add the localeChangeInterceptor in url mappings.



    Regards,
    Shahzad

  3. #3
    Join Date
    Mar 2006
    Posts
    2

    Default Multilanguage Spring Application

    Hello Shahzad


    I Have to specify the

    <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.Locale ChangeInterceptor">
    <property name="paramName"><value>siteLanguage</value></property>
    </bean>

    <bean id="localeResolver" class="org.springframework.web.servlet.i18n.Sessio nLocaleResolver"/>

    the above <bean> tag in my application-servlet.xml file. After the URL mapping.

    Instead of siteLanguage can i put us / fr / ar something like this.

    In my Application i used more than one ApplicationContext files i specified in my web.xml.

    Can i add the above <bean> tags in my applicationContext.xml file.

    Pls give ur suggestion.

    Thanks in Advance
    Badhu

  4. #4
    Join Date
    Nov 2005
    Posts
    148

    Thumbs up You can do this

    Hi,

    You can do this in Application Conext XMl.

    <bean id="localeResolver"
    class="org.springframework.web.servlet.i18n.Sessio nLocaleResolver"/>


    Regards,

    Shahzad

  5. #5
    Join Date
    Dec 2006
    Posts
    150

    Default

    Can you please explain more details?

    i put the localeChangeInterceptor bean and the localeResolver in my springdispatcher-servlet.xml.

    How can i now load all my text from the database???

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •