Outdated version of the documentation. Find the latest one here.

翻訳ガイドライン

このマニュアルは翻訳者を支援することを目的としています..最初にどのように翻訳が行われるか説明します.その後英語のrst文書からオランダ語への翻訳手順を説明します.最後に必要な ”翻訳規則” について説明します.

一般情報

ヒートマッププラグインの例を使って翻訳の作業を説明します.この例では英語からオランダ語に翻訳を行います,しかしこれは他のドキュメントや言語にも適用できるはずです.

最初の翻訳

文書を作成するたには最初にrst文書ファイルを作る必要があります.prebuildスクリプトを使うと .po ファイルという名前の翻訳用ファイルを作ります.英語用ファイルは ・QGいS-Documentation/i18n/enフォルダに作成されます.

それらの “オリジナル” はスクリプトによって他の言語の i18n フォルダにコピーされます.

.poファイル内の文章はツールを使って英語から他の言語に翻訳できますよく利用される.pootleというweb翻訳ツールがありますが,それはまだ利用できるようになっていません.その他にqtデベロップメントツールに含まれる Qt Linguestという素晴らしいツールがあります.

もしあなたがコントリビュートを行いたい場合最初に .po ファイルを取得して翻訳を行った文章を .po ファイルに書き加えて下さい.

.poファイルの翻訳が終わったら正しい場所に戻して下さい.そうするとビルドスクリプトの次回のビルドで .po ファイルの横に .mo ファイルが作られます.

それらの .mo ファイルは翻訳出力を作るためにスクリプトによって使われます.

翻訳の更新

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.

.po-fileの翻訳

例としてヒートマッププラグインの比較的小さなrst文書を利用します.文書のソースはここにあります:

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

なぜこの文書を選んだのでしょうか?

  1. It is considered finished for the current release. If it is not yet completed the following statement followed by an empty line can be found in the top of the document.

    |updatedisclamer|

    This will produce a visible disclaimer in the output product. To start translating a document with an update disclaimer there is a good chance that later on it needs another finishing touch.

  2. It also includes images, captions, headers, references and replacements.

  3. I wrote it so it is easier for me to translate ;-)

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.

Translation 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

Select language for translation in linguist menu osx

The Target language should be filled correctly. The Source language can be left as is with language POSIX and Country/Region on Any Country.

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 the menu you see the following buttons which are convenient to use.

  • 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 The Goto Previous button, can be used to go to the previous translation item.
  • linguist_next The Goto Next button, can be used to go to the next translation item.
  • linguist_next_todo The Next Todo button, jumps to the first translation item that still needs a translation. Handy when the original document has changed and only several new/changed sentences need to be translated.
  • linguist_previous_todo The Previous Todo button, searches backward and jumps to the first translation item it finds that still needs a translation.

Translate a manual

Now we start to translate the plugin_heatmap manual!

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.
This sentence contains two rst statements:
  1. |heatmap| words between | are replacements and these should never be translated! This will be replaced by the heatmap plugin icon!
  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!

All other plain text in this sentence can be translated!

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.

The next item contains the rst-tag :menuselection: followed by text actually displayed in a menu in QGIS application, this may be translated in the application and therefore should be changed when this is the case.

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

In above item “View –>” is actually translated to “Beeld –>” because this is the translation used in the Dutch localized QGIS application.

A bit further we meet the following tricky translation item:

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.

The next translation item with rst attributes is the following 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.

The following translation item contains the :guilabel: rst tag.

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!!

Summary Rules for translation

  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.

Stick to above presented rules and the translated document will look fine!