Translating JAMS
Line 20: | Line 20: | ||
* translate the file resources\JAMSBundle.properties, save it and rename it to resources\JAMSBundle_<lcode>_<ccode>.properties according to the conventions described above | * translate the file resources\JAMSBundle.properties, save it and rename it to resources\JAMSBundle_<lcode>_<ccode>.properties according to the conventions described above | ||
* write the modified file back to the archive by running | * write the modified file back to the archive by running | ||
− | <code>jar -uf jams-main.jar resources/ | + | <code>jar -uf jams-main.jar resources/JAMSBundle.properties</code> |
* delete the extracted files by running | * delete the extracted files by running | ||
<code>rmdir /s/q resources</code> | <code>rmdir /s/q resources</code> | ||
Line 27: | Line 27: | ||
* translate the file resources\JUICEBundle.properties, save it and rename it to resources\JUICEBundle_<lcode>_<ccode>.properties according to the conventions described above | * translate the file resources\JUICEBundle.properties, save it and rename it to resources\JUICEBundle_<lcode>_<ccode>.properties according to the conventions described above | ||
* write the modified file back to the archive by running | * write the modified file back to the archive by running | ||
− | <code>jar -uf jams-ui.jar resources/ | + | <code>jar -uf jams-ui.jar resources/JUICEBundle.properties</code> |
* delete the extracted files by running | * delete the extracted files by running | ||
<code>rmdir /s/q resources</code> | <code>rmdir /s/q resources</code> |
Revision as of 20:06, 22 October 2009
JAVA localization basics
You can translate the JAMS graphical user interfaces by editing JAMS language files. Those files contain lines of the format
<key>=<value>
where key is some string identifier and value a term in a certain language. An example would be:
ExplorerDisabled=JAMS Explorer is diabled in this version!
The interfaces are translated by replacing the right part with the translated terms. In order to preserve a proper generation of combined terms, leading and trailing whitespace characters must be kept. The results must be stored in a file following the naming convention
<name>_<lcode>_<ccode>.properties
with the following meaning:
-
<name>
is a string describing the files content, i.e. "JAMSBundle" or "JUICEBundle" -
<lcode>
is a 2-character abbreviation for the language name according to ISO 639-1, see http://www.loc.gov/standards/iso639-2/php/code_list.php for a complete list. -
<ccode>
is a 2-character abbreviation for the country name according to ISO 3166-1, see http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm for a complete list.
As an example, the proper name for a file containing brazilian portuguese language strings for JAMS would be JAMSBundle_pt_BR.properties
. In general, the country code can be omitted, e.g. JAMSBundle_pt.properties
is a proper file name for portuguese translations in general.
In order to patch the language files of already existing JAMS libraries, proceed as follows.
- make sure you have the JDK java development package installed
- open a DOS command prompt
- change into the directory containing the JAMS *.jar files (
cd c:\program files\jams\lib
) - extract the JAMS language file by running
jar -xf jams-main.jar resources/JAMSBundle.properties
- translate the file resources\JAMSBundle.properties, save it and rename it to resources\JAMSBundle_<lcode>_<ccode>.properties according to the conventions described above
- write the modified file back to the archive by running
jar -uf jams-main.jar resources/JAMSBundle.properties
- delete the extracted files by running
rmdir /s/q resources
- extract the JUICE language file by running the command
jar -xf jams-ui.jar resources/JUICEBundle_pt.properties
- translate the file resources\JUICEBundle.properties, save it and rename it to resources\JUICEBundle_<lcode>_<ccode>.properties according to the conventions described above
- write the modified file back to the archive by running
jar -uf jams-ui.jar resources/JUICEBundle.properties
- delete the extracted files by running
rmdir /s/q resources