[3.13] GH-121970: Fix ``gettext`` for audit events (GH-122651) (#122653)

GH-121970: Fix ``gettext`` for audit events (GH-122651)
(cherry picked from commit 95f5c89b54)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-09-02 12:48:20 +02:00 committed by GitHub
parent 57ba3b0c6e
commit 4210a7d02b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View 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