The Source for Java Technology Collaboration


http://www.sibecolog.ru/

How to translate GanttProject interface to your language

Translation is quite easy but time consuming. It includes two major parts: translation of string resources and creating your calendar of public holidays. Translation of string resources is more important, but public holidays are highly appreciated.

Translation of string resources

The first thing you have to do is to translate menu labels, dialog titles and field labels, labels in reports, etc. to your native language. These things are called string resources and are stored in special plain text files. These files may be found in $GP_HOME/plugins/net.sourceforge.ganttproject_2.0.0/data/resources/language folder. Their names should start with prefix i18n_ followed by ISO code of your locale and dialect (e.g. fr or pt_BR) and terminated by extension .properties. Contents of these files are key-value pairs. When GP needs some string resource, it looks up an appropriate .properties file by some key.

NEW The exception is the default English translation which resides in i18n.properties. No locale code

In short, your goal is to create a new file i18n_yourCountryISOcode.properties, and translate all values. But this task is more difficult than it appears to be because of non-ASCII (that is, non-latin) symbols which are most likely found in your alphabet. Such symbols must be unicode-escaped, like \uxxxx. We are sure that you don't know unicode escaping of your native characters. Fortunately, there are tools which make encoding process transparent.

We use a nice Java tool called Attesoro (you need Java Runtime Environment to run it, but we hope you do have JRE, otherwise you just can't run GanttProject :). Unfortunately the latest version contains a bug: it does not escape symbols from upper part of ASCII (as a result, diacritic symbols from French alphabet appear as cyrillic symbols in some fonts), so we created a patched version. Attesoro interface is nice and simple: it shows all available translations in a tree, when you select some translation it shows you all available keys in a list and highlights those keys which are not yet translated by blue color. If you select some key, you may edit it's value just typing your native symbols. When you save the file, Attesoro automatically escapes non-latin symbols. You can also add a new translation file.

Now the translation process looks as follows:

  1. Run Attesoro (Windows users can just double click jar file)
  2. Add a new translation
  3. Translate all values
  4. Save the file

Some key-value pairs are obvious and self-descripting, other may be confusing and their translation probably depends on context. If you are not sure about the context, you may search the code for usage of the corresponding key or ask developers.

When you have created a new .properties file, you will want to see how does the translated interface look. Plugging your translation into GP 2.0.x (so that it appears in the combo box in the settings page, etc.) requirs some easy Java coding. If you don't want to bother with coding and compilation, just replace one of the existing translations with your file, start GP and select the appropriate language in the settings dialog. If you are happy, send us the translation file and we'll do all the necessary Java stuff

-- DmitryBarashev - 19 Jun 2006

Topic GanttProjectLocalization . { Edit | Ref-By | Printable | Diffs r4 < r3 < r2 < r1 | More }
 XML java.net RSS

Revision r4 - 23 Feb 2009 - 12:27:17 - Main.sibeco
Parents: WebHome > GanttProject