GH-121970: Fix ``gettext`` for audit events (#122651)

This commit is contained in:
Adam Turner 2024-08-03 17:41:26 +01:00 committed by GitHub
parent 1573d90ce1
commit 95f5c89b54
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