Support a new language

 


Overview

To support a new language, add resource bundles, or JSPs, for the new language, and then change the language selection lists by adding the new language to the file...

wp_root/shared/app/config/language.properties

 

Add resource bundles for a new language

Resource bundles are used to store text displayed in JSPs or text used in Java code. In WebSphere Portal, resource bundles are located in...

wp_root/shared/app/wp.ui.jar/nls/wp.ui.jar

To add new resource bundles for additional languages, place them into the directory...

/wp_root/shared/app/nls

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. For Hebrew the old language code iw is used. The ISO standard ISO-3166 is used for the country/region codes. WebSphere Portal supports the use of [variant], although resource bundles supplied with the portal do not use it.

If your portal configuration includes Lotus Collaborative Services, add a new CSRes_language.properties file for each additional language to...

wp_root/shared/app/nls

WebSphere Portal uses properties files called by the Java class java.util.ResourceBundle to store text rendered in JSPs. The Java mechanism searches for the resource bundles in the following order:

  1. [bundle]_[language]_[country]_[variant].properties
  2. [bundle]_[language]_[country].properties
  3. [bundle]_[language].properties
  4. [bundle].properties

In WebSphere Portal, the default bundles [bundle].properties are in English.

To add a resource bundle, proceed with the following steps:

  1. Copy an existing resource bundle and translate it
  2. Name it according to the naming convention for resource bundles
  3. Convert it into Unicode with the Native-to-ASCII converter native2ascii.

 

Add JSPs for a new language

Some JSPs that contain mostly text, such as help JSPs, are translated directly which means that the text is contained in the JSP and not in a resource bundle. For JSPs that do not use resource bundles, copy and translate an existing JSP and store it in the appropriate location.

The location of JSPs can be, for example,...

jsp/[mime-type]/[language]/[country]/[variant]/files.jsp.

For instance, existing help JSPs are already translated in WebSphere Portal and placed in the relevant [language] and [country] subdirectories. When deciding where to store new JSPs, consider how the portal locates a JSP for rendering its content.

The following is an example of the order in which directories are searched, where path1 is a user-defined path, ie5 is the markup version (here: Internet Explorer 5), and the locale is en_US:

  1. /html/path1/ie5/en_US/mytemplate.jsp
  2. /html/path1/ie5/en/mytemplate.jsp
  3. /html/path1/ie5/mytemplate.jsp
  4. /html/path1/en_US/mytemplate.jsp
  5. /html/path1/en/mytemplate.jsp
  6. /html/path1/mytemplate.jsp
  7. /html/en_US/mytemplate.jsp
  8. /html/en/mytemplate.jsp
  9. /html/mytemplate.jsp
  10. /mytemplate.jsp

This means that if the user language is not supported, the portal will choose the file in the locale independent location, which in the example is the English file.

 

Add the new language to the selection list

Adapt the selection list of available languages. To do this, add the new language to the file...

wp_root/shared/app/config/language.properties

Use the language code provided by the ISO 639 standard.

Restart the portal. The new language is now listed in the language selection boxes that are available in administration portlets, or for example, in Edit my profile, Preferred language.

 

Remove support for a language from the WebSphere Portal

To remove support for a language from WebSphere Portal, remove, or comment out, the language from the file...

/wp_root/shared/app/config/language.properties

...and then cycle the portal. The language is no longer listed in the language selection boxes.

 

See also

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.