The framework supports internationalization (i18n) in two different places: the UI tags and the action/field error messages, including the Validation messages.
Resource Bundle Search Order
For more, see the LocalizedTextUtil class.
Package hierarchy
Examples
There are several ways to access the message resources, including getText
, the text
tag, and the i18n
tag.
Using getText
To display i18n text, use a call to getText
in the property tag, or any other tag, such as the UI tags. (The getText
technique is especially useful for labels of UI tags.)
Using the text
tag
The text tag retrieves a message from the default resource bundle.
Using the I18n
tag
The i18n tag pushes an arbitrary resource bundle on to the value stack. Other tags within the scope of the i18n tag can display messages from that resource bundle.
Internationalizing SiteMesh decorators is possible, but there are quirks. See SiteMesh Plugin for more.
I18n Interceptor
Essentially, the i18n Interceptor pushes a locale into the ActionContext map upon every request. The framework components that support localization all utilize the ActionContext locale. See I18n Interceptor for details.