This section describes the process of internationalizing the Management Console:
Refer to Localization for details on changing the default locale of Rhapsody.
Creating and Adding a New Locale to the Management Console
To add an option to change the locale for the Management Console on its login screen:
Choose a locale (language code) you want to create and add.
Each locale pack specifies the locale for which the pack is intended for; this is done through the file name. The file name must be of the format
<locale>.locale.csv
, where<locale>
is either<language>_<country>
or simply<language>
:<language>
is a valid ISO language code. These codes are lowercase, two-letter codes as defined by ISO-639.<country>
is a valid ISO country code. These codes are the uppercase, two-letter codes as defined by ISO-3166.
If the file name specifies an unsupported locale, then it is ignored.
Create an unpopulated Unicode-encoded CSV file called
<locale>.locale.csv
, for exampleja.locale.csv
for Japanese localization.The required locale pack file format is a Unicode-encoded CSV file with two columns: the first column is the translation string key, and the second column represents the localized value of that string key. Acceptable Unicode encodings are:
- UTF-8 with or without a byte order mark.
- UTF-16 BE or LE with a byte order mark.
- UTF-32 BE or LE with a byte order mark.
Rhapsody performs minimal validation of these locale packs, and just checks that the first row has the expected two columns, and the first key corresponds to the expected pattern for a translation key (matches the regular expression "
^[A-Za-z0-9.$]+$
"). No validation is performed on the translation values.Place the file in the
$(installDir)/rhapsody/locale/
directory (all locale packs should be placed within this directory). The Rhapsody engine periodically checks this directory for changes.Rhapsody observes the following conditions:
- If a locale pack (which has been loaded) is removed, then it will remain in Rhapsody's memory until Rhapsody is restarted.
- If a locale pack is added and/or updated, then it is imported into the engine:
- If an error occurs during an import, the locale pack will be ignored.
- If the locale represents an updated locale pack, then the previously loaded locale pack will remain in memory unmodified.
- If a locale pack is updated with a file that fails to pass the validation rules, then the existing locale pack remains in memory. The party deploying the locale pack is responsible for resolving the problem either by fixing the invalid locale pack or replacing it with a backup.
Whenever a locale pack replaces an existing file, any existing translations for that locale are written out to a backup file called
<locale>.locale.csv.old.<N>
, where<N>
is a number from 1 to 9 (1 is the most recent backup). These files are written out as UTF-8 encoded CSV file with two columns: the translation key, and the associated value.- Wait a few seconds for Rhapsody to generate a UTF-8 encoded
<locale>.locale-missing.csv
file which contains the missing keys and their default English strings. Open
<locale>.locale-missing.csv
file in a text editor and replace the relevant text in the chosen language.The translation key and value must both be encapsulated in double quotes.
Excel does not save CSV files as UTF-16 encoded. This can lead to some characters not being displayed properly. The problem can be solved by using other text editors, for example Notepad.
- Save the file with the desired Unicode encoding and rename it to
<locale>.locale.csv
, for example ja.locale.csv. - Replace the file contained within the
$(installDir)/rhapsody/locale/
directory. Rhapsody will pick up the new locale shortly thereafter.
Special Translation Strings
While most translation strings are either string literals, or message format strings (following the patterns in java.text.MessageFormat
), there are a few special strings used for date-time formats in Rhapsody. These patterns are all defined using the available modes in SimpleDateFormat. The date strings can be added to locale file to change the way dates are shown for the locale.
The data strings for widgets are only used for the date-time picker widget, for example:
- Searches (From and To dates).
- Settings>Public Holidays.
- Notifications>My Leave.
The date strings for widgets are as follows:
Format |
Key |
Default |
---|---|---|
Long Date Format |
widget.datetime.long.date.format |
dd MMMM yyyy |
Medium Date Format |
widget.datetime.medium.date.format |
dd-MMM-yyyy |
Short Date Format |
widget.datetime.short.date.format |
dd-MMM-yy |
Long Date/Time Format |
widget.datetime.long.datetime.format |
dd MMMM yyyy HH:mm:ss |
Medium Date/Time Format |
widget.datetime.medium.datetime.format |
dd-MMM-yyyy HH:mm |
Short Date/Time Format |
widget.datetime.short.datetime.format |
dd-MMM-yy HH:mm |
Long Time Format |
widget.datetime.long.time.format |
HH:mm:ss |
Medium Time Format |
widget.datetime.medium.time.format |
HH:mm |
Short Time Format |
widget.datetime.short.time.format |
HH:mm |
The data strings for entries in tables are used everywhere else, for example:
- Logs (System Log).
- Activity streams on communication point details pages.
- Date/times on the x-axis of graphs.
The date strings for entries in tables are as follows:
Format |
Key |
Default |
---|---|---|
Long Date Format |
format.datetime.long.dateonly |
dd MMMM yyyy |
Medium Date Format |
format.datetime.medium.dateonly |
dd-MMM-yyyy |
Short Date Format |
format.datetime.short.dateonly |
dd-MMM-yy |
Long Date/Time Format |
format.datetime.long |
dd MMMM yyyy HH:mm:ss |
Medium Date/Time Format |
format.datetime.medium |
dd-MMM-yyyy HH:mm |
Short Date/Time Format |
format.datetime.short |
dd-MMM-yy HH:mm |
Long Time Format |
format.datetime.long.timeonly |
HH:mm:ss |
Medium Time Format |
format.datetime.medium.timeonly |
HH:mm |
Short Time Format |
format.datetime.short.timeonly |
HH:mm |
These date/time formats are not used throughout Rhapsody because some data types require specific formats.