Skip to content

Commit

Permalink
gh-126609: Allow translating the availability directive (#129549)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Feb 2, 2025
1 parent 4e38eea commit 0612a89
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Doc/tools/extensions/availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

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

Expand Down Expand Up @@ -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"]),
Expand Down
4 changes: 4 additions & 0 deletions Doc/tools/templates/dummy.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
{% 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 %}
Expand Down

0 comments on commit 0612a89

Please sign in to comment.