贡献
本页使用法语(fr
)举例。不过其他语言只需替换语言代码即可。所以,要确保把这里的前缀 /fr
替换为你正在翻译的语言!
To see which languages are currently available, you can browse the repository:
https://projects.blender.org/blender/blender-manual-translations
Note
First of all, it is assumed that you have the manual already building. If you have not done this already go back too the Getting Started section.
安装
语言文件
在包含文档源代码的目录,运行以下检出命令:
git clone https://projects.blender.org/blender/blender-manual-translations.git locale
This will create a locale/fr
subdirectory.
你的目录布局应该是下面这样的:
blender-manual
|- locale/
| |- fr/
| | |- LC_MESSAGES/
|- 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 编辑器
To make edit the PO files you will need to install a PO editor. We recommended that you use Poedit however, any PO editor will do.
Note
For Linux users, you will have to check with your distribution's software center for a version of Poedit. This editor is only a recommendation. There are others, such as Kate and Kwrite, that could offer syntax highlighting and basic tools for text editing, e.g. letter case transposes. Other platforms can use some text editors supporting the syntax highlighting for PO files, or allowing you to create a custom one (such as Notepad++ on Windows).
使用翻译文件编译文档
现在你可以编译应用翻译后的手册了:
在 Linux 和 macOS 上运行:
make -e BF_LANG=fr
在 Windows 上运行:
set BF_LANG=fr
make html
Now you will have a build of the manual with translations applied.
编辑翻译文件
现在,您可以编辑 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
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.
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
Go to Blender repository and click the Fork button.
Confirm the fork with the default settings.
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:
git remote add me [email protected]:<USERNAME>/blender-manual-translations.git 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:
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.
维护
追踪模糊字符串
手册更新后,过时的翻译将被标记为模糊。要追踪这种状况,可以使用我们为此创建的工具。
你可以运行下面的命令:
make report_po_progress
但是该命令仅会给出一个快速的摘要,要得到更多信息,可以运行:
python tools_report/report_translation_progress.py locale/fr/
你得到一个文件列表,包含空或者模糊字符串的数量信息。如果你想要只是摘要,追加 -q
到上面的命令。更多选项,请参阅:
python tools_report/report_translation_progress.py --help
更新 PO 文件
随着原始手册的修改,po 模板也需要不断更新。注意,这个步骤不是必须的,因为管理员会定期自动更新这些 po 文件。这一步用于同步所有语言手册为同一版本。不过,如果你需要手动更新 po 文件,可以使用下面的命令:
make update_po
更新后的模板就可以提交到版本库。
See also
有关如何添加新语言的指南,请参阅添加语言。