Skip to content

Commit 9d1a832

Browse files
[3.13] Standardize translation of Doc/bugs.rst (GH-137449) (GH-140282)
Standardize translation of `Doc/bugs.rst` (GH-137449) (cherry picked from commit 869bb69) Co-authored-by: Stan Ulbrych <[email protected]>
1 parent df86b18 commit 9d1a832

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

Doc/bugs.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ If you find a bug in this documentation or would like to propose an improvement,
1919
please submit a bug report on the :ref:`issue tracker <using-the-tracker>`. If you
2020
have a suggestion on how to fix it, include that as well.
2121

22+
.. only:: translation
23+
24+
If the bug or suggested improvement concerns the translation of this
25+
documentation, submit the report to the
26+
`translation’s repository <TRANSLATION_REPO_>`_ instead.
27+
2228
You can also open a discussion item on our
2329
`Documentation Discourse forum <https://discuss.python.org/c/documentation/26>`_.
2430

Doc/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,25 @@
445445
# https://github.com/sphinx-doc/sphinx/issues/12359
446446
epub_use_index = False
447447

448+
# translation tag
449+
# ---------------
450+
451+
language_code = None
452+
for arg in sys.argv:
453+
if arg.startswith('language='):
454+
language_code = arg.split('=', 1)[1]
455+
456+
if language_code:
457+
tags.add('translation') # noqa: F821
458+
459+
rst_epilog += f"""\
460+
.. _TRANSLATION_REPO: https://github.com/python/python-docs-{language_code.replace("_", "-").lower()}
461+
""" # noqa: F821
462+
else:
463+
rst_epilog += """\
464+
.. _TRANSLATION_REPO: https://github.com/python
465+
"""
466+
448467
# Options for the coverage checker
449468
# --------------------------------
450469

0 commit comments

Comments
 (0)