File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff 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
166168It is also possible to build only certain pages of the documentation in order
167169to save time during the build process. Following is an example for building two
Original file line number Diff line number Diff line change @@ -283,6 +283,32 @@ Some useful resources:
283283Translation 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
You can’t perform that action at this time.
0 commit comments