Project WebSynergy Milestone 4 Administration Guide

ProcedureTo add new Language Support

The WebSynergy evaluation bundle has a portal-ext.properties file in the GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes. When you are using a WebSynergy bundle which is not including samples, you have to create a portal-ext.properties file. This task describes the process to create a portal-ext.properties file, and making changes to it to support localization.

  1. Create a temporary folder. In this example, name the folder as test.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    mkdir /tmp/test

  2. Copy portal-impl.jar to the temp folder.

    portal-impl.jar contains language resource bundles for WebSynergy. This jar file is located under the GlassFish install-dir/domains/domain1/application/j2ee-modules/websynergy/WEB-INF/lib/ directory.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    cp GlassFish install-dir/domains/domain1/application/j2ee-modules/websynergy/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change directory to temp.

    Equivalent step in the command prompt or in the terminal window of SOLARIS or any UNIX like OS:

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    Equivalent step in the command prompt or in the terminal window of a UNIX like OS:

    jar -xvf portal-impl.jar

    After unjar it will have portal.properties file in the same directory.

  5. Open portal.properties and copy the locales property from the Languages and Time Zones section.

  6. if portal-ext.properties does exits in WebSynergy then paste the locales property into it. Otherwise, create a text file (using any text editor) and name it as portal-ext.properties, and paste the locales property into it.

    Default location of portal-ext.properties is GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes/portal-ext.properties.

  7. Modify the locales to add the new locale at the end. Add new locale in the format of “LanguageCode_CountryCode”.

    See the following links to find language and country codes:

    For example, if you are adding support for Hindi, you need to add hi_IN at the end of locales property as shown below:

    locales=ar_SA,ca_AD,ca_ES,zh_CN,zh_TW,cs_CZ,nl_NL,en_US,fi_FI,fr_FR,de_DE,el_GR,hu_HU,
    it_IT,ja_JP,ko_KR,nb_NO,fa_IR,pt_BR,ru_RU,es_ES,sv_SE,tr_TR,vi_VN,hi_IN
  8. Save the portal-ext.properties file.

  9. Navigate to the content folder and open the Language.properties file.


    Note –

    A folder named content is created on extracting the portal-impl.jar file using the unjar command.


  10. Translate all the strings you want to localize from temp/test/content/Language.properties to the new language.

  11. Rename the translated Langauge.properties file to Language-ext_<LanguageCode>.properties.native.

  12. Run the following commands on the directory which contains the Language-ext_<LanguageCode>.properties.native file:

    native2ascii -encoding UTF-8 Language-ext_<LanguageCode>.properties.native Language-ext_<LanguageCode>.properties

  13. Copy the portal-ext.properties file (under temp/test), and paste it to GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes.

  14. Copy the Language-ext_<LanguageCode>.properties.native file (under temp/test/content) and the Language-ext_<LanguageCode>.properties files (under temp/test/content), and paste them to GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes/content.

  15. Restart GlassFish server.