[PYTHON] How to build a sphinx translation environment

I can't remember the procedure easily, so make a note.

Install the sphinx-intl command

pip install sphinx-intl

Add settings to conf.py

conf.py


locale_dirs = ['The path of the directory where the translation files are placed']
gettext_compact = False
language = 'Translated language'

Generation of translation files

# build/locale_Create a pot file under dirs.
make gettext
# source/locale_Generate a po file under dirs.
sphinx-intl update -p build/locale_dirs -l language

translate

source / locale_dirs / language / LC_MESSAGES Put the translation in the po file under it.

Build documentation

sphinx-intl build
make html

Recommended Posts

How to build a sphinx translation environment
How to build a Django (python) environment on docker
How to build a development environment for TensorFlow (1.0.0) (Mac)
How to build a Python environment on amazon linux 2
How to make a Japanese-English translation
How to build a new python virtual environment on Ubuntu
How to build a python2.7 series development environment with Vagrant
I want to build a Python environment
How to build a LAMP environment using Vagrant and VirtulBox Note
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
How to share a virtual environment [About requirements.txt]
How to create a Python virtual environment (venv)
[Latest] How to build Java environment on Ubuntu
[Note] How to create a Ruby development environment
How to build Java environment on Ubuntu (Linux)
[TF] How to build Tensorflow in Proxy environment
[PyTorch] Sample ⑧ ~ How to build a complex model ~
[Note] How to create a Mac development environment
Summary of how to build a LAMP + Wordpress environment with Sakura VPS
How to set up a Python environment using pyenv
How to call a function
Build a LAMP environment [CentOS 7]
I want to easily build a model-based development environment
How to hack a terminal
[Go + Gin] I tried to build a Docker environment
Build a machine learning environment
Build a Python environment offline
How to build a beautiful Python environment on a new Mac and install Jupter Notebook
How to put a hyperlink to "file: // hogehoge" with sphinx-> pdf
A memo on how to easily prepare a Linux exercise environment
Add an extension to build a more comfortable Jupyter environment
How to output a document in pdf format with Sphinx
A note on how to load a virtual environment in PyCharm
How to develop in a virtual environment of Python [Memo]
Build a Python environment and transfer data to the server
How to write a Python class
How to put a symbolic link
Build a go environment using Docker
How to make a slack bot
How to create a Conda package
How to make a crawler --Advanced
How to make a recursive function
How to create a virtual bridge
How to make a deadman's switch
How to create a Dockerfile (basic)
[Blender] How to make a Blender plugin
How to delete a Docker container
How to make a crawler --Basic
How to build MongoDB C driver
Build a python3 environment on CentOS7
How to create a config file
How to build a NEM (current version) node (NIS1: NEM Infrastructure Server)
The simplest way to build a Spleeter usage environment using Windows
Spigot (Paper) Introduction to how to make a plug-in for 2020 # 01 (Environment construction)
How to write a docstring to create a named tuple document with sphinx
How to build Python and Jupyter execution environment with VS Code
Learn how to use Docker through building a Django + MySQL environment
How to build my own Linux server
How to create a clone from Github
How to split and save a DataFrame
Easily build a development environment with Laragon