This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.
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:
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.
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.
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?
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.