贡献

本页使用法语(fr)举例。不过其他语言只需替换语言代码即可。所以,要确保把这里的前缀 /fr 替换为你正在翻译的语言!

To see which languages are currently available, you can check the online interface, or browse the underlying git repository.

简单贡献

The preferred way to contribute to the translation effor is the use the web-based interface, currently a Weblate instance.

Simple enhancement suggestions can be contributed by any user, even without loging in. Suggestions will be reviewed by the translating team before they get published.

Weblate also comes with new helping tools to improve coherance of translations, like the glossary.

高级操作

If for some reasons the web-based translation interface does not work well for you, you can still download PO file from it, and upload back it later.

Warning

You will have to deal with potential conflicts yourself if some update happened in the mean time. Direct commit to the git repository for translations is not possible anymore.

Note

There is a known issue with the current tool behind the web interface, which will make heavy processing like upload and integration of a PO file take several minutes, with the web page staying in refresh mode for the whole time. If it takes more than ten minutes, it will even apparently fail with a server timeout error message. There is usually no actual problem though, so no need to re-try uploading the PO file then, refreshing the page after a few minutes should be enough to see the contribution in the web interface.

Note

首先,假定你已经有生成好的手册。如果你还没有生成,请参考前面的入门部分。

安装

语言文件

在包含文档源代码的目录,运行以下检出命令:

make checkout_locale

系统会提示你输入要下载的语言文件夹。在本例中,我们将使用 fr。按 Return 键将确认这一选择。

下载需要几分钟时间,但完成后会创建一个 locale/fr 子目录。

你的目录布局应该是下面这样的:

blender-manual
   |- locale/
   |  |- fr/
   |  |  |- LC_MESSAGES/
   |- manual/

Note

在使用命令行运行 Git 时(比如更新时),需要先将目录更改为 locale 而不是 blender-manual

PO 语言文件本身也可从网页界面的 文件 菜单下载,该菜单位于 手册 组件的每个专用语言页面上。

PO编辑器

要编辑 PO 文件,您需要安装一个 PO 编辑器。我们推荐使用 Poedit,但其他 PO 编辑器也是可以的。

Note

对于 Linux 用户,需要在所用发行版的软件中心查找 Poedit。该编辑器仅是一个推荐选项。还有一些其他的编辑器,如 Kate 和 Kwrite,可以提供语法高亮和基本文本编辑工具,如字母大小写转换。在其他平台上,也可以使用支持 PO 文件语法高亮,或者允许用户自定义语法高亮(如 Windows 下的 Notepad++)的文本编辑器。

使用翻译文件编译文档

构建

现在你可以编译应用翻译后的手册了:

在 Linux 和 macOS 上运行:

make -e BF_LANG=fr

在 Windows 上运行:

set BF_LANG=fr
make html

现在你可以得到应用翻译后的手册。

编辑翻译文件

现在,您可以编辑 PO 翻译文件,在 LC_MESSAGES 文件夹中,您有两个文件:

  • blender_manual.po --这是您将要编辑的主要翻译文件。

  • sphinx.po --此翻译文件小得多,包含网站主题的翻译。

要编辑这些文件,请在翻译编辑器中打开它们,即 Poedit。进入编辑器后,您将看到文本列表,每个项目都代表用户手册的某些部分。您可能需要调整编辑器以合理的方式对列表进行排序,例如 "按源"。

现在您可以选择一个未翻译的字符串,编辑器将有一个输入框来添加翻译。修改后的 .po 文件现在可以提交回网络界面。

Tip

确保您使用翻译构建以捕获翻译过程中可能发生的任何语法错误。在构建手册时,这些错误将显示为警告。

维护

追踪模糊字符串

手册更新后,过时的翻译将被标记为模糊。要追踪这种状况,可以使用我们为此创建的工具。

你可以运行下面的命令:

make report_po_progress

但是该命令仅会给出一个快速的摘要,要得到更多信息,可以运行:

python tools/translations/report_translation_progress.py locale/fr/

你得到一个文件列表,包含空或者模糊字符串的数量信息。如果你想要只是摘要,追加 -q 到上面的命令。更多选项,请参阅:

python tools/translations/report_translation_progress.py --help

更新 PO 文件

随着原始手册的修改,po 模板也需要不断更新。注意,这个步骤不是必须的,因为管理员会定期自动更新这些 po 文件。这一步用于同步所有语言手册为同一版本。不过,如果你需要手动更新 po 文件,可以使用下面的命令:

make update_po

更新后的模板就可以提交到版本库。

See also

有关如何添加新语言的指南,请参阅添加语言