Sun GlassFish Web Space Server 10.0 Administration Guide

ProcedureTo Add New Language Support

This task describes how to create a file, and make changes to it to support localization.

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

    mkdir /tmp/test

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

    The portal-impl.jar file contains resource bundles for Web Space Server. This JAR file is located in the GlassFish install-dir/domains/domain1/application/j2ee-modules/webspace/WEB-INF/lib/ directory.

    cd GlassFish-install-dir/domains/domain1/application/j2ee-modules

    cp webspace/WEB-INF/lib/portal-impl.jar /tmp/test

  3. Change to the tmp directory.

    cd /tmp/test

  4. Extract the portal-impl.jar file.

    jar -xvf portal-impl.jar

    The file will be placed in the current directory.

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

  6. If a file does not already exist, create a text file with that name.

    The default location of is GlassFish home/applications/j2ee-modules/webspace/WEB-INF/classes/

  7. Paste the locales property into the file.

  8. Add the new locale at the end of the locales property in the format 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 follows:

  9. Save the file.

  10. Navigate to the content folder and open the file.

    Note –

    A folder named content was created when you extracted the portal-impl.jar file.

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

  12. Rename the translated file to

  13. Run the following command on the directories that contains the file:

    native2ascii -encoding UTF-8

  14. Create a directory structure webspace/WEB-INF/classes/ under ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace/customs, and copy file to it.

  15. Create a directory structure webspace/WEB-INF/classes/content under ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace/customs, and copy file to it.

  16. Change to the ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace directory.

    cd ZIP_ROOT/webspace-for-gfv2/var/webspace/war-workspace

  17. Run ant -f synchronize.xml.

  18. Restart theGlassFish server.