贡献#
本页使用法语(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
You will be prompted to type in the language folder you want to download.
In the case of this example we will use fr
. Pressing Return will confirm this selection.
It will take a few minutes to download but once complete it will create a locale/fr
subdirectory.
你的目录布局应该是下面这样的:
blender-manual
|- locale/
| |- fr/
| | |- LC_MESSAGES/
|- manual/
Note
When running Git from the command line (such as updating),
you will need to change directory to locale
first rather than the blender-manual
directory.
The PO language files themselves can also be downloaded from the web interface, Files
menu,
on each dedicated language page of the Manual
comnponent.
PO编辑器#
To make edit the PO files you will need to install a PO editor. We recommend that you use Poedit, however any PO editor will do.
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。进入编辑器后,您将看到文本列表,每个项目都代表用户手册的某些部分。您可能需要调整编辑器以合理的方式对列表进行排序,例如 "按源"。
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 be submitted back to the web-based interface.
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
The updated templates can then be committed to the repository.
See also
有关如何添加新语言的指南,请参阅 添加语言。