- Notifications
You must be signed in to change notification settings - Fork7
[Deprecated] memo
cocoatomo edited this pageJun 5, 2021 ·1 revision
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.posource_file = locale/pot/glossary.potsource_lang = en
これで pot ができたので、 Transifex にアップロードする。
$ tx push -s
.tx/config
は翻訳用のリポジトリで使うはずなので残す。
pot ファイルは生成物だが、利用する Sphinx のバージョンなどに依存しており、 Transifex にアップロードした pot の内容を確認したり新しい Sphinx で生成される pot がデグレしてないかを確認したりしたいので、 tx push するときに pot もコミットしておく。