Before start you need to install the required dependencies
- Python 3.10
- uv
uv is a fast Python package manager and virtual environment tool (by Astral).
Install it with one of the following:
pipx install uv
# or
python -m pip install uv
Create venv:
python3 -m venv .venv
Activate the .venv:
source .venv/bin/activate
Install requirements (recommended):
uv pip install -r requirements.txt
If you do not have uv installed, use:
pip3 install -r requirements.txt
Just activate .venv:
source .venv/bin/activate
Ensure dependencies are up to date:
uv pip install -r requirements.txt
Then you can run Sphinx commands.
To build EN docs:
make -e BUILDDIR="build/docs/en" html
Translations are located in the source/locale/<lang>/LC_MESSAGES directory. An example of one such file, from Sphinx, index.po, is given below.
#: ../../source/index.rst:6
msgid "Welcome"
msgstr "FILL HERE BY TARGET LANGUAGE"Another case, msgid is multi-line text and contains reStructuredText syntax:
#: ../../source/index.rst:12
msgid ""
"EO data processing and analysis – here `Mapflow <https://mapflow.ai>`_ "
"comes in game |:boom:|"
"FILL HERE BY TARGET LANGUAGE - `Mapflow <https://mapflow.ai>`_ "
"FILL HERE BY TARGET LANGUAGE |:boom:|"Please be careful not to break reST notation!
If a document is updated, it is necessary to generate updated pot files and to apply differences to translated po files. In order to apply the updates from a pot file to the po file, use the sphinx-intl update command
make gettextsphinx-intl update -p build/gettext -l ruTo watch docs changes immediately you can use sphinx-autobuild tool.
It is included in requirements.txt.
Run the autobuild server:
sphinx-autobuild source build/autobuild
Only en docs will be built