Difference between revisions of "How to translate OpenJUMP into another language"

From OpenJUMP Wiki
Jump to navigation Jump to search
Line 68: Line 68:
 
** http://attesoro.org/translate.html  
 
** http://attesoro.org/translate.html  
 
** mirror of the version at the time of writing (http://sourceforge.net/projects/jump-pilot/files/tools/attesoro_1_8.jar)
 
** mirror of the version at the time of writing (http://sourceforge.net/projects/jump-pilot/files/tools/attesoro_1_8.jar)
 +
 +
=== 7zip ===
 +
 +
* can be used to unpack jar files (which use the zip compression)
 +
* a graphical (un)packer utility
 +
* available for windows or unofficially for several other operating systems (see downloads page) at
 +
** http://www.7-zip.org/
 +
 +
=== jEdit ===
 +
 +
* a java based text editor
 +
* support all major text encodings
 +
* mighty search and replace engine
 +
* get it at
 +
** http://www.jedit.org/
  
 
== '''Translation of non latin languages like Chinese, Vietnamese, Japanese etc.''' ==
 
== '''Translation of non latin languages like Chinese, Vietnamese, Japanese etc.''' ==

Revision as of 17:21, 13 November 2011

The steps on how to translate OpenJUMP

This in an example for translation into Brazilian Portuguese.

NOTE The steps below show the translation on the operating system windows. The steps however are pretty much generally the same for every operating system.

Translation process

  1. download
    • the most recent development snapshot, an archive named similar to OpenJUMP-20111111-r2527-CORE.zip (the CORE edition should suffice)
    • from one of the snapshot repositories
  1. extract
    • it contains a folder named like 'OpenJUMP-DATE-rREV-CORE' (called OJfolder in the further steps)
    • unpack it to a path of your choice, e.g. to 'C:\' should result in a folder structure like
    C:\OJfolder\bin\
    C:\OJfolder\lib\
    C:\OJfolder\licenses\
    C:\OJfolder\readme.txt
  1. set the language
    • if your operating system is configured to use the language you want to translate you can skip this step
    • edit the start script for your platform
    • locate the following lines in the file OJfolder\bin\oj_windows.bat, a similar line exists in oj_linux.sh for MacOS and Unix os's
     rem --- uncomment and change your language/country here to overwrite OS locale setting ---
     rem set JAVA_OPTS=%JAVA_OPTS% -Duser.language=de -Duser.country=DE
    • uncomment the line
    • add your language and optionally country code
     set JAVA_OPTS=%JAVA_OPTS% -Duser.language=pt -Duser.country=BR 
  1. extract the language files
    • extract from 'OJfolder\lib\openjump-core-*.jar' (where * are nightly built specific name) only the folder language into 'OJfolder' resulting in a folder structure like
    C:\OJfolder\bin\
    C:\OJfolder\language\
    C:\OJfolder\lib\
    C:\OJfolder\licenses\
    C:\OJfolder\readme.txt
    NOTE that OJfolder/language/ contains lots of jump_<languagecode>_<countrycode>.properties files
  2. look in language folder for a file called "jump_pt_BR.properties" (or the language you want to add/edit). If it does not exist see #On new translations and come back here thereafter.
  3. open the file with your favorite editor and translate the strings
    HINT if it appears like one line of text try an editor that supports unix line breaks e.g. wordpad
  4. you will see that on left side is an identifier string while on the right side of the "=" (equal sign) is the translated text
    HINT new strings have a date line just before like [sstein 7 march 2007]
  5. when you are finished editing, save the file
NOTE you should verify your changes by running OpenJUMP now and doublechecking your changes

Verification

  1. start openjump with the start script for your platform
  2. check the translated strings

Release

  1. send me the modified properties file to sstein@geo(....) or
  2. to the development mailing list http://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

After adding it, the nightly built of the next day should include your translation. I hope that is detailed enough :o) If questions appear please don't hesitate to contact me (Stefan/sstein) or the mailing list.

On new translations

  • please simply make a copy of the file jump.properties file and rename the copy to your language abbreviation (e.g. the swedish one should be like: jump_se.properties)
  • translate everything
  • put the properties file into language folder

Useful tools

Attesoro

7zip

  • can be used to unpack jar files (which use the zip compression)
  • a graphical (un)packer utility
  • available for windows or unofficially for several other operating systems (see downloads page) at

jEdit

  • a java based text editor
  • support all major text encodings
  • mighty search and replace engine
  • get it at

Translation of non latin languages like Chinese, Vietnamese, Japanese etc.

  1. Use an UTF-8 capable editor (notepad, notepad++, jEdit ...) to do the translation and save a UTF-8 text file as jump_zh_HK-utf8.properties.
  2. Convert the utf-8 to unicode using native2ascii.exe (part of the java development kit, e.g. C:\Program Files\Java\jdk<version>\bin\native2ascii.exe
    native2ascii.exe -encoding utf8 jump_zh_HK-utf8.properties jump_zh_HK.properties 
ATTENTION characters such as chinese may not be shown properly in the splash image.