Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Deprecated] memo

cocoatomo edited this pageJun 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.posource_file = locale/pot/glossary.potsource_lang = en

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

$ tx push -s

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

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

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

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp