This page last changed on Dec 14, 2004 by plightbo.

<ww:text />

Print out an internationalized string. It is used in conjuction with the i18n tag. The text tag gets a specific message from the bundle specified in the surrounding i18n tag. Values can be passed into the message for parsing, for instance to format a date or currency.

Attributes
Name Required Description
name yes Name of property to fetch
id no When specified, causes output to be stored in the ActionContext using the id as the key rather than printing out the text
value0 no Pass data to param 0 in message
value1 no Pass data to param 1 in message
value2 no Pass data to param 2 in message
value3 no Pass data to param 3 in message

Sample Usages

Accessing messages from a given bundle (the i18n Shop example bundle in this case)<br>
<ww:i18n name="'webwork.action.test.i18n.Shop'">
  <ww:text name="'main.title'"/>
</ww:i18n>

<ww:i18n id="foo" name="'webwork.action.test.i18n.Shop'">
  <ww:text name="'main.title'"/>
</ww:i18n>
<ww:property value="#foo"/>

Note that instead of using value0..value4, you may also:

<ww:text name="'someKey'">
    <ww:param value="'Hello'"/>
</ww:text>

OR

<ww:text name="'someKey'">
    <ww:param>Hello</ww:param>
</ww:text>

The last format is particularly good when you are embedding HTML in to the message, since you don’t need to worry about escaping the various quotes that might be there.
Document generated by Confluence on Dec 14, 2004 16:36