贡献

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

To see which languages are currently available, you can browse the repository:

https://projects.blender.org/blender/blender-manual-translations

Note

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

安装

语言文件

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

  1. git clone https://projects.blender.org/blender/blender-manual-translations.git locale

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

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

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

Note

When running Git from the command line (such as updating or committing), you will need to change directory to locale first rather then the blender-manual directory.

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

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

编辑翻译文件

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

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

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

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

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 the repository.

Tip

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

Submitting Translations

Translators who have been given commit access can commit to the main repository without needing to fork the repository.

See Commit Guidelines if this applies to you.

Fork Translation Repository

  1. Go to Blender repository and click the Fork button.

  2. Confirm the fork with the default settings.

  3. Now you will have to add your personal fork as a remote in your local git repository. Click SSH to see the correct URL, and then add it like this:

    1. git remote add me git@projects.blender.org:<USERNAME>/blender-manual-translations.git
    2. git submodule sync

Note

In order to push to the fork repository, you need an SSH key. If you don’t already have the file ~/.ssh/id_rsa.pub, there’s a simple command to generate such keys which works on Linux, macOS, and in Git Bash on Windows:

  1. ssh-keygen

This command will generate a private key id_rsa and a public key id_rsa.pub in ~/.ssh. The private key must never be shown or sent to anyone else to avoid compromising your account, but the public key is safe to share.

The contents of ~/.ssh/id_rsa.pub can be copied and pasted into the account settings on projects.blender.org, after clicking “Add Key”. Any name for the SSH key is ok.

维护

追踪模糊字符串

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

你可以运行下面的命令:

  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

The updated templates can then be committed to the repository.

See also

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