LoginSignup
1
3

More than 5 years have passed since last update.

sphinx 翻訳環境の構築方法

Posted at

なかなか手順を覚えられないのでメモ。

sphinx-intl コマンドのインストール

pip install sphinx-intl

conf.py への設定追加

conf.py
locale_dirs = ['翻訳用ファイルを配置するディレクトリのパス']
gettext_compact = False
language = '翻訳後の言語'

翻訳用ファイルの生成

# build/locale_dirs 配下に pot ファイルを生成する。
make gettext
# source/locale_dirs 配下に po ファイルを生成する。
sphinx-intl update -p build/locale_dirs -l language

翻訳する

source/locale_dirs/language/LC_MESSAGES 配下の po ファイルへ訳文を入れていく。

ドキュメントをビルドする

sphinx-intl build
make html
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3