]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Standardize translation of `Doc/bugs.rst` (GH-137449)
authorStan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Fri, 17 Oct 2025 06:55:12 +0000 (07:55 +0100)
committerGitHub <noreply@github.com>
Fri, 17 Oct 2025 06:55:12 +0000 (08:55 +0200)
Doc/bugs.rst
Doc/conf.py

index faf13eeb6a7ce4f1313cfa2ccc1603a1193ffc95..0683eebbaf677be136336ec4bcfb5b963598b1ae 100644 (file)
@@ -19,6 +19,12 @@ If you find a bug in this documentation or would like to propose an improvement,
 please submit a bug report on the :ref:`issue tracker <using-the-tracker>`.  If you
 have a suggestion on how to fix it, include that as well.
 
+.. only:: translation
+
+   If the bug or suggested improvement concerns the translation of this
+   documentation, submit the report to the
+   `translation’s repository <TRANSLATION_REPO_>`_ instead.
+
 You can also open a discussion item on our
 `Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.
 
index c1b07df08b1782ed2e002725fe8ec2cba2f7c798..a8e376c0ae44fe6dae8a802e6c3f05041ae80183 100644 (file)
@@ -444,6 +444,25 @@ epub_exclude_files = ('index.xhtml', 'download.xhtml')
 # https://github.com/sphinx-doc/sphinx/issues/12359
 epub_use_index = False
 
+# translation tag
+# ---------------
+
+language_code = None
+for arg in sys.argv:
+    if arg.startswith('language='):
+        language_code = arg.split('=', 1)[1]
+
+if language_code:
+    tags.add('translation')  # noqa: F821
+
+    rst_epilog += f"""\
+.. _TRANSLATION_REPO: https://github.com/python/python-docs-{language_code.replace("_", "-").lower()}
+"""  # noqa: F821
+else:
+    rst_epilog += """\
+.. _TRANSLATION_REPO: https://github.com/python
+"""
+
 # Options for the coverage checker
 # --------------------------------