翻译指南¶

本手册旨在帮助翻译。首先,解释了翻译技术的一般过程。之后,翻译将从实际的英语RST文档中解释,并翻译为荷兰语。最后总结一下 Rules of translation 给出。

尽管这些指南侧重于qgis文档,但下面描述的方法和规则也适用于qgis应用程序和网站翻译。

翻译过程

先创建文档 .rst 创建文档。预生成脚本创建名为 .po 文件夹中英文的文件 /QGIS-Documentation/i18n/en .

这些“原件”由脚本复制到其他语言的i18n文件夹中。

中的句子 .po 需要使用翻译工具编辑器将文件从英语翻译为语言。

当你想贡献的时候,首先要得到 .po 为中的句子归档并添加翻译 .po 文件。当你完成 .po 文件放回正确的位置,在下一个生成过程中,生成脚本现在创建 .mo 旁边的文件 .po 文件夹。这些 .mo 脚本实际上使用文件来创建转换的输出。

当随后更新RST文档时 .po 文件是在英文部分创建的。此新文件的内容将与已存在的内容合并 .po 每种语言的文件。这意味着,当将新行添加到已翻译的RST文档时,只有新的/更新的句子才会添加到已翻译的RST文档中。 .po 文件,需要翻译。为下一个版本的qgis更新翻译的工作量应该相对较小。

目前有两种不同的工具用于在QGIS中进行翻译:

请注意,无论您选择什么工具,翻译规则都是相同的。

警告

**一个重要的注意事项:**如果您想翻译docs文件夹(而不是web)中的内容,千万不要在master分支中这样做。对于翻译,一旦某一版本的文档完全更新为英语,就始终可以使用翻译分支。例如,要翻译qgis 2.8的手册,必须使用手册“en_v2.8”分支。

翻译文件

为了解释翻译的工作原理,我们将使用heatmap插件作为示例。在这个例子中,我们将把它从英语翻译成荷兰语,但是对于所有语言的其他文档,它实际上是相同的。

可在此处找到文档来源:

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

那我为什么选择这份文件呢?

  1. 对于当前版本,它被认为已完成。如果还没有完成,可以在文档顶部找到下面的语句,后跟一个空行。

    |updatedisclaimer|

    这将在输出产品中产生一个可见的免责声明。要开始翻译带有更新免责声明的文档,很有可能稍后需要对其进行另一次润色。

  2. 它还包括图像、标题、标题、参考和替换。

  3. 我写了它,这样我更容易翻译;-)

构建过程创造了英语 .po 可在此处找到的文件:

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

等效荷兰语 .po 文件(基本上是一份副本)可以在以下位置找到:

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

沿着这个文件,你会看到一个很小的 .mo 一个文件,指示它尚未保存任何翻译。

Transifex中的转换

为了用transifex翻译qgis,首先需要 join the project . 一旦你有了一个团队,点击相应的项目和你的语言。你得到所有可翻译的列表 .po 文件夹。点击 docs_user-manual_plugins_plugins-heatmap 选择heatmap插件文件并选择 Translate 在提示的对话框中。请注意,您也可以选择下载文件并使用qt-linguist等工具进行翻译。下一页列出了文件中的所有句子。您只需选择文本并按照 guidelines .

For further information on the use of Transifex Web Editor, see https://docs.transifex.com/translation/translating-with-the-web-editor.

qt语言学家的翻译

有了qt语言学家,您需要手动获取 .po 文件。当您第一次在qt-linguist中打开文件时,您将看到以下对话框:

../../_images/linguist_choose_language.png

在“语言学家”菜单中选择要翻译的语言

目标语言应正确填写。源语言可以保留为任何国家的语言posix和国家/地区。

当你按下 OK button qt语言学家充满了句子,您可以开始翻译,请参见图“翻译”菜单。

../../_images/linguist_menu.png

使用语言学家菜单翻译

在菜单中,您可以看到以下方便使用的按钮。

  • 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 need 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.

翻译手册

现在我们开始翻译插件的热处理手册!

翻译大多数句子应该是直截了当的。在翻译过程中,我将指出哪些部分(RST语句)需要特殊翻译。

下面我们看到一个有趣的句子:

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.

此句包含两个RST语句:

  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 the Dutch case it is not!

这句话中的所有其他纯文本都可以翻译!

下一个翻译项包含 :ref: 通常用于参考手册其他部分的声明!后面的文本 :ref: 语句不能更改,因为它是唯一标识符!

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 hyperlink. When the header this reference is refering to is translated, all references to this header will be automatically translated as well.

下一项包含RST标记 :menuselection: 然后是QGIS应用程序菜单中实际显示的文本,这可以在应用程序中翻译,因此在这种情况下应该更改。

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

在上面的项目中,“View-->”实际上被翻译为“Beeld-->”,因为这是荷兰语本地化的QGIS应用程序中使用的翻译。

更进一步,我们会遇到以下棘手的翻译项目:

The |heatmap| :sup:`Heatmap` tool button starts the Dialog of the Heatmap
plugin (see figure_heatmap_settings_).

它包含一个数字的引用 figure_heatmap_settings_ 和对章节的引用一样,不应更改此引用!!RST文档中的引用定义本身不包含在 .po 文件,因此不能更改。这意味着对数字的引用无法翻译。创建HTML时,您将看到 figure_heatmap_settings . 创建PDF文档时 figure_heatmap_settings_ 替换为数字编号。

具有rst属性的下一个翻译项是以下项:

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

不要去掉上面的星。它将以粗体打印它保存的文本。文本本身通常包含在对话框本身中,并且可以在应用程序中进行翻译。

以下翻译项包含 :guilabel: RST标签。

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

课文 Advanced guiabel标签可以在qgis应用程序中翻译,可能需要更改!

以下翻译项包含airports\ . 引号用于为文本提供另一种文本字体。在这种情况下,它是一个文本值,不需要翻译。

For the following example, we will use the ``airports`` vector point
layer from the QGIS sample dataset (see :ref:`label_sampledata`).
Another excellent QGIS tutorial on making heatmaps can be found on
`https://www.qgistutorials.com
<https://www.qgistutorials.com/en/docs/creating_heatmaps.html>`_.

此项目还包括一个带有URL和外部演示文稿的超链接。当然,URL应该保持完整,您可以更改外部文本 https://www.qgistutorials.com 读者可以看到。千万不要删除构成超链接重要部分的超链接末尾的下划线!!

摘要翻译规则

  1. 不要在两者之间更改文本 | 类字符 |bronze||checkbox||labels||selectString||addLayer| …这些是用来替换图像的特殊标签
  2. 不要更改以标记开头的引用 :ref::file:
  3. 不要更改以下划线结尾的引用,例如 figure_labels_1_
  4. 不要更改超链接中的URL,但可以更改外部说明。将下划线保留在超链接的末尾,不留额外的间距( >`_
  5. 更改以下引号内的文本 :index::sup::guilabel::menuselection: 标签。检查是否/如何在QGIS应用程序中进行翻译。不要更改标记本身。
  6. 双星和双引号之间的文本通常表示值或字段名,有时它们需要翻译,有时则不需要。
  7. 注意使用与源文本完全相同的(数量)特殊字符,例如 ``***:: . 这些都有助于化妆品所提供的信息
  8. 不要以空格开头或结尾由特殊字符或标记保留的文本
  9. 不要用新段落结束已翻译的字符串,否则在HTML生成过程中将不会翻译文本。

遵守上述规则,翻译后的文件看起来会很好!

如有任何问题,请联系 QGIS Community TeamQGIS Translation Team .