I see that under grails-app/i18n there is a ton of messages*.properties packages. I would like to internationalize my application, but I have a βset of packagesβ per page. By the set of packages, I mean the set of bundle / property files that contain the same text, but for different languages. For example, if I want my site to support English, French and Spanish, then my About page can have a set of packages of 3 packages:
about.properties (in English)about_fr.properties (French)about_es.properties (Spanish)
If my application consists of 100 pages, and I have 3 properties files per page, then 300 properties files, which I end up getting under grails-app/i18n ! It could be a worm!
I am wondering if I can add subfolders under grails-app/i18n and organize it in a decentralized way:
myapp/ grails-app/ i18n/ about/ about.properties about_fr.properties about_es.properties contact/ contact.properties contact_fr.properties contact_es.properties fizzbuzz/ fizzbuzz.properties fizzbuzz_fr.properties fizzbuzz_es.properties ... etc.
This will provide much more convenient / cleaner / more organized code. If possible:
- Am I just creating folders / packages in
grails-app/ i18n, or is there a Grails CLI command that I can use (e.g. grails create-i18n-bundle about )? - How can I then refer to my nested packages from within the GSP? For example, in my
about.gsp , I would just use: <g:message code="about/foo.bar" /> ?
smeeb source share