Skip to content

Commit 14bd0fc

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

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Doc/tools/extensions/availability.py

+2-1
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

@@ -53,7 +54,7 @@ class Availability(SphinxDirective):
5354
final_argument_whitespace = True
5455

5556
def run(self) -> list[nodes.container]:
56-
title = "Availability"
57+
title = sphinx_gettext("Availability")
5758
refnode = addnodes.pending_xref(
5859
title,
5960
nodes.inline(title, title, classes=["xref", "std", "std-ref"]),

Doc/tools/templates/dummy.html

+4
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)