贡献

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

要查看目前哪些语言可供选择,可以打开代码库页面: http://developer.blender.org/diffusion/BMT/browse/trunk/blender_docs/locale

Note

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

安装

语言文件

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

  1. svn checkout https://svn.blender.org/svnroot/bf-manual-translations/trunk/blender_docs/locale/fr locale/fr

以上步骤将创建 locale/fr 子目录。

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

  1. blender_docs
  2. |- locale/
  3. | |- fr/
  4. | | |- LC_MESSAGES/
  5. |- manual/

Note

在使用命令行运行Subversion时(比如更新或提交po),记得先更改工作目录为 locale/fr (简体中文对应 locale/zh-hans )。

否则,将提示警告: 'locale' is not under version control

PO编辑器

编辑PO文件前,需安装PO编辑器。我们推荐使用 Poedit 。不过,其他PO编辑器也是可以的。

Note

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

使用翻译文件编译文档

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

在Linux和macOS上运行:

  1. make -e BF_LANG=fr

在Windows上运行:

  1. set BF_LANG=fr
  2. make html

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

编辑翻译文件

Now you can edit the PO translation files, in the LC_MESSAGES folder you have two files:

  • blender_manual.po — This is the main translation file that you will be editing.

  • sphinx.po — This translation file is much smaller and contains translations for the website theme.

To edit these files open them up in your translation editor, i.e. Poedit. Once in your editor you will see a list of texts, each of these items represent some part of the user manual. You may need to adjust your editor to sort the list in a way that makes sense for example “by source”.

You can now select an untranslated string and your editor will have an input box to add the translation. The modified .po files can now submitted as a patch or committed back to SVN.

Tip

Make sure that you Building with Translations to catch any syntax errors you may make while translating. These errors will be displayed as warnings while building the manual.

编辑翻译文件

提交补丁

维护

追踪模糊字符串

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

你可以运行下面的命令:

  1. make report_po_progress

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

  1. python tools_report/report_translation_progress.py locale/fr/

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

  1. python tools_report/report_translation_progress.py --help

更新PO文件

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

  1. make update_po

更新过的模板可以提交回SVN。

See also

可以按照 添加语言 页面的引导添加新语言。