From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:47:43 +0000 (+0200) Subject: [3.12] GH-121970: Fix ``gettext`` for audit events (GH-122651) (#122654) X-Git-Tag: v3.12.5~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f1b385ad665209b61a14db66d10dd80deff2bee;p=thirdparty%2FPython%2Fcpython.git [3.12] GH-121970: Fix ``gettext`` for audit events (GH-122651) (#122654) GH-121970: Fix ``gettext`` for audit events (GH-122651) (cherry picked from commit 95f5c89b545beaafad73f05a695742da3e90bc41) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/tools/extensions/audit_events.py b/Doc/tools/extensions/audit_events.py index d0f08522d21e..23d82c0f4414 100644 --- a/Doc/tools/extensions/audit_events.py +++ b/Doc/tools/extensions/audit_events.py @@ -149,6 +149,7 @@ class AuditEvent(SphinxDirective): node = nodes.paragraph("", classes=["audit-hook"], ids=ids) self.set_source_info(node) if self.content: + node.rawsource = '\n'.join(self.content) # for gettext self.state.nested_parse(self.content, self.content_offset, node) else: num_args = min(2, len(args)) @@ -156,6 +157,7 @@ class AuditEvent(SphinxDirective): name=f"``{name}``", args=", ".join(f"``{a}``" for a in args), ) + node.rawsource = text # for gettext parsed, messages = self.state.inline_text(text, self.lineno) node += parsed node += messages