Richtlijnen voor vertalen

This manual is aiming to help the translator. First the general process of how technically a translation is done is explained. Later the translation is explained from an actual English rst document that is translated to Dutch. Finally a summary of “Rules of translation” is given.

Foreword

A first important note: If you want to translate content within the docs folder (not web), never do this in the master branch. For translations there are always translation branches available, once a document is fully updated in english for a certain version. As an example the branch to translate the manual of QGIS 1.8, you have to use the manual_en_v1.8 branch. For questions, please contact the qgis-community-team at http://lists.osgeo.org/mailman/listinfo/qgis-community-team.

General information

We zullen de plug-in Heatmap gebruiken als voorbeeld om uit te leggen hoe het vertalen werkt. In dit voorbeeld zullen we het vertalen van Engels naar Nederlands, maar in de praktijk werkt het hetzelfde voor andere documenten in alle talen.

First translation

To create documentation first rst documents are created. A prebuild script creates translation files named .po files for the english language in the folder /QGIS-Documentation/i18n/en.

Deze “originelen” worden door het script gekopieerd naar de mappen i18n voor andere talen.

The sentences in the .po files needs to be translated from english to the language with a translation tool editor. There is a web translation tool called pootle we would like to use, but it is not activated yet. However there is an excellent tool supplied with the qt development tools named Qt Linguist.

When you want to contribute, first get a .po file and add translations for the sentences in the .po file.

When you are finished the .po file is placed back in the right place and during the next build the buildscript now creates .mo files next to the .po files.

These .mo files are actually used by the script to create translated output.

Update translations

When afterwards an rst document is updated a new .po file is created in the english part. The contents of this new file will be merged with already existing .po files for each language. This means that when a new line is added to an rst document that was allready translated, only the new/updated sentences are added in the translated .po file and needs to be translated. The amount of work for updating translations for next versions of QGIS should be relative small.

Translate a .po-file

For this example we will use the relative smaller rst document for the heatmap plugin. The source of the document can be found here:

QGIS-Documentation/source/docs/user_manual/plugins/plugins_heatmap.rst

Waarom koos ik dit document?

  1. Het wordt als voltooid beschouwd voor de huidige uitgave Indien het nog niet voltooid is staat de volgende opmerking, gevolgd door een lege regel, boven in het document.

    |updatedisclamer|

    Dit zal een duidelijk zichtbare boodschap weergeven in het uitvoer-product. Bij het vertalen van een document met een opmerking over het bijwerken is er grote kans dat het later nog nader afgewerkt dient te worden.

  2. Het bevat ook afbeeldingen, bijschriften, kopregels, verwijzingen en vervangingen.

  3. Ik schreef het, dus is het voor mij eenvoudiger om het te vertalen ;-)

The build process has created the English .po file which can be found here:

QGIS-Documentation/i18n/en/LC_MESSAGES/docs/user_manual/plugins/plugins_heatmap.po

The equivalent Dutch .po file (basically a copy) can be found here:

QGIS-Documentation/i18n/nl/LC_MESSAGES/docs/user_manual/plugins/plugins_heatmap.po

Along this file you will see a tiny .mo file which indicates that it does not hold any translations yet.

Now I will grab this .po file and start translating it. During this translation session I will point out which parts (rst statements) need translation.

Vertalen in Qt Linguist

When you open the .po file in Qt Linguist for the first time you will see the following dialog:

Figure Translation 1:

../../_images/linguist_choose_language.png

Selecteer de taa voor de vertaling in het menu van Linguist osx

De doeltaal zou correct moeten zijn gevuld. De brontaal kan worden gelaten zoals het is met de taal POSIX en Country/Region op een willekeurig land.

When you press the [OK] button Qt Linguist is filled with sentences and you can start translating, see Figure translation 2.

Figure Translation 2:

../../_images/linguist_menu.png

Translate using the linguist menu osx

In het menu ziet u de volgende knoppen die handig in het gebruik zijn.

  • linguist_done_next The Translation Done Next button, is the most important button. If the item needs translation, you enter a translation in the text field, then hit this button. If the item does not translation just leave the text field for translation empty and also hit this button which indicates the item is done and you continue with the next item.
  • linguist_previous De knop Goto Previous kan worden gebruikt om terug te gaan naar een eerder vertaald item.

  • linguist_next De knop Goto Next kan worden gebruikt om naar het volgende vertaalde item te gaan.

  • linguist_next_todo De knop Next Todo springt naar het eerste nog te vertalen item. Handig als het originele document is gewijzigd en alleen enkele nieuwe/gewijzigde zinnen moeten worden vertaald.

  • linguist_previous_todo De knop Previous Todo zoekt terug en springt naar het eerste nog te vertalen item dat het vindt.

