This document describes the process of changing state specific localization settings in a step-by-step fashion.
Before working on configuration of the Gateway it is recommended to have a local copy of all modules. This is because various modules read in the configurations during their build process. Therefore it is a good idea to utilize the gwbuild.bash script to refresh all modules once configuration has taken place. This will insure that the changes made will be reflected when the application is deployed.
The easiest way to get started with a new state configuration is to copy the contents of config/state/xx/ into a new directory config/state/(2-letter-state-code) .
This file contains constants needed across by many modules of the Gateway. There is a unique copy for each state, stored in config/state/(2-letter-state-code) . A default copy for the demo state "xx" is located here .
Not all values are important or crucial to configuration on the state level. Some of the more useful ones are listed below, with comments removed to save space:
public static final String FIPS_CODE = "99"; public static final String MAIL_HOST = "localhost"; public static final String MAIL_FROM = "Unknown User <noreply@localhost>"; public static final String MAIL_TO = "Admin User <root@localhost>"; public static final String MAIL_SUBJECT = "Transmission Arrived"; public static final String MAIL_BODY = "A transmission has arrived at the gateway."; public static final boolean TRANSMISSION_NOTIFICATION = false;
The localization standard implemented by the Gateway, called TMX, is XML based. It provides a simple way of associating a key, often referring to an operation or some text to display, with many values, each value being a translation of that key into a target language.
The Gateway stores a main localization file, Localization.tmx20.xml , in sstp-server-portal\src\main\webapp\WEB-INF\classes . This file is merged with another TMX file containing a subset of the keys, with translations relevant to the target state. This allows default values to be assigned for every string of text contained in the SSTP portal. States are given the option to replace them as they see fit.
The state localization file, StateLocalization.tmx20.xml , is contained in the state configuration directory under config/state/(2-letter-state-code)/portal/locales/ . the default state "xx" version is stored here .
There are a few different ways of going about creating a state localization file. The simplest would be copying key/value sets from the many listed in Localization.tmx20.xml and changing the values to the desired translations. One would only need to copy the parts that would need non-default values assigned to them such as:
<tmx:tu tuid="accessibilityPolicyURL">
<tmx:tuv xml:lang="fr">
<tmx:seg>http://www.xyzzy.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="es">
<tmx:seg>http://www.xyzzy.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="ru">
<tmx:seg>http://www.xyzzy.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="en">
<tmx:seg>http://www.xyzzy.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
</tmx:tu>
and changing it to:
<tmx:tu tuid="accessibilityPolicyURL">
<tmx:tuv xml:lang="fr">
<tmx:seg>http://www.VERMONT.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="es">
<tmx:seg>http://www.VERMONT.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="ru">
<tmx:seg>http://www.VERMONT.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
<tmx:tuv xml:lang="en">
<tmx:seg>http://www.VERMONT.gov/portal-policies/policies.html</tmx:seg>
</tmx:tuv>
</tmx:tu>
and saving it in StateLocalization.tmx20.xml .
The TMX Localization Editor is another open source offering that can very easily create the StateLocalization.tmx20.xml file from the main localization file. See the section in it's documentation about "Generating a patch file".
This process is further documented, including the addition and removal of languages in Localization .
Configuration directories are currently loaded using Maven profiles, information on this is contained here.