使用sphinx 翻译odoo文档

Pipeline 如下

   

   

   

   

   

   

   

   

安装 sphinx 必须的 python 软件包

 

$ pip install sphinx sphinx-patchqueue sphinx-intl

   

   

编译 rST 文档 ,生成 pot 文件

 

$ make gettext

   

   

   

生成 po 文件

   

$ sphinx-intl update -p _build/locale/ --locale-dir=_build/locale/ -l zh_CN

   

   

   

   

po 文件 进行 翻译

   

使用任何翻译软件或者 翻译平台完成翻译工作

   

   

编辑 config.py 文件,为其指明 locale_dirs

   

   

   

   

$ make -e SPHINXOPTS="-D language='zh_CN'" html

   

   

   

   

翻译完成的文档

   

   

   

   

   

Quick start.

   

   

   

  • Export pot files.

   

make gettext

   

  • Generate locale po files

   

sphinx-intl update -p _build/locale/ --locale-dir=locale/ -l zh_CN

   

   

  • Register pot files to .tx/config file

   

sphinx-intl update-txconfig-resources --pot-dir _build/locale/ --locale-dir=locale/ --transifex-project-name odoo-documentation-technical

   

   

  • Make html

   

make -e SPHINXOPTS="-D language='zh_CN' -D locale_dirs=locale/" html