Difference between revisions of "Translations"

From Navit's Wiki
Jump to: navigation, search
(Add instructions for translating texts. Note that Launchpad is not currently used.)
(Developers with commit access)
 
(19 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
=Submitting translations=
 
=Submitting translations=
  
==How to submit translations==
+
Navit uses [http://en.wikipedia.org/wiki/Gettext gettext] to display translated text.
Navit uses [http://www.gnu.org/software/gettext/gettext.html 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 .po.in (the .po files are generated from these files during the build).
 
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 .po.in (the .po files are generated from these files during the build).
  
Please submit translations as patches against the .po.in files. Before correcting the translations, please update the .po.in file as described below.
+
==Web-based translation tool==
 
 
==Updating the .po.in files==
 
Before working on the translations, it's important for the po.in files to be current - the original texts in the source code change regularly, and if the .po.in 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 .po.in files under navit/po, taking into account any changed texts in the source code. To update a .po.in file, just do a complete build (make all), then copy the [language].po file that was created over the [language].po.in file. This new .po.in file will contain the strings as they appear in the source code, along with the old translations from the previous .po.in 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.
+
The easiest and prefered way to are the web-based translation tools of Launchpad:
 +
* https://translations.launchpad.net/navit/trunk
 +
This allows everybody who signs up at the service to browse/contribute/edit the translations of every language. You are guided by launchpad during the process and help is offered in the whole wizard. In case of any questions, please get in contact with the [[team]].
  
==Web-based translation tool==
+
==.po.in files==
The project used the web-based translation tools of Launchpad in the past : https://translations.launchpad.net/navit/trunk
 
However, at the moment, Launchpad is not being used.
 
  
=Configuring Speech in your language=
+
Please submit manual translations as patches against the .po.in files. Before correcting the translations, please update the .po.in file as described below.
  
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:
+
Before working on the translations, it's important for the '''po.in files to be current''' - the original texts in the source code change regularly, and if the .po.in files are not current, you may translate text that is no longer part of Navit.
<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:
 
#!/bin/sh
 
echo "$1" | festival --tts --language "$2"
 
  
Here's how to use espeak:
+
During Navit's build, .po files are generated automatically from the .po.in files under navit/po, taking into account any changed texts in the source code. To update a .po.in file, just do a complete build (make all), then copy the [language].po file that was created over the [language].po.in file. This new .po.in file will contain the strings as they appear in the source code, along with the old translations from the previous .po.in 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.
<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 &amp; sign at the end of last line:
+
You can now correct/add translations, possibly using the old translations.
<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):
+
==Developers with commit access==
#!/bin/sh
 
espeak -s 150 -v "$2" "$1" &amp;
 
  
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).
+
Even if you have commit access, please ensure your translations go through Launchpad! Otherwise the next update from Launchpad will wipe out your work. Also, going through Launchpad ensures your translations are visible to contributors there so they won't unnecessarily translate strings which you have already taken care of.
<speech type="cmdline" data="/usr/local/bin/speech-wrapper %s english">
 
And following /usr/local/bin/speech-wrapper for espeak:
 
#!/bin/sh
 
espeak -s 150 -v "$2" --stdout "$1" | aplay > /dev/null
 
  
==Note on the Dutch language==
+
Launchpad lets you work online through the web interface, or offline by exporting .po files, editing them locally and uploading them back to Launchpad.
I had good success with the dutch extensions for festival. [http://nextens.uvt.nl/nextens-wiki/DownloadNextens nextens]
 
  
Especially the spoken dutch streetnames are much more clear this way.
+
To upload a file to Launchpad:
 +
* '''Make sure your work is based on a translation file exported from Launchpad.''' This is a requirement in order to prevent translators who work offline from inadvertently reverting translations made by others. Launchpad will check all uploaded files and reject those that don't have an export timestamp set by Launchpad.
 +
* Open the translation page for the language you want to update. (If you can't find it, open the page for a random language and replace the language identifier in the URL.)
 +
* Click '''Upload translation'''.
 +
* Click '''Browse''' and select your translation file. '''The file must have a .po extension, else it will be rejected – rename it if necessary.'''
 +
* Click '''Upload'''.
 +
* You're almost done! Your translations now need to be reviewed in order to finish the import.
  
It takes a bit of work to compile it, but i think it is worth the effort.
+
The workflow to add translations is as follows:
 +
* If you want to work online, make your edits first.
 +
* Pull the latest version of the source code from the repository.
 +
* Export translations from Launchpad (using the [https://translations.launchpad.net/navit/trunk/+export Download] link on the Translations Overview page) and copy them into your code tree.
 +
* Build Navit (for whichever platform you like) – this will regenerate the .po files in your build directory.
 +
* Rename the .po files that were created in your build directory to .po.in and copy them over the existing ones in the Navit code tree.
 +
* If you want to work offline, make your changes now, then upload the changed files to Launchpad.
 +
* Now commit your changes to SVN trunk. (A script to update translations from Launchpad is currently being worked on.)
  
==Letting Navit speak through KDEs kttsd in German==
+
=Dictionary=
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):
+
To have a consistent user experience, we have a dictionary of terms used in different places in our application. Please refer to this dictionary for translations.
<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:
+
{|class="wikitable"
[http://kanotix.wordpress.com/2006/08/14/deutsche-sprachausgabe-in-kde/ deutsche-sprachausgabe-in-kde]
+
!English!!German
 +
|-
 +
|Bookmark||Lesezeichen
 +
|-
 +
|Waypoint||Wegpunkt
 +
|-
 +
|street, road||Straße<br>Straßenverlauf
 +
|-
 +
|exit||Ausfahrt
 +
|-
 +
|ramp||Auffahrt
 +
|-
 +
|roundabound||Kreisverkehr
 +
|-
 +
|position||Standort
 +
|-
 +
|roadbook||Wegbeschreibung
 +
|-
 +
|destination||Ziel
 +
|-
 +
|navigation||Navigation
 +
|-
 +
|position||Position
 +
|-
 +
|command||Befehl
 +
|-
 +
|Point||?Punkt
 +
|-
 +
|Map point||?Kartenpunkt
 +
|-
 +
|screen coord||Bildschirm
 +
|-
 +
|settings ||Einstellungen
 +
|-
 +
|vehicle||Fahrzeug
 +
|-
 +
|}
  
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.
+
===Not to translate===
 +
*(OSM) "tag"
 +
*"POI"

Latest revision as of 23:27, 18 July 2015

Submitting translations[edit]

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 .po.in (the .po files are generated from these files during the build).

Web-based translation tool[edit]

The easiest and prefered way to are the web-based translation tools of Launchpad:

This allows everybody who signs up at the service to browse/contribute/edit the translations of every language. You are guided by launchpad during the process and help is offered in the whole wizard. In case of any questions, please get in contact with the team.

.po.in files[edit]

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

Before working on the translations, it's important for the po.in files to be current - the original texts in the source code change regularly, and if the .po.in 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 .po.in files under navit/po, taking into account any changed texts in the source code. To update a .po.in file, just do a complete build (make all), then copy the [language].po file that was created over the [language].po.in file. This new .po.in file will contain the strings as they appear in the source code, along with the old translations from the previous .po.in 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.

Developers with commit access[edit]

Even if you have commit access, please ensure your translations go through Launchpad! Otherwise the next update from Launchpad will wipe out your work. Also, going through Launchpad ensures your translations are visible to contributors there so they won't unnecessarily translate strings which you have already taken care of.

Launchpad lets you work online through the web interface, or offline by exporting .po files, editing them locally and uploading them back to Launchpad.

To upload a file to Launchpad:

  • Make sure your work is based on a translation file exported from Launchpad. This is a requirement in order to prevent translators who work offline from inadvertently reverting translations made by others. Launchpad will check all uploaded files and reject those that don't have an export timestamp set by Launchpad.
  • Open the translation page for the language you want to update. (If you can't find it, open the page for a random language and replace the language identifier in the URL.)
  • Click Upload translation.
  • Click Browse and select your translation file. The file must have a .po extension, else it will be rejected – rename it if necessary.
  • Click Upload.
  • You're almost done! Your translations now need to be reviewed in order to finish the import.

The workflow to add translations is as follows:

  • If you want to work online, make your edits first.
  • Pull the latest version of the source code from the repository.
  • Export translations from Launchpad (using the Download link on the Translations Overview page) and copy them into your code tree.
  • Build Navit (for whichever platform you like) – this will regenerate the .po files in your build directory.
  • Rename the .po files that were created in your build directory to .po.in and copy them over the existing ones in the Navit code tree.
  • If you want to work offline, make your changes now, then upload the changed files to Launchpad.
  • Now commit your changes to SVN trunk. (A script to update translations from Launchpad is currently being worked on.)

Dictionary[edit]

To have a consistent user experience, we have a dictionary of terms used in different places in our application. Please refer to this dictionary for translations.

English German
Bookmark Lesezeichen
Waypoint Wegpunkt
street, road Straße
Straßenverlauf
exit Ausfahrt
ramp Auffahrt
roundabound Kreisverkehr
position Standort
roadbook Wegbeschreibung
destination Ziel
navigation Navigation
position Position
command Befehl
Point ?Punkt
Map point ?Kartenpunkt
screen coord Bildschirm
settings Einstellungen
vehicle Fahrzeug

Not to translate[edit]

  • (OSM) "tag"
  • "POI"