From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 2 Feb 2025 16:18:50 +0000 (+0100) Subject: [3.12] gh-126609: Allow translating the ``availability`` directive (GH-129549) (... X-Git-Tag: v3.12.9~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14bd0fc19a9a2f007d736a92580c492b92ccd232;p=thirdparty%2FPython%2Fcpython.git [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 0612a89ffcf0bb52b1750a3466671ba8daad1d87) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/tools/extensions/availability.py b/Doc/tools/extensions/availability.py index 897af70a9f4b..225b3438b943 100644 --- a/Doc/tools/extensions/availability.py +++ b/Doc/tools/extensions/availability.py @@ -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 @@ -53,7 +54,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"]), diff --git a/Doc/tools/templates/dummy.html b/Doc/tools/templates/dummy.html index 49c2a71a5e40..4f0f6f91436a 100644 --- a/Doc/tools/templates/dummy.html +++ b/Doc/tools/templates/dummy.html @@ -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 %}