- Make your Transifex account
- Join sphinx-doc-1_2_0 Project
- Install Transifex Client
- Install sphinx-gettext-helper
Clone Sphinx repository
$ hg clone ssh://[email protected]/birkenfeld/sphinx sphinx-doc-ja $ cd sphinx-doc-ja/doc
Edit
conf.pydiff --git a/doc/conf.py b/doc/conf.py --- a/doc/conf.py +++ b/doc/conf.py @@ -12,6 +12,10 @@ templates_path = ['_templates'] exclude_patterns = ['_build'] +locale_dirs = ["locale"] +language = 'ja' +gettext_compact = False + project = 'Sphinx' copyright = '2007-2013, Georg Brandl' version = sphinx.__released__
Edit
Makefilediff --git a/doc/Makefile b/doc/Makefile --- a/doc/Makefile +++ b/doc/Makefile @@ -118,7 +118,7 @@ @echo "pdflatex finished; the PDF files are in _build/latex." gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) _build/locale + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) locale/pot @echo @echo "Build finished. The message catalogs are in _build/locale."
Generate pot files
$ make gettext
Configure Transifex project
$ cd locale $ tx init $ find pot -name '*.pot' | while read f; do base=`echo $f | perl -pe 's|^pot/(.*)\.pot$|\1|'`; tx set --auto-local -r sphinx-doc-1_2_0.`echo $base | perl -pe 's|/|--|g'` "<lang>/LC_MESSAGES/$base.po" --source-language en --source-file $f -t PO --execute; done $ cd ..
Fetch translation (po files)
$ cd locale $ tx pull -l ja $ cd ..
Compile translation (po files -> mo files)
$ sphinx-gettext-helper -b -l ja -p locale/pot
Build html
$ make clean html