Skip to content

Commit 622083e

Browse files
StanFromIrelandAA-Turnerrffontenellehugovk
authored
Add a section on building a docs translation (#1661)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 99e8ba5 commit 622083e

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

documentation/start-documenting.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ To build the docs as HTML, run:
162162
* Replace ``html`` with ``htmllive`` to rebuild the docs,
163163
start a local server, and automatically reload the page in your
164164
browser when you make changes to reST files (Unix only).
165+
* To build a documentation translation, see this
166+
:ref:`guide <docs-build-translation>`.
165167

166168
It is also possible to build only certain pages of the documentation in order
167169
to save time during the build process. Following is an example for building two

documentation/translations/translating.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,32 @@ Some useful resources:
283283
Translation FAQ
284284
===============
285285

286+
.. _docs-build-translation:
287+
288+
How do I build a docs translation?
289+
----------------------------------
290+
291+
To build a documentation translation for a specific language,
292+
you need to have Python installed and a
293+
local copy of the :github:`CPython repository <python/cpython>` and
294+
translation repository (see table above). The PO files must be placed
295+
in a :samp:`locales/{LANG}/LC_MESSAGES/` (replacing :samp:`{LANG}` with the translation's
296+
language code) folder inside the :file:`Doc/` directory of the CPython repository.
297+
298+
You can then build with :ref:`make <doc-build-make>` by adding
299+
a ``SPHINXOPTS="-D language=LANG"`` variable before the target
300+
or by using :ref:`Sphinx directly <doc-build-sphinx>` and adding a
301+
``-D language=LANG`` option. For example:
302+
303+
.. code-block:: bash
304+
305+
# Build the HTML format of the Polish translation using make
306+
make SPHINXOPTS="-D language=pl" html
307+
308+
# Build the HTML format of the Romanian translation using Sphinx directly
309+
python -m sphinx -b html . build/html -D language=ro
310+
311+
286312
Which version of the Python documentation should I work on?
287313
-----------------------------------------------------------
288314

0 commit comments

Comments
 (0)