Internationalization


Portlets that support translation of the captions and descriptions associated with shared properties must provide resource bundles in the appropriate location in the WAR file. The resource file name to be used can be specified using a configuration parameter in the portlet.xml, c2a-nls-file.

There is an example of the use of this parameter in the portlet.xml of c2asampleshipping.war.

Translation of the action captions and descriptions is supported by specifying, for the caption and description attributes of the <portlet:action> element, the name of the key in the resource bundle where the value of these attributes is to be retrieved. For example,

   <portlet:action name="orderDetails" caption="Order.Details" description="Get.details.for.specified.order.id"/>

The values for these attributes are obtained from the appropriate resource bundle:

Order.Details=Order Details
Get.details.for.specified.order.id=Get details for specified order id

You can support translation of the caption and description attributes values of the encodeProperties tag. To achieve this, these values must be entered as a key in the appropriate c2a_xx.properties file with the string to be displayed on the right hand side. For example:

Send.to.all=Send to all

Portlets can also support the translation of captions and descriptions using the setLocalizationInfo() method. See the example under Programmatically registering properties.

See also