Internationalization


Localization for Struts Freemarker users

Because it took me freaking forever to find instructions on how to do this…

  1. You do NOT need a message-resource tag in your struts configuration files. Those are outdated instructions for old versions of Struts.You do not need to edit ANY xml at all.

  2. Your Action needs to implement Freemarker’s TemplateMethodModel interface

  3. You need a package.properties file (the default locale) and a then another one for each other locale / language you want to support (ex. package_en_US.properties). These should be located in the same package as the Struts action that will be needing them. You can also do ClassName.properties if you want to tie some to a particular class.