Skip to content

[Deprecated] memo

cocoatomo edited this page Jun 5, 2021 · 1 revision

構成前のメモ

Python 3.5 の pot 新規作成

Python 3.5 の最新版のソースコードを取得し、 Docs 配下で次のコマンドを実行する。

$ sphinx-build -E -b gettext -D gettext_compact=0  -w warnings.txt -d build/.doctrees . locale/pot

-D gettext_compact=0 で、 conf.py に gettext_compact=False を書かなくても良くする。 -w warnings.txt は warning をテキストファイルに書き出す。これは必須ではない。 -d build/.doctrees は、 .doctrees の出力先を指定している。デフォルトだと出力ディレクトリ配下に作られてしまうので。 . locale/pot で、ソースをカレントディレクトリに、出力先を locale/pot にしてる。

次は .tx/config を作る

$ sphinx-intl create-txconfig 
$ sphinx-intl update-txconfig-resources -d locale --transifex-project-name python-35

.tx/config の中の glossary が、Transifex上では予約後なので、リソース名を変える。 ファイルパスは変えなくて良い。

[python-35.glossary-1]
file_filter = locale/<lang>/LC_MESSAGES/glossary.po
source_file = locale/pot/glossary.pot
source_lang = en

これで pot ができたので、 Transifex にアップロードする。

$ tx push -s

.tx/config は翻訳用のリポジトリで使うはずなので残す。

pot をバージョン管理に含めるか

pot ファイルは生成物だが、利用する Sphinx のバージョンなどに依存しており、 Transifex にアップロードした pot の内容を確認したり新しい Sphinx で生成される pot がデグレしてないかを確認したりしたいので、 tx push するときに pot もコミットしておく。

Clone this wiki locally