Internationalization Support

     

WebSphere Portal customers in non-English speaking countries and multinational corporations need to have content in their native language. WebSphere Portal server supports multiple languages by trying to match the user with a language preference. If the language preference was not specified, the portal tries to make a match based on the language of the browser. This capability also extends to any portlets that have been enabled for translation. Since the default language is English, on a given page, any portlets that have the ability to show translated content will be shown in the language of choice. Otherwise , they will be displayed in English.

Supported Languages

Currently, WebSphere Portal server supports the following languages:

  • English

  • French

  • German

  • Italian

  • Spanish

  • Czech

  • Hebrew

  • Polish

  • Turkish

  • Brazilian Portuguese

  • Japanese

  • Korean

  • Simplified Chinese

  • Traditional Chinese

Following are the steps needed to change the language properties of WebSphere Portal server into a language that is not on the supported list.

Selecting and Changing the Language

There are various places and ways to change the language supported by the portal. Here are ways to select or change a language.

Installation

The installation program uses the default locale of the operating system to display the panels in the language supported by that locale. Once installation is done, this default language is stored in the LocalizerService.properties file in the <WAS_HOME>/lib/app/config/services directory. This file has three primary properties, as shown in Listing E-1.

Listing E-1. The LocalizerService.properties File
 # Licensed Materials  Property of IBM, 5724-B88, (C) Copyright IBM Corp. 2001, 2002 graphics/ccc.gif All Rights reserved. # ------------------------------------ # # Properties of the Localizer Service # # ------------------------------------ # # Language, country, and variant settings for the default locale # # Default: <empty> [ = Locale.getDefault() ] locale.default.language =en locale.default.country = locale.default.variant = # # List of BiDirectional languages separated by ',' or ';' # Add ar,ur,yi, when there are resources for those languages. # locales.bidi = he 

To change the default language and locale supported, the locale.default.language and locale.default.country parameters need to be changed. Sometimes, there is a locale variant. For example, in order to change to American English, the parameters should be set as follows :

 

 locale.default.language = en locale.default.country = US 

A portlet can support one or more locales. All portlets must have their own default language specified in the deployment descriptor; otherwise, the portlet cannot be installed.

Changing Titles and Descriptions for Places

In the manage Places and Pages tab, use Work with Pages to change the title for places and pages. This portlet allows you to change the title and description for each available place and page. The following instructions outline the steps needed to change the title for places.

  1. In the Work with Pages place, go to Manage Places and Pages tab.

  2. Select Home as the place and click Set locale-specific -titles.

  3. Select the radio button corresponding to the required locale and then click Set title for selected locale.

  4. Enter the new title for the place, and click OK. The place will be displayed with its new "localized" name .

Changing Titles and Descriptions for a Page

To change the title for a page, follow these steps.

  1. Highlight the page from the list of available pages and click Manage Pages.

  2. Select the page with the title you want to change and click Manage Page Properties. From here, the steps are similar to what you did for changing the title of a place.

Language Selection by the User

A user can select a personal language preference for rendering portal content during the enrollment process. If the user later decides to change the locale, he can use the Edit My Profile portlet to specify the preferred language form the drop-down list. The list of languages matches what is specified in the <WAS_HOME>/lib/app/config/language.properties file.

Language Selection by the Portal

The portal goes through the following sequence to determine the language in which to render content.

  1. If the user has logged in, then use the language specified by the user. (For anonymous users, the portal skips this step.)

  2. If the user did not specify a language preference, use the language specified in the browser.

  3. If the browser's language cannot be determined, use the default locale of the portal.

  4. If no supported language is found by the first three steps, then use the default language of the portlet.

The language then applies to the entire portal. If the portal or any component does not find the appropriate resource, a similar language is used. The language is determined by the file names for the resource bundles and the hierarchy of the directory structure for the JSPs. This search sequence applies to all portal components , down to the portlets. That is how a portal can display individual portlets in different languages.

Depending on how a portlet is written, a portlet can support multiple locales. A portlet needs to specify the default language in its deployment description; otherwise, the portlet couldn't be installed.

Changing the Character Set for a Language

The character set for a language is stored in a database. The default encoding is UTF-8. The values in use for the various languages are shown in Table E-4.

Table E-4. Language Encoding in Use

Language

Encoding in Use

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


Follow these steps to change a character set for a language:

  1. Log in to the portal as the Portal Administrator ( wpsadmin ). Under Portal Administration, navigate to the Portal Settings tab.

  2. Select Manage Markups.

  3. Highlight the markup you want to modify. Click Edit selected markup .

  4. The next screen lists the MIME type and current encoding. Click Set locale specific setting .

  5. On the next screen, you can change the character set for the selected language in the selected markup. Click OK .

Adding Support for a New Language

To support a new language, you need to add that language to the file language.properties. You do this by inserting resource bundles and adding JSPs for the new language where applicable . Some JSPs use resource bundles, while others, such as help JSPs, are translated directly.

Resource bundles are located in <WPS_HOME>/app/web/WEB-INF/classes/nls. They store text displayed in JSPs or in Java code. The naming convention for resource bundles is [bundle]_[language]_[country]_[variant].properties .

The ISO standard ISO-639 is used for the language codes of most languages, and ISO-3166 is used for the country codes. (Hebrew uses the old language code, iw.)

WebSphere Portal uses the properties file called by the Java class java.util.Resource-Bundle to store text rendered in JSPs. The resource bundles are searched in the following order:

  1. [bundle]_[language]_[country]_[variant].properties.

  2. [bundle]_[language]_[country].properties.

  3. [bundle]_[language].properties.

  4. [bundle].properties.

The default bundles, [bundle].properties, are in English. To add a resource bundle, follow these steps:

  1. Copy an existing resource bundle and translate it.

  2. Name the new bundle according to the naming convention for resource bundles.

  3. Convert it into unicode with the native-to-ASCII converter, native2ascii. It comes as part of the JDK and is found in <JAVA_HOME>/bin.

Here is a sample command to convert a Chinese text file, using UTF-16 encoding:

 

 Native2ascii encoding UTF-16 helloWorld_zh.txt helloWorld_zh.properties 

JSPs that contain mostly static text are translated directly, which means the text is contained in the JSP instead of in the resource bundle. You have to copy and translate the existing JSP and store it in the appropriate location. The location of JSPs can be, for example, jsp/[mime_type]/[language]/[country]/[variant]/sample.jsp. The exiting Help JSPs in WebSphere Portal are already translated and placed in the relevant [language] and [country] subdirectories. Rather than create and use multiple JSP files, it is recommended that you create a single JSP file that contains the tags to load multilingual strings from the resource bundles. It is easier to maintain one JSP file than to keep multiple files in sync.



IBM WebSphere and Lotus Implementing Collaborative Solutions
IBM(R) WebSphere(R) and Lotus: Implementing Collaborative Solutions
ISBN: 0131443305
EAN: 2147483647
Year: 2003
Pages: 169

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net