Skip to content

Commit 366ab56

Browse files
Commit
1 parent 87c99bc commit 366ab56

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,30 @@ 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, you need to have Python installed, and a
292+
local copy of the :github:`CPython repository <python/cpython>` and your
293+
translation's repository (see table above). The PO files must be placed
294+
in a ``locale/LANG/LC_MESSAGES/`` (replacing ``LANG`` with your translation's
295+
language code) folder inside the ``Doc/`` directory of the CPython repository.
296+
297+
You can then build with :ref:`make <doc-build-make>` by adding
298+
a ``SPHINXOPTS="-D language=LANG" argument before the target
299+
or using :ref:`Sphinx directly <doc-build-sphinx>` and adding a
300+
``-D language LANG`` argument. For example:
301+
302+
.. code-block:: bash
303+
304+
# build the html format of the Polish translation using make
305+
make SPHINXOPTS="-D language=pl" html
306+
# build the html format of the Romanian translation using Sphinx directly
307+
python -m sphinx -b html . build/html -D language=ro
308+
309+
286310
Which version of the Python documentation should I work on?
287311
-----------------------------------------------------------
288312

0 commit comments

Comments
 (0)