From Navit's Wiki
Revision as of 19:29, 2 January 2012 by Reverse22 (talk | contribs)
Jump to: navigation, search

Submitting translations

How to submit translations

Navit uses gettext to display translated text. Gettext uses so-called ".po files" to hold the translated texts. The .po files for Navit are located in the source tree under navit/po. In Navit, they have the file ending (the .po files are generated from these files during the build).

Please submit translations as patches against the files. Before correcting the translations, please update the file as described below.

Updating the files

Before working on the translations, it's important for the files to be current - the original texts in the source code change regularly, and if the files are not current, you may translate text that is no longer part of Navit.

During Navit's build, .po files are generated automatically from the files under navit/po, taking into account any changed texts in the source code. To update a file, just do a complete build (make all), then copy the [language].po file that was created over the [language] file. This new file will contain the strings as they appear in the source code, along with the old translations from the previous file. Old translations for texts that no longer occur in the source code will appear commented out (with a leading "#"). New strings from the source code will have emtpy translations.

You can now correct/add translations, possibly using the old translations.

Web-based translation tool

The project used the web-based translation tools of Launchpad in the past : However, at the moment, Launchpad is not being used.

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="/usr/local/bin/speech-wrapper %s spanish">

You will also need following /usr/local/bin/speech-wrapper file wich must have an executable bit set:

echo "$1" | festival --tts --language "$2"

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 call to external speech command is asynchronus, but it will block if previous phrase is still being speaked. The GUI will freeze while espeak is speaking to you only if it's going to say a new phrase before it end with previous. If you do not want this behaviour, you can try using wrapper script like in festival smaple but with & sign at the end of last line:

<speech type="cmdline" data="/usr/local/bin/speech-wrapper %s german" />

Script /usr/local/bin/speech-wrapper would be like this (don't forget to set executable bit):

espeak -s 150 -v "$2" "$1" &

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="/usr/local/bin/speech-wrapper %s english">

And following /usr/local/bin/speech-wrapper for espeak:

espeak -s 150 -v "$2" --stdout "$1" | 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.

Letting Navit speak through KDEs kttsd in German

When you get textsynthesis in KDE running with KDEs kttsd, you can also let Navit speak through kttsd. Use this line for it (using german as language):

<speech type="cmdline" data="dcop kttsd KSpeech sayText %s de" cps="15"/>

When the kttsd is running, Navit will now speak with your configured language/voice from kttsd (run kttsmgr to configure it). Because kttsd can be made to speak german, you can let Navit now speak german, which is quite an improvement when it comes to pronouncing german words.

There is a good howto about setting kttsd up to speak german: deutsche-sprachausgabe-in-kde

Running Debian Lenny, the mbrola-packages can be installed with apt-get (or synaptic, or aptitude, ...). I have just installed all the stuff with "apt-get install kttsd kttsd-contrib-plugins kmouth ksayit mbrola mbrola-de6 mbrola-de7" and installed and configured the "txt2pho" like described in the howto and got a full functioning, german speech synthesis in KDE. Which Navit (with the <speech type="cmdline" data="dcop kttsd KSpeech sayText %s de" cps="15"/>) uses without problems.

reverse lookup

reverse phone lookup cell