WebSphere Portal is built with a framework that lets you plug in new features or extensions that are called portlets. In the same way a servlet is an application within a Web server, a portlet is an application within the WebSphere Portal. Portlets are central to allowing a portal to function as a window to information and tasks. A globalized portlet needs to respond to personal landguage and locale preferences, and individual business roles. Design, deployemnt and maintenance should be straightforward to developers with basic portlet coding skills.
Portlets that display a user's client's language translations are handled by targeted language sets. To create a globalized portlet using WebSphere Portal, you do not need to develop separate portlets for each language. WebSphere Portal lets developers create one portlet with multi-language support, although you need to prepare the translations separately. During run time, the corresponding language data will be loaded by the system according to the user's preferred language. The developer needs to decide which language set to support, and have translations prepared accordingly.
To develop a globalized portlet, follow these steps:
-
Develop the portlet following internationalization best practices
-
Prepare the translations.
-
Create properties files for different languages.
-
Create JSP files using portal-defined JSP tags.
-
Include JSP files in the portlet's doView() method.
-
Package the files to a WAR file.
-
Deploy the portlet to WebSphere Portal.
To support a new language, add it to the file language.properties by inserting resource bundles and, where applicable, JSP's for the new language. Some JSP's use resource bundles while others, such as help JSP's, are translated directly.
Notes
-
A portlet can support one or more locales. Portlets must have their own default language specified in the deployment descriptor. it cannot be installed.
-
Remote portlets also need a default language. The portal server sends three languages to the remote server. If none of the languages above is supported by the portlet, the portlet is shown in its default language.
-
The user language chosen during enrollment
-
The language specified in the user's browser
-
The portal default language
-
Render character sets properly - the language of the portlet must be supported by the character set of the portal. The default encoding is UTF-8. To help the user's browser to render content correctly, the character set beiing used is written to the HTTP header of the response stream. The values in use are:
| Japanese ja |
Shift-JIS |
| Simplified Chinese zh |
GBK |
| Traditional Chinese zh_TW, HTML |
Big5 |
| Traditional Chinese zh_TW, WML |
UTF-8 |
| Korean ko |
KSC5601 |
| All others |
UTF-8 |
|