
10) Internationalization/Localization
The OpenGTS source code is i18n ("internationalization") compliant, which means that it can adapted to various
lanugages without requiring any code changes (ie. no fixed hardcoded text that cannot be changed at display time).
Localization ("L10n") is the process of applying language specific text for a given Locale.
10.1) Supporting a New Language
All English text which is displayable within the OpenGTS web-interface can be found in the resource property files called
"LocalStrings_en.properties" found within the various source file directories. These files contain a listing of the
default English text which will be displayed if no specific locale has been chosen. The format of this file is
"textKey=value", where the "textKey" is a unique id for the specific text "value".
10.1.a) Download the latest Locale files for the next release:
You can download a zip file containing the "LocalStrings_xx.properties" files for the next release of
OpenGTS at the following URL:
http://www.geotelematic.com/download.html#LocalStrings
To support a new language/locale, search for every occurance of the file "LocalStrings_en.properties" and
create a copy named "LocalStrings_XX.properties" in the same directory, where "XX" in this case is the ISO-639
2-letter language code. Then in the new file, remove the prefixing "#" comment character on each key=value line, and
modify the text value to match your specific language syntax and meaning. Make sure to leave the text key as-is. The
contents of the "LocalStrings_XX.properties" files must be written using only ISO-8859-1 encoded characters
(per "java.util.Properties" and "java.util.ResourceBundle" restrictions). Characters that cannot be
directly represented in ISO-8859-1 can be included using Unicode escapes by specifying the format '\uXXXX', where
'XXXX' is the hex representation of the unicode character. The Java JDK installation includes the tool 'native2ascii'
to assist with converting unicode text to unicode escaped text.
If a "LocalStrings_XX.properties" file does not contain proper Unicode encoding (ie. an invalid "\uXXXX"
specification), then Java may be unable to load the properties file, and the specific LocalStrings file may not be used.
To verify that no invalid "\uXXXX" specifications are present, the following CheckInstall command will validate the
"LocalStrings_XX.properties" files:
/zzz> $GTS_HOME/bin/checkInstall.sh -- -localStrings=$GTS_HOME/src
This command will search for all "LocalStrings_XX.properties" files in the "$GTS_HOME/src" directory and
examine their contents for invalid "\uXXXX" specifications. If any LocalStrings file contains invalid "\uXXXX"
specifications, the error message "Malformed \uxxxx encoding" will be displayed for the particular file. This command
will also check to see that only ISO-8859-1 characters are used in the LocalStrings files.
The specific language locale displayed on the web-interface is controlled by the "locale" attribute on the "Domain" tag
in the "private.xml" file.
After making any changes to the "private.xml" file, or any of the "LocalStrings_XX.properties" files, make
sure you rebuild and redeploy the "track.war" file.
10.2) Changing the Displayed Language
Setting the displayed language can be configured in the 'private.xml' file. On the "Domain" tag, change the "locale"
to the desired 2-letter country code. For example, to change the language to German, set the Domain "locale"
attribute to 'locale="de"'. You can also add a pull-down language selection menu to the login page by setting the
Property "accountLogin.showLocaleSelection" to "true". The language selections are specified in the
"SupportedLocales" tag.
(Rebuild/redeploy the 'track.war' file after making any changes to the 'private.xml' file.)
OpenGTS Configuration and Installation Manual Page 40 of 60
Comentários a estes Manuais