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

  • Roo i18n

    How do we switch on multiple language support in a Roo project? I'd like to see my app run in different languages, automagically of course
    Last edited by objectguru; Sep 9th, 2010, 02:50 PM. Reason: Clarification

  • #2
    Originally posted by objectguru View Post
    How do we switch on multiple language support in a Roo project? I'd like to see my app run in different languages, automagically of course
    That's easy. Actually all you have to do is to create a different language file in the i18n directory for messages.properties and application.properties:

    messages_de.properties
    application_de.properties

    To switch locales, you're already running the LocaleChangeInterceptor (installed in the webmvc-config.xml file). Just append ?lang=de to a page request and it will change your locale for the application. Switch back with lang=en.

    Read up on the LocaleChangeInterception for more info.

    Ken

    Comment


    • #3
      I believe

      Code:
      web mvc install language --code es
      is supposed to setup a new language for you, but it looks like the command is present but not active. It even has the wrong description. According to the source code, it's supposed to create a message_es.properties file, copy an image of the language flag, and update the footer to include the flag.
      Clicking on the flag will switch the site to the new message file, thus changing the site to the new language.

      Comment


      • #4
        Roo multiple language support

        Thanks for the response, btlife, that's the command I was looking for. Can anyone on the Roo team speak to this issue?

        Comment


        • #5
          Roo multiple language support

          I was able to add a language using the web mvc install language command. I did notice that the description was wrong, but the command generated the required files. Is there an automatic command to remove a language?

          Comment


          • #6
            As far as I can tell, there is no command to uninstall a language.
            It would be nice if you could just delete the messages_<local>.properties file and roo would update the footer.jspx, and remove the flag image.

            So I think all you need to do is delete the properties file, and then remove the entry in the footer.jspx in the <util:language> tag. and then remove the flag image so it's not orphaned.

            Comment


            • #7
              I've been enjoying the language feature in Roo -- combined with Google Translate, it's easy to localize your web app. More languages coming, I hope..

              Comment

              Working...
              X