Translations

From Navit's Wiki
Revision as of 18:09, 6 October 2007 by KaZeR (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Updating a translation This is quite easy.

NavIt's source code changes a lot, almost everyday. Your translation my be out of date. Hopefully, it's quite easy to update your translation, with the newest strings, without loosing your work.

Simply use :

msgmerge -U <yourlang>.po navit.pot

Now edit your po file, and translate the missing strings.

Adding new translations. If there's no .mo file for your language yet, you can contribute a translation. It's easy :)


Go into the po subfolder. Copy the navit.pot file to <yourlang>.po yourlang should be the iso code for your country, with two letters. (the first two of 'echo $LC_ALL' )

A .po file is simply a text file, but you may want to try kbabel, an editor specifically designed for translations. For each sentence, you'll get a block similar to this one :

  1. src/main.c:88

msgid "Error parsing '%s': %s\n" msgstr ""

The first line is a comment, indicating where the string was found. Usefull if you want to see the string in its original context. The msgid is the original string. The msgstr is where you would put the translated string.

Warning : you have to respect the special characters in the string. You also have to respect the numbers of arguments in the string. \n is a newline. %s means that another string should go there %d is for a float number %i an integer.

The special case of strength_pos, direction_pos and distance_pos

Theses particulars entries are used to define the correct grammar. The translation for theses items should be an integer. Turn phrases are constructed this way :

Let's take an example :

In the translated sentence "turn strongly right in 100 meters" the phrases "strongly" "right" and "100 meters" should be : (first="1", second="2" and third="3" position) - strength_pos = 1 - direction_pos = 2 - distance_pos = 3

If you want something like : "in 100 meters turn strongly right" simply do the following : - strength_pos = 2 - direction_pos = 3 - distance_pos = 1

You'll also need to move the "Turn" word in the string : msgid "Turn %s%s %s" msgstr "%s Turn %s%s"

The first %s would be replaced by the distance_pos, and so on.

Done? OK!

Once you have translated the file, send it back to us. Have a look at the Contacts page, or send them to kazer at altern dot org.