Table of Contents |
---|
Overview
The framework supports internationalization (i18n) in the following places:
...
Resource Bundle Search Order
Wiki Markup |
---|
{snippet:id=searchorder|javadoc=true|url=com.opensymphony.xwork2.util/LocalizedTextUtil.java} |
Tip | ||
---|---|---|
| ||
|
Default action's class
If you configure action as follow
...
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.)
Wiki Markup |
---|
{snippet:id=i18nExample|javadoc=true|lang=xml|url=org.apache.struts2.components.Property} |
Note |
---|
The default implementation of |
...
The text tag retrieves a message from the default resource bundle.
Wiki Markup |
---|
{snippet:id=i18nExample|javadoc=true|lang=xml|url=org.apache.struts2.components.Text} |
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.
Wiki Markup |
---|
{snippet:id=i18nExample|javadoc=true|lang=xml|url=org.apache.struts2.components.I18n} |
Tip | ||||
---|---|---|---|---|
| ||||
Internationalizing SiteMesh decorators is possible, but there are quirks. See SiteMesh Plugin for more. |
...
Global Resources (struts.custom.i18n.resources) in struts.properties
Wiki Markup |
---|
{snippet:id=globalresource|javadoc=true|url=com.opensymphony.xwork2.util.LocalizedTextUtil} |
Formatting Dates and Numbers
...