27.2.5 Internationalization
To support translation of captions and descriptions associated with shared properties or actions you need to provide resource bundles in the appropriate location in the WAR file. These captions and descriptions are shown when you create wires using the Portlet Wiring Tool. For JSR 168 compliant portlets, the resource file is specified using the resource-bundle parameter located in the portlet deployment descriptor (portlet.xml file), for example:
<resource-bundle>echo.nl.EchoPortletResource</resource-bundle>Caption and description attributes of the portlet:action and portlet:param elements in WSDL file specify the name of the key in the resource bundles where the value of these attributes is to be retrieved. For example:
<portlet:action name="/welcome.do" type="standard-struts" actionNameParameter="spf_strutsAction" caption="show.message" description="Get.Message.from.user"/> <output> <portlet:param name="inmsg" partname="input_msg" boundTo="request-parameter" caption="in.message"/> </output>The values of these attributes are obtained from the appropriate resource bundle (EchoPortletResource properties file), located in the EchoSource/Java Resources/JavaSource/echo.nl directory. For example:
Example 27-5 EchoPortletResource.properties.
# # PortletInfo Resource Bundle # javax.portlet.title=Echo portlet Source javax.portlet.short-title= javax.portlet.keywords=
show.message=Show message in.message=Input message Get.Message.from.user=Get message from user
![]()
ibm.com/redbooks