Skip to content

Commit 9862800

Browse files
[3.13] gh-126609: Allow translating the availability directive (GH-129549) (#129584)
gh-126609: Allow translating the ``availability`` directive (GH-129549) (cherry picked from commit 0612a89) Co-authored-by: Adam Turner <[email protected]>
1 parent b13b76f commit 9862800

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/tools/extensions/availability.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from docutils import nodes
88
from sphinx import addnodes
9+
from sphinx.locale import _ as sphinx_gettext
910
from sphinx.util import logging
1011
from sphinx.util.docutils import SphinxDirective
1112

@@ -55,7 +56,7 @@ class Availability(SphinxDirective):
5556
final_argument_whitespace = True
5657

5758
def run(self) -> list[nodes.container]:
58-
title = "Availability"
59+
title = sphinx_gettext("Availability")
5960
refnode = addnodes.pending_xref(
6061
title,
6162
nodes.inline(title, title, classes=["xref", "std", "std-ref"]),

Doc/tools/templates/dummy.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
{% trans %}Deprecated since version {deprecated}, will be removed in version {removed}{% endtrans %}
88
{% trans %}Deprecated since version {deprecated}, removed in version {removed}{% endtrans %}
99

10+
In extensions/availability.py:
11+
12+
{% trans %}Availability{% endtrans %}
13+
1014
In extensions/c_annotations.py:
1115

1216
{% trans %}Part of the{% endtrans %}

0 commit comments

Comments
 (0)