]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-121970: Fix ``gettext`` for audit events (#122651)
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>
Sat, 3 Aug 2024 16:41:26 +0000 (17:41 +0100)
committerGitHub <noreply@github.com>
Sat, 3 Aug 2024 16:41:26 +0000 (17:41 +0100)
Doc/tools/extensions/audit_events.py

index d0f08522d21ea2cc92cc6dfb9efdfe00b04c4511..23d82c0f4414bff9fbee69484138bcba2cea52c5 100644 (file)
@@ -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