Translations
From Navit's Wiki
Contents |
Using the web-based tool
We are currently testing Launchpad : https://translations.launchpad.net/navit/trunk If you want to update a translation, or add a new one, please try using launchpad. Old documentation is kept below for reference.
Configuring Speech in your language
To test results and for normal operation you should configure a speech program in navit.xml to listen the sentences, for example in spanish you could substitute the default speech definition:
<speech type="cmdline" data="echo 'Fix the speech tag in navit.xml to let navit say:' '%s'" />
with an appropiate one, that uses festival:
<speech type="cmdline" data="echo '%s' | festival --tts --language spanish" />
Here's how to use espeak:
<speech type="cmdline" data="espeak -s 150 -v german '%s' &" />
where -s is the "Speed in words per minute" (150 seems to be quite good for german) and -v specifies the language to use. Please refer to espeak to see which languages you can use on your system and which other command-line-options are useful. The & is replaced by & when the file is parsed and makes the call to espeak asynchronus. This is for not to freeze the GUI while espeak is speaking to you.
If you are running multiple programs with audio output, it is possible that /dev/dsp is locked (the default DSP for both festival and espeak). Use the following command to re-route the sound to ALSA. (To be exact, the Wave channel on the default sound card).
<speech type="cmdline" data="espeak -s 150 -v english --stdout '%s' | aplay > /dev/null &" />
Note on the Dutch language
I had good success with the dutch extensions for festival. nextens
Especially the spoken dutch streetnames are much more clear this way.
It takes a bit of work to compile it, but i think it is worth the effort.
Deprecated documentation below
Updating a translation
This is quite easy.
NavIt's source code changes a lot, almost everyday so your translation my be out of date. Hopefully, it's quite easy to update your translation, with the newest strings, without loosing your work.
Go into the source directory (extracted tarball for the releases, or the 'navit' directory fetched from svn, which is preferred). Go into the 'po' subfolder.
Now edit your po file, and translate the missing strings. You can use kbabel if you want a gui based tool. Don't forget to send us back your translation, so we can commit it into svn (look at the bottom of this page).
Adding new translations.
If there's no translation 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, or poEdit two editors specifically designed for translations. For each sentence, you'll get a block similar to this one :
#: src/main.c:88 msgid "Error parsing '%s': %s\n" msgstr ""
The first line is a comment, indicating where the string was found. Useful 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 Turn %1$s%2$s %3$s%4$s
In this case you have to define the correct grammar for your language. The first argument is strength (easily or strongly together with a trailing space or an empty string) The second argument is direction (left, right) The third argument is the distance when you have to do the turn The fourth argument is the road you have to turn to An example: Turn 'slightly' 'left' 'in 100 m' 'onto baker street' If your language has a different grammar and it should be like In 100m turn slightly left onto baker street then you have to use
%3$s %1$s%2$s turn%4$s
The special case of |something
The | symbol isn't there for translation, it is just to create unique message ids. Everything after and including the "|" is stripped. For example, in other languages male, female and neutral sexes of road objects might exist and might require different translation.
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. Thanks for your help!

