]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-126609: Allow translating the ``availability`` directive (#129549)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Sun, 2 Feb 2025 16:12:01 +0000 (16:12 +0000)
committerGitHub <noreply@github.com>
Sun, 2 Feb 2025 16:12:01 +0000 (16:12 +0000)
Doc/tools/extensions/availability.py
Doc/tools/templates/dummy.html

index 47833fdcb87590c2ff93c54b3f3d9ebc7ee1efac..1a2c7b02b444393a18c61bfffe51683558163c48 100644 (file)
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING
 
 from docutils import nodes
 from sphinx import addnodes
+from sphinx.locale import _ as sphinx_gettext
 from sphinx.util import logging
 from sphinx.util.docutils import SphinxDirective
 
@@ -55,7 +56,7 @@ class Availability(SphinxDirective):
     final_argument_whitespace = True
 
     def run(self) -> list[nodes.container]:
-        title = "Availability"
+        title = sphinx_gettext("Availability")
         refnode = addnodes.pending_xref(
             title,
             nodes.inline(title, title, classes=["xref", "std", "std-ref"]),
index 49c2a71a5e40cfa2cafdef07ff345cb38adee707..4f0f6f91436a8732932fdcb15e69041cbd1dbece 100644 (file)
@@ -7,6 +7,10 @@ In extensions/pyspecific.py:
 {% trans %}Deprecated since version {deprecated}, will be removed in version {removed}{% endtrans %}
 {% trans %}Deprecated since version {deprecated}, removed in version {removed}{% endtrans %}
 
+In extensions/availability.py:
+
+{% trans %}Availability{% endtrans %}
+
 In extensions/c_annotations.py:
 
 {% trans %}Part of the{% endtrans %}