Saturday, 8 November 2014

Exploring Language support in websphere portal8

Language support :-  Websphere portal supports multiple languages because portal can be used any country. It can even have some portlets in Japanese and some portlets in English.

WebSphere Portal has already been translated into a number of languages. They are shown in the following list, together with the ISO 639 language codes. These codes are used for the languages in WebSphere Portal:

WebSphere Portal language codes(32 languages): -

  • ar     =   Arabic, ca     =   Catalan, cs     =   Czech, da     =   Danish, nl     =   Dutch
  • en     =   English, fi     =   Finnish, fr     =   French, de     =   German , el     =   Greek
  • iw     =   Hebrew, hr     =   Croatian, hu     =   Hungarian, it     =   Italian,
  • ja     =   Japanese, kk     =   Kazakh,  ko     =   Korean,  no     =   Norwegian
  • pl     =   Polish , pt     =   Portuguese, pt_BR =   Brazilian Portuguese, ro     =   Romanian
  • ru     =   Russian, sk     =   Slovak, sl     =   Slovenian. es     =   Spanish
  • zh     =   Simplified Chinese, zh_TW =   Traditional Chinese, sv     =   Swedish
  • th     =   Thai, tr     =   Turkish, uk     =   Ukrainian
Usecase (Now we got a client from Maldives(dv-MV) we need to make a portal for them how will you add a new language bundle to portal) :-  

Step 1 :- In WebSphere® Portal, resource bundles are located in the JAR files wp.ui.jar and wp.theme.customizer.ext.jar in the nls directory inside the file. 

The JAR file wp.ui.jar is located under the following directory:
Windows: PortalServer_root\ui\wp.ui\shared\app

The JAR file wp.theme.customizer.ext.jar is located under the following directory:
Windows: PortalServer_root\theme\wp.theme.customizer.ext\shared\app

Step 2 :-
If you want to add new resource bundles for additional languages, place them into the following directory:
Windows: wp_profile_root\PortalServer\config\nls
The naming convention for resource bundles is [bundle]_ [language]_ [country]_ [variant].properties . WebSphere Portal supports the use of [variant], although resource bundles supplied with the portal do not use it.

Note: If your portal configuration includes Lotus Collaborative Services, add a new CSRes_language.properties file for each additional language to the following directory:
Windows: wp_profile_root\PortalServer\config\nls

Step 3 :-
Copy all existing resource bundles into wp_profile_root/PortalServer/config/nls directory.
Name the resource bundles according to the naming convention for resource bundles using locale code for the language(s) installed. Translate the resource bundle files. Convert them into Unicode with the Native-to-ASCII converter native2ascii which comes as part of JDK. For more detail about native2ascii see the Java documentation native2ascii - Native-to-ASCII Converter.

Restart your WebSphere Portal so that ir recognizes the new resource bundles.Resource bundles to support a Portal8.0 based custom theme

Step 4 :-
You can add a new supported locale to the system. To do so you must provide resource bundles for the new language to the Portal8.0 based custom theme.

Run the following XML to create the "Vietnamese" language by going to Administration -> Portal Settings -> Import XML.
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
type="update" 
xsi:noNamespaceSchemaLocation="PortalConfig_7.0.0.xsd">
<portal action="locate">
<language action="update" bidi="false" domain="rel" locale="vi">
<localedata locale="en">
<title>Vietnamese</title>
</localedata>
</language>
</portal>
</request>

Step 5 :- 
Copy the contents of the following files from your Portal server into a new file called language_vi.js:
PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/pagebuilder/js/nls/pb_ui_layer_en.js
PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/portalclient/js/nls/rest_utils_en.js
If you use Active Site Analytics PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/asa/js/nls/asa_layer_en.js
If you use Tagging and Rating PortalServer_root/theme/wp.theme.modules/webapp/installedApps/ThemeModules.ear/ThemeModules.war/modules/portalclient/js/nls/tagging_rating_en.js

In the language_vi.js file, replace all instances of:
en")  with:  vi")

and all instances of:
.en=  with:  .vi=

Step 6 :-
Place the language_vi.js file into the js folder of your custom theme. 
For example, dav:fs-type1/themes/custom_theme/js.
Create a theme module for the language_vi.js file by creating a languages.json file with the following contents:
{
"modules": [{
"id":"custom_languages",
"prereqs": [{
"id":"dojo"
}],
"contributions": [{
"type":"head",
"sub-contributions": [{
"type":"js",
"uris": [{
"value":"/js/language_vi.js",
"lang":"vi"
}]
}]
}]
}]
}

Step 7:- 
Place languages.json into the contributions folder of your custom theme. 
For example, dav:fs-type1/themes/custom_theme/contributions.
Add "custom_languages" as the first module in the section that includes Dojo for each profile in your custom theme. 

For example, in the Portal8.0 theme, the "custom_languages" module would be added to the "moduleIDs" section of the Full profile and the "deferredModuleIDs" section of the Deferred profile.



No comments:

Post a Comment

Custom single threaded java server

 package com.diffengine.csv; import java.io.*; import java.net.*; import java.util.Date; public class Server { public static void main(Str...