WebSphere

 

Portal Express, Version 6.0
Operating systems: i5/OS, Linux, Windows

 

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. For IBM portlets, the resource file name to be used can be specified using a configuration parameter in the portlet.xml, c2a-nls-file.

For standard portlets, the resource file is specified using the resource-bundle parameter like this: <resource-bundle> com.myCo.myApp.myResourceBundle</resource-bundle>. The Java Portlet Specification requires each portlet to provide its own resource bundle.

Translation of the parameter, property, and 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, from the WSDL file

   <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 in the properties file:

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

A parameter and property pair pick up the caption and description from the same element, <portlet:param>.

For IBM portlets using the programmatic approach for registration, caption and description keys can be set using setTitleKey() and setDescriptionKey(), respectively. These two methods work for the action, parameter, and property elements. Portlets can also support the translation of captions and descriptions using the setLocalizationInfo() method. Captions for actions are displayed in Click-to-Action menus. The actions, parameters, and properties are displayed in the Portlet Wiring Tool.

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

 

Related information