Vertalen van een handleiding

Nu beginnen we met het vertalen van de handleiding van de plug-in_heatmap!

The first two items do not need translation, just push the toolbar button which considers the translation finished and jump to the next item.

When I get to the third item we see a more interesting sentence to translate:

The |heatmap| :sup:`Heatmap` plugin allows to create a heatmap from a point vector map. A heatmap is a raster map showing the density or magnitude of point related information. From the result "hotspots" can easily be identified.
Deze zin bevat twee rst-argumenten:
  1. |heatmap| woorden tussen | zijn vervangingen en deze zouden nooit moeten worden vertaald! Dit zal worden vervangen door het pictogram van de plug-in Heatmap!

  2. :sup:`Heatmap` `` the ``:sup: statement is a superposition statement and prints the following text a bit higher. This is used to show the popup texts that appear when you hover above the toolbar item and this may be different when it is actually translated in the QGIS application. In this case it is not!

Alle andere platte tekst in deze zin kan worden vertaald!

The fifth translation item contains the :ref: rst statement that is commonly used to refer to another section somewhere in het manual! The text following a :ref: statement should never be changed because it is a unique identifier!

First this core plugin needs to be activated using the Plugin Manager (see Section :ref:`load_core_plugin`). After activation the heatmap icon |heatmap| can be found in the Raster Toolbar.

In this case “load_core_plugin” is a unique reference identifier placed before an rst item that has a caption. The ref statement will be replaced with the text of the header and turned into a hyerlink. When the header this reference is refering to is translated, all references to this header will be automatically translated as well.

Het volgende item bevat de rst-tag :menuselection: gevolgd door de actueel weergegeven tekst in een menu in de toepassing QGIS, dit zou in de toepassing vertaald kunnen worden en zou daarom, als dat het geval is, moeten worden vertaald.

Select from menu :menuselection:`View -->` :menuselection:`Toolbars -->` :menuselection:`Raster` to activate the Raster Toolbar when it is not yet activated.

In het hierboven vermelde item is “View –>” actueel vertaald als “Beeld –>” omdat dat de vertaling is die wordt gebruikt in de Nederlandstalige versie van de toepassing QGIS.

Een stukje verder komen we het volgende, wat lastig te vertalen, item tegen:

The |heatmap| :sup:`Heatmap` toolbutton starts the Dialog of the Heatmap plugin (see figure_heatmap_2_).

It holds a reference to a figure figure_heatmap_2_, and like a reference to section this reference should not be changed!! The reference definition itself from the rst-document is not included in the .po file and can therefore not be changed. This means the reference to figures can not be translated. When HTML is created you will see figure_heatmap_2. When a PDF document is created figure_heatmap_2_ is replaced with a figure number.

Het volgende item om te vertalen met attributen voor rst is het volgende item:

**Input Point dialog**: Provides a selection of loaded point vector maps.

Do not remove the stars in above line. It will print the text it holds in bold. The text itself is often text included in the dialog itself and may wel be translated in the application.

Het volgende item om te vertalen bevat de rst-tag :guilabel:.

When the |checkbox| :guilabel:`Advanced` checkbox is checked it will give acces to additional advanced options.

The text Advanced of the guilabel tag may wel be translated in the QGIS application and probably needs to be changed!

The following translation item contains ``airports``. The apostrophs are used this to give text another textfont. In this case it is a literal value and does not need translation.

For the following example, we will use the ``airports`` vector point layer from the QGIS sample dataset (see :ref:`label_sampledata`). Another exellent QGIS tutorial on making heatmaps can be found on `http://qgis.spatialthoughts.com <http://qgis.spatialthoughts.com/2012/07/tutorial-making-heatmaps-using-qgis-and.html>`_.

This item also includes a hyperlink with a url and an external presentation. The url should ofcourse be left intact, you are allowed to change the external text “http://qgis.spatialthoughts.com” which is visible by the reader. Never remove the underscore at the end of the hyperlink which forms an essential part of it!!

Samenvatting Regels voor vertalingen

  1. Do not change replacements like |nix|
  2. Do not change references that start with the tag :ref:
  3. Do not change references that end with an underscore like figure_1_
  4. Do not change the url in hyperlinks, but you may change the external description. Leave the underscore at the end of the hyperlink
  5. Change the contents of :sup:, :guilabel: and :menuselection:, Check if/how it is translated in the QGIS Application.
  6. Text between Double Stars and double apostrophes often indicate values or fieldnames, sometimes they need translation sometimes not.
  7. Be aware to use exactly the same apostrophes of the source text.
  8. Don’t end the translated strings with a new paragraph, otherwise the text will not be translated during the html generation.

Volg de hierboven weergegeven regels en het vertaalde document zal er goed uitzien!