From de0ce29372d71d5e958270accd356ed9cb54e5cd Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 19 Jun 2022 17:33:22 +0900 Subject: [PATCH] Fix #10579: i18n: UnboundLocalError is raised on translating raw directive --- CHANGES | 1 + sphinx/transforms/i18n.py | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index eda02faa1c..8dc2dae29f 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,7 @@ Bugs fixed * #10520: HTML Theme: Fix use of sidebar classes in ``agogo.css_t``. * #6679: HTML Theme: Fix inclusion of hidden toctrees in the agogo theme. * #10566: HTML Theme: Fix enable_search_shortcuts does not work +* #10579: i18n: UnboundLocalError is raised on translating raw directive Testing -------- diff --git a/sphinx/transforms/i18n.py b/sphinx/transforms/i18n.py index 65534727e5..160c7f35d2 100644 --- a/sphinx/transforms/i18n.py +++ b/sphinx/transforms/i18n.py @@ -238,6 +238,7 @@ def apply(self, **kwargs: Any) -> None: continue # skip if the node is already translated by phase1 msgstr = catalog.gettext(msg) + noqa = False # See above. if not isinstance(node, LITERAL_TYPE_NODES):