mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add translation progress information (#11509)
Co-authored-by: Manuel Kaufmann <humitos@gmail.com>
This commit is contained in:
@@ -340,6 +340,23 @@ There is a `sphinx translation page`_ for Sphinx (master) documentation.
|
||||
|
||||
Detail is here: https://docs.transifex.com/getting-started-1/translators
|
||||
|
||||
|
||||
Translation progress and statistics
|
||||
-----------------------------------
|
||||
|
||||
.. versionadded:: 7.1.0
|
||||
|
||||
During the rendering process,
|
||||
Sphinx marks each translatable node with a ``translated`` attribute,
|
||||
indicating if a translation was found for the text in that node.
|
||||
|
||||
The :confval:`translation_progress_classes` configuration value
|
||||
can be used to add a class to each element,
|
||||
depending on the value of the ``translated`` attribute.
|
||||
|
||||
The ``|translation progress|`` substitution can be used to display the
|
||||
percentage of nodes that have been translated on a per-document basis.
|
||||
|
||||
.. rubric:: Footnotes
|
||||
|
||||
.. [1] See the `GNU gettext utilities
|
||||
|
||||
@@ -1002,6 +1002,21 @@ documentation on :ref:`intl` for details.
|
||||
.. versionchanged:: 3.2
|
||||
Added ``{docpath}`` token.
|
||||
|
||||
.. confval:: translation_progress_classes
|
||||
|
||||
Control which, if any, classes are added to indicate translation progress.
|
||||
This setting would likely only be used by translators of documentation,
|
||||
in order to quickly indicate translated and untranslated content.
|
||||
|
||||
* ``True``: add ``translated`` and ``untranslated`` classes
|
||||
to all nodes with translatable content.
|
||||
* ``translated``: only add the ``translated`` class.
|
||||
* ``untranslated``: only add the ``untranslated`` class.
|
||||
* ``False``: do not add any classes to indicate translation progress.
|
||||
|
||||
Defaults to ``False``.
|
||||
|
||||
.. versionadded:: 7.1
|
||||
|
||||
.. _math-options:
|
||||
|
||||
|
||||
@@ -528,3 +528,9 @@ default. They are set in the build configuration file.
|
||||
Replaced by either today's date (the date on which the document is read), or
|
||||
the date set in the build configuration file. Normally has the format
|
||||
``April 14, 2007``. Set by :confval:`today_fmt` and :confval:`today`.
|
||||
|
||||
.. describe:: |translation progress|
|
||||
|
||||
Replaced by the translation progress of the document.
|
||||
This substitution is intented for use by document translators
|
||||
as a marker for the translation progress of the document.
|
||||
|
||||
Reference in New Issue
Block a user