Resource bundles are available to facilitate displaying portlet titles in different local languages.
After you add a Portlet Adapter builder to a model, and rebuild the portlet war, the necessary resources are generated and available for you to establish localization of portlet titles.
- Locate the generated resource bundles for a particular portlet in the following location.
- Copy the existing resource bundle, and create duplicates for each language to be supported.
For example, you can start with a resource bundle named siebelperson.properties. Copy this file so that the name of the translated resource bundle for English would be siebelperson_en.properties and for French would be siebelperson_fr.properties.
Each resource bundle file for each language to be supported needs to have the correct language and country suffix.
- Repeat the copy and edit action for the remainder of the existing portlet resource bundles for this particular project.
- Find the appropriate portlet deployment descriptor file.
Open the appropriate portlet deployment descriptor file in a text editor and perform the following steps.
- For the JSR 168 portlet
- For the JSR 286 portlet
Optional: If you already deployed the portlet WAR, remove that portlet WAR.
- Search to the following section that includes the default supported locale (English denoted by en).
- Add additional locale entries for each language that you are facilitating.
- Save the changes and close the file.
Each portlet only gets the supported local values registered once when the portlet WAR is first deployed.
Add (or remove) resource bundles for each portlet.
You do not have to remove the portlet war again.
Do one of the following actions.
- Put the translated resource bundles in a .jar file and copy them to the WEB-INF\lib folder.
- Copy the individual resource bundles to the WEB-INF\classes folder.
This step is necessary because the portal class loader does not access the work\lib or the work\classes folders.
After you deploy the portlet WAR with the supported locales, if you add additional portlets to the project and to the portlet WAR or add updates to existing portlets, you only need to add additional locale resource bundles. You do not need any changes to the portlet deployment descriptor template.
Parent topic: Localizing applications