Translating JAMS

From ILMS-Wiki
(Difference between revisions)
Jump to: navigation, search
(Patching existing JAMS libraries)
(Uploading language files to the JAMS SVN repository)
Line 42: Line 42:
 
There is a huge number of different SVN clients available, have a look at http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients for a probably incomplete list of them.
 
There is a huge number of different SVN clients available, have a look at http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients for a probably incomplete list of them.
 
The following steps assume that you are using the SVN command line client that comes with the SVN installation package (binary packages available here: http://subversion.tigris.org/getting.html):
 
The following steps assume that you are using the SVN command line client that comes with the SVN installation package (binary packages available here: http://subversion.tigris.org/getting.html):
 +
* open a DOS command prompt
 +
* change into the directory where you want to download the language files to (e.g. cd c:\temp)
 +
* issue the following command:
 +
<code>svn co http://svn.geogr.uni-jena.de/svn/jams/trunk/JAMSmain/src/resource</code>

Revision as of 11:11, 25 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:

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.

Patching existing JAMS libraries

The following instructions assume a Windows system. They look similar for other systems. 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_<lcode>_<ccode>.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.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_<lcode>_<ccode>.properties
  • delete the extracted files by running
 rmdir /s/q resources

On the next start of JAMS, the interface should show up with the translated terms. If not, make sure that the "Force language" entry in the JAMS properties dialog is empty. If the interface still comes up with the default localization (english), you can also force JAMS to use a localization by entering its language code in the "Force language" entry of the JAMS properties dialog. JAMS must be restarted after changing the "Force language" entry in order to correctly apply the new localization.

Uploading language files to the JAMS SVN repository

In order to make changes to JAMS language files permanent, these need to be stored in the JAMS Subversion repository. For further information about the Subversion (SVN) version control system, please have a look at these sites:

There is a huge number of different SVN clients available, have a look at http://en.wikipedia.org/wiki/Comparison_of_Subversion_clients for a probably incomplete list of them. The following steps assume that you are using the SVN command line client that comes with the SVN installation package (binary packages available here: http://subversion.tigris.org/getting.html):

  • open a DOS command prompt
  • change into the directory where you want to download the language files to (e.g. cd c:\temp)
  • issue the following command:
svn co http://svn.geogr.uni-jena.de/svn/jams/trunk/JAMSmain/src/resource
Personal tools