A while ago I noticed a half-finished effort at adding internationalization to the project in the form of a partial messages_en.properties file. I decided to finish the work by externalizing all hardcoded strings from the html files into the messages_en.properties file as well as adding translations for Swedish and simplified Chinese. I also rewrote parts of the code in the interfaces package where strings had been hardcoded and replaced them with externalized strings. Finally, I wrote a LocaleContextResolver to handle the mapping of the "lang" query parameter value to matching message sources.
One feature I've left out for now is programmatic detection of new locales based on property file names, but that could be relatively easily added in the future.
A while ago I noticed a half-finished effort at adding internationalization to the project in the form of a partial
messages_en.properties
file. I decided to finish the work by externalizing all hardcoded strings from the html files into themessages_en.properties
file as well as adding translations for Swedish and simplified Chinese. I also rewrote parts of the code in theinterfaces
package where strings had been hardcoded and replaced them with externalized strings. Finally, I wrote aLocaleContextResolver
to handle the mapping of the "lang" query parameter value to matching message sources.One feature I've left out for now is programmatic detection of new locales based on property file names, but that could be relatively easily added in the future.