Sun Java System Communications Express 6 2005Q1 Customization Guide |
Chapter 9
Localizing Communications Express
Communications Express LocalizationCommunications Express allows you to localize Calendar, Address Book and Options as per your requirements.
Localizing Calendar and Options
To localize text, you need to change the i18n.properties file that is located in <domain-dir>/domain/<locale> directory. If the deployment is configured to work with multiple domains and multiple locales, then a directory by that domain name is created under <domain-dir>/domain
For example, if there is a domain called example.com, perform the following steps.
Localizing Date/Time Formats for Calendar
The localization of the Date/Time formats for Calendar should be performed by constructing locale-specific patterns for certain symbols, delimitters and hard-coded strings that are enclosed in single quotes. These symbols are converted into locale specific strings by Communications Express
Table 9-1 contains the information on localizing Date/Time Formats for Calendar
.
Characters that are in the above table are treated as quoted text. These characters appear in the formatted text even if they are not enclosed within single quotes.
The number of symbol letters you specify also determines the format. For example, if the "zz" pattern results in "PDT," then the "zzzz" pattern generates "Pacific Daylight Time." Table 9-2 summarizes these rules.
Table 9-2 Localization Rules
Localizing for languages that use characters outside the ASCII range
You may want to use the ‘native2ascii’ utility provided by JDK to convert non-ascii characters into escaped unicode values. This utility is available at <jdk-install-dir>/bin
To use the ‘native2ascii’ utility, enter non-ascii characters for the corresponding values in the properties file and save it.
Use the command, native2ascii -encloding <native_encoding> <src_filename> <target_filename>
where,
native_encoding represents the encoding used to create the source file, src_filename represents the source file and target_filename represents the i18n.properties file.
Localizing Mail
Communications Express allows you to localize any feature of Mail. Different pages can be created for different languages. When you create language-specific static pages, you need to group them in subdirectories under the main document directory. The code automatically detects the client’s language preference and fetches the pages from the appropriate subdirectory.
When you change common sections for static pages, you must make the changes in multiple locale (languages) directories, if modifications are desired across languages (for example, if changes are required to modify JavaScript behavior). Conversely, you can also make language-specific modifications selectively throughout the application.
Specific Locales
Table 9-3 lists the specific locales and their abbreviations that are supported by Communications Express services. The default language is English.
Table 9-3 Communications Express Specific Locales
Locale
Abbreviation
English
en
Japanese
ja
Spanish
es
French
fr
German
de
Russian
ru
Arabic
ar
Code Example 9-1 shows the changes to be made to the ru/i18n.js file for modifying the charset in the i18n.resource file.
Communications Express allows you to customize text that is displayed on web pages. This text is both customizable and localizable. The system also allows you to configure text on a per domain basis
To Add an Additional Locale
To add an additional locale, perform the following steps.
- Edit the uwcdomainconfig.properties file. This file is available in the <uwc-deploy-dir>/WEB-INF/domain directory>
- Add a keyword for the new locale that needs to be added. For example, if you need to add a new locale, “Afrikaans”
- Add a localized string for the locale name in different locales. This could be done by adding a new line in i18n.properties file of each locale. For example, let us add a key in i18n.properties file for en locale.
To Include Additional Dictionary for Spell Check
- Get the dictionary file and the affix file for the language you want to add to your dictionary.
The dictionary file contains language-specific vocabulary and the affix file contains grammar rules for the specific language. For information on dictionary and affix files refer to the site: http://fmg-www.cs.ucla.edu/fmg-members/geoff/ispell-dictionaries.html
- Use the buildhash utility to create a platform-specific and language-specific hash file from the dictionary and affix files. This hash file is used by the Communications Express spell checker.
To run the buildhash utility, download the ispell source files available at the site: http//www.gnu.org/software/ispell/ispell.html or, use the buildhash utility in the msg_svr_base/dict/bin directory. The syntax for the buildhash utility is:
buildhash dictionary_file affix_file language_name.hash
The language_name in the language_name.hash file is the two-letter language code used by Communications Express (such as: en for English, fr for French).
To determine your language’s two-letter code, enter the command:
msg_svr_base/msg-instance/configutil | grep local.supportedlanguages
- Copy the newly created language_name.hash file in the msg_svr_base/dict directory and restart the mshttpd service. When the mshttpd service is restarted, the Communications Express spell checker is enabled.
The following example shows how to create a German hash file (ge.hash) by using the buildhash utility.
- Creating a German hash file by using the buildhash utility.
# cd /usr/Sun/server5/dict/bin
# ./buildhash german.dico german.aff ge.hash
# cp ge.hash ..
# /usr/Sun/server5/msg-budgie/start-msg http
,where the file i18n.js controls the text. The i18n.js file also can be localized to fit the language of many regions in the world
Localizing Address Book
To localize address book, the xml file that needs to be modified is the dictionary- <lang>.xml file that is located under <uwcinstalldir> /WEB-INF/ui/html/abs directory.
Customizing Address Book for a Specific Locale
You can customize the Address Book UI either for a specific locale and not under a specific domain and also for a locale under a specific domain.
Customizing the Address Book UI for a locale and not under a specific domain
Customizing the Address Book for a locale under a specific domain