To add a new user interface language to SuperWEB2, you need to create a resource bundle. This is a set of properties files saved in <tomcat_home>\webapps\webapi\WEB-INF\classes.
For example, the file messages.properties contains values for various strings displayed in SuperWEB2. By default there are several versions of this file with the language code in the filename. These are used for the different languages that are supported out of the box:
Step 1 - Create Your Translations
You can use the base versions of the properties files as a template for creating a version for your new language. For example:
- Open messages.properties in a text editor.
Save it as messages_<locale>.properties
Each line in the file contains a property and a value. For example, the following lines define some of the text displayed on the login screen:
Change the values for each entry in the file to the appropriate translated text (but do not change the names of the properties themselves).
Repeat these steps until you have translated all of the properties files. The following is a list of the main properties files that you need to localise:
|CDataOnlineEditRules.properties||Error messages that are displayed when the user attempts to create a table that breaches the configured table rules.|
|common_labels.properties||Common labels used through the application.|
|messages.properties||General on screen labels used throughout the application.|
|basemaps.properties||The text for the Aerial Map and Street Map drop-down labels shown in Map View.|
|configuration.properties||Settings such as the location of the PDF download template and online help can be localised.|
In addition to the above properties files, which are also located in <tomcat_home>\webapps\webapi\WEB-INF\classes, there are also some text strings used in Map View that you may wish to translate. These are configured in <tomcat_home>\webapps\webapi\mapping\arcgis-jsmap\str\amp\nls\Sw2EntryPoint_<locale>.js.
Step 2 - Update the Languages in faces-config.xml
When you have finished adding translated versions of all the required properties files, you need to add your new language to the list of supported locales in the faces-config.xml configuration file. See Change the Supported User Interface Languages for more details.
You will need to restart Tomcat or the SuperWEB2 service after making the change to faces-config.xml.
Step 3 - Encode any non-ASCII Characters
If your translated text contains any non-ASCII characters (such as characters with accents and characters from non Roman alphabets), then you must convert these into 8-bit printable form in order to display them in SuperWEB2.
There is a tool supplied with the Java Development Kit called native2ascii that you can use to perform this conversion. See http://mindprod.com/jgloss/native2asciiexe.html for more details. This tool converts each non-ASCII character to a code beginning \u
For example, the session timeout message that displays on the login screen might be translated to French as follows:
If this is not encoded in 8-bit printable form, the accented characters will not display properly in SuperWEB2:
Once the file has been converted to ASCII using native2ascii, the translation is represented as follows:
This can now be rendered correctly in SuperWEB2: