working on internationalizating a web application, I am a bit blocked, because I don’t know how to make my .properties dinamic. I mean, to get automatically static text from the application. Now I have, for instance, this one MessageBundle_de_DE.properties:
greetings=Hallo!
inquiry=Wie geth's?
farewell=Tchüs!
But this is static, I wrote theese three couples (key, value).
How could I make my keys according to my application?? I guess this is possible, regarding on documentation.
Using Spring framework and JSP technology.
Thanks in advance, I know this is maybe too general question.
Since you’re using spring, add the following bean to your application context:
In your /WEB-INF/messages folder, create all the messages.properties files that you need i.e. messages_en_GB.properties, messages_DE.properties etc.
Then in your jsps, use the following spring provided tag:
By default the locale should be the locale your user has set in their browser. To allow them to select a different Locale (and thus the correct language), you can also add this to your application context:
Then, you just need links that include a locale property like
/?local=deto change to a German translation.