Chapter 3. Language-specific files
All the language-specific files of openCRX are contained in the file opencrx-core-CRX.war, which is included in the file opencrx-core-CRX-web.ear included in the openCRX distribution (please note that this file may already be exploded/unzipped in which case you will have a directory called opencrx-core-CRX.war instead of a file). Language-specific files can be grouped as follows:
user interface configuration (XML files containing language-specific labels and tool tips) - note that the directory .opencrx-core-CRX.war/config/ui contains subdirectories of the form xx_YY for each implemented locale; these subdirectories contain the language-specific XML files - the files for US English, for example, are located in the directory .opencrx-core-CRX.war/config/ui/en_US
code tables (XML files containing the mapping of codes to the respective language-specific texts) - note that the directory .opencrx-core-CRX.war/config/code contains subdirectories of the form xx_YY for each implemented locale; these subdirectories contain the language-specific XML files - the files for US English, for example, are located in the directory .opencrx-core-CRX.war/config/code/en_US
strings used by JSP - note that the directory .opencrx-core-CRX.war/config/texts contains subdirectories of the form xx_YY for each implemented locale; these subdirectories contain language-specific text files named opencrx.text.properties and text.properties - the file for US English, for example, is located in the directory .opencrx-core-CRX.war/config/texts/en_US
html pages (e.g. help pages like helpSearch_xx_YY.html where xx_YY reflects the locale, e.g. en_US)
login page Login.jsp - the login page is a special case and if you want to offer your users a login page in a language that is not configured by default you will have to modify the file .opencrx-core-CRX.war/Login.jsp.
language configuration - the XML file web.xml contains the language configuration of openCRX
Note: openCRX locale IDs are based on a widely accepted standard where the locale ID xx_YY is composed of an alpha-2 language code xx (see http://en.wikipedia.org/wiki/ISO_639) and an alpha-2 country code YY (see http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
The following directory listing gives an overview of the structure discussed above.
Example 3-1. language-specific files in opencrx-core-CRX.war
opencrx-core-CRX.war
| ...
| helpJsCookie_de_CH.html
| helpJsCookie_en_US.html
| helpSearch_de_CH.html
| helpSearch_en_US.html
| ...
\--WEB-INF
| ...
| web.xml
| ...
+--config
| +--code
| | +--de_CH
| | | accountcategory.xml
| | | ...
| | | utcoffset.xml
| | |
| | \--en_US
| | accountcategory.xml
| | | ...
| | utcoffset.xml
| |
| +--texts
| | +--de_CH
| | | opencrx.texts.properties
| | | texts.properties
| | |
| | \--en_US
| | | opencrx.texts.properties
| | texts.properties
| |
| \--ui
| +--de_CH
| | abstractcontract.xml
| | | ...
| | wf.xml
| |
| \--en_US
| abstractcontract.xml
| | | ...
| wf.xml
...
In the Open Source distribution of openCRX the user interface configuration files for en_US contain the complete customization information in addition to the language-specific text strings.
Modifying language-specific files requires an editor capable of handling files in UTF-8 format. The UTF-8 encoding of an XML file is indicated at the beginning of the file with <?xml version="1.0" encoding="UTF-8"?>. More information about encoding of XML files is available at http://www.w3schools.com/xml/xml_encoding.asp. If you modify language-specific files with an editor that cannot handle UTF-8 encoded files properly you risk running into problems when starting openCRX with such modified files because the XML importer will not be able to correctly import them.