- 翻訳可能とするために文字列を
_ または l_ で囲む
from sphinx.locale import _, l_
_("message")
- pot ファイルと po ファイルを更新
$ easy_install babel
$ python setup.py extract_messages
$ python setup.py update_catalog -D sphinx -l ja
- sphinx/locale/ja/LC_MESSAGES/sphinx.po を編集する
- po ファイルを mo ファイルにコンパイルする
$ python setup.py compile_catalog -D sphinx -l ja
- tests/root/ 以下にテスト用のプロジェクトがあるので、ファイルを追加する
- テストを実行する
$ easy_install nose
$ python tests/run.py -v
- 特定のテストのみ実行する
$ nosetests tests/test_intl.py -v -s --pdb --pdb-failure
- テスト用の po ファイルの作り方
$ cd tests/root
$ sphinx-build -b gettext -d _build/doctrees -D gettext_compact=0 . _build/gettext