Skip to content

Commit 2ce07da

Browse files
authored
Update translation contribution guidance (#14083)
1 parent 9ca942b commit 2ce07da

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

doc/internals/contributing.rst

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,34 @@ To do so, use `sphinx-autobuild`_ to run the following command:
280280
.. _sphinx-autobuild: https://github.com/sphinx-doc/sphinx-autobuild
281281

282282
Translations
283-
~~~~~~~~~~~~
283+
------------
284284

285285
The parts of messages in Sphinx that go into builds are translated into several
286286
locales. The translations are kept as gettext ``.po`` files translated from the
287287
master template :file:`sphinx/locale/sphinx.pot`.
288288

289+
These Sphinx core messages are translated using the online `Transifex
290+
<https://explore.transifex.com/sphinx-doc/sphinx-1/>`__ platform.
291+
292+
Translated strings from the platform are pulled into the Sphinx repository
293+
by a maintainer before a new release.
294+
295+
We do not accept pull requests altering the translation files directly.
296+
Instead, please contribute translations via the Transifex platform.
297+
298+
Translations notes for maintainers
299+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300+
301+
The `transifex CLI <https://developers.transifex.com/docs/cli>`__ (``tx``)
302+
can be used to pull translations in ``.po`` format from Transifex.
303+
To do this, go to :file:`sphinx/locale` and then run ``tx pull -f -l LANG``
304+
where ``LANG`` is an existing language identifier.
305+
It is good practice to run ``python utils/babel_runner.py update`` afterwards
306+
to make sure the ``.po`` file has the canonical Babel formatting.
307+
289308
Sphinx uses `Babel <https://babel.pocoo.org/en/latest/>`_ to extract messages
290309
and maintain the catalog files. The :file:`utils` directory contains a helper
291-
script, ``babel_runner.py``.
310+
script, :file:`utils/babel_runner.py`.
292311

293312
* Use ``python babel_runner.py extract`` to update the ``.pot`` template.
294313
* Use ``python babel_runner.py update`` to update all existing language
@@ -301,19 +320,10 @@ When an updated ``.po`` file is submitted, run
301320
``python babel_runner.py compile`` to commit both the source and the compiled
302321
catalogs.
303322

304-
When a new locale is submitted, add a new directory with the ISO 639-1 language
323+
When a new locale is added, add a new directory with the ISO 639-1 language
305324
identifier and put ``sphinx.po`` in there. Don't forget to update the possible
306325
values for :confval:`language` in :file:`doc/usage/configuration.rst`.
307326

308-
The Sphinx core messages can also be translated on `Transifex
309-
<https://www.transifex.com/sphinx-doc/sphinx-1/>`_. There ``tx`` client tool,
310-
which is provided by the ``transifex_client`` Python package, can be used to
311-
pull translations in ``.po`` format from Transifex. To do this, go to
312-
:file:`sphinx/locale` and then run ``tx pull -f -l LANG`` where ``LANG`` is an
313-
existing language identifier. It is good practice to run
314-
``python babel_runner.py update`` afterwards to make sure the ``.po`` file has the
315-
canonical Babel formatting.
316-
317327

318328
Debugging tips
319329
--------------

doc/usage/advanced/intl.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,11 @@ Contributing to Sphinx reference translation
375375
The recommended way for new contributors to translate Sphinx reference is to
376376
join the translation team on Transifex.
377377

378-
There is a `sphinx translation page`_ for Sphinx (master) documentation.
378+
There is a `Sphinx translation page`_ for Sphinx (master) documentation.
379379

380380
1. Login to Transifex_ service.
381-
2. Go to `sphinx translation page`_.
381+
2. Go to the `"Sphinx's documentation" translation project
382+
<https://app.transifex.com/sphinx-doc/sphinx-doc/>`__.
382383
3. Click ``Request language`` and fill form.
383384
4. Wait acceptance by Transifex sphinx translation maintainers.
384385
5. (After acceptance) Translate on Transifex.
@@ -414,7 +415,7 @@ percentage of nodes that have been translated on a per-document basis.
414415
.. _`sphinx-intl`: https://pypi.org/project/sphinx-intl/
415416
.. _Transifex: https://app.transifex.com/
416417
.. _Weblate's documentation: https://docs.weblate.org/en/latest/devel/sphinx.html
417-
.. _`sphinx translation page`: https://app.transifex.com/sphinx-doc/sphinx-doc/
418+
.. _`Sphinx translation page`: https://explore.transifex.com/sphinx-doc/sphinx-doc/
418419
.. _`Transifex Client documentation`: https://developers.transifex.com/docs/using-the-client
419420
.. _`Transifex API token`: https://app.transifex.com/user/settings/api/
420421
.. _`sphinx-intl update-txconfig-resources documentation`: https://sphinx-intl.readthedocs.io/en/master/refs.html#sphinx-intl-update-txconfig-resources

0 commit comments

Comments
 (0)