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.
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
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
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
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.
Open portal.properties and copy the locales property from the Languages and Time Zones section.
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.
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:
See, http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt for language codes.
See, http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html for 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
Save the portal-ext.properties file.
Navigate to the content folder and open the Language.properties file.
A folder named content is created on extracting the portal-impl.jar file using the unjar command.
Translate all the strings you want to localize from temp/test/content/Language.properties to the new language.
Rename the translated Langauge.properties file to Language-ext_<LanguageCode>.properties.native.
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
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.
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.
Restart GlassFish server.