From 61b0ff9e57151ec509b91bedabf32b38577702a7 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Sat, 5 Jul 2025 20:08:47 +0200 Subject: [PATCH] I18n: Extract node panel names using translation contexts Commit 9ce0a2d1d5 added the ability to specify translation contexts to node UI panels, but it failed to update the regex that extracts them. This commit solves that by adding the proper `add_panel` function to the extraction regex. Reported by Satoshi Yamasaki in #43295. --- scripts/modules/bl_i18n_utils/settings.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/modules/bl_i18n_utils/settings.py b/scripts/modules/bl_i18n_utils/settings.py index 9c1665aeda4..92ff288c25a 100644 --- a/scripts/modules/bl_i18n_utils/settings.py +++ b/scripts/modules/bl_i18n_utils/settings.py @@ -293,24 +293,20 @@ PYGETTEXT_KEYWORDS = (() + tuple((r"\.{}\(\s*" + _msg_re + r"\s*\)").format(it) for it in ("description", "error_message_add")) + - # Node socket labels from declarations: context-less names + # Node socket panels and labels from declarations: context-less names tuple((r"\.{}\(\s*" + _msg_re + r"\s*\)(?![^;]*\.translation_context\()[^;]*;").format(it) - for it in ("short_label",)) + + for it in ("short_label", "add_panel",)) + - # Node socket labels from declarations: names with contexts + # Node socket panels and labels from declarations: names with contexts tuple((r"\.{}\(\s*" + _msg_re + r"[^;]*\.translation_context\(\s*" + _ctxt_re + r"\s*\)").format(it) - for it in ("short_label",)) + + for it in ("short_label", "add_panel",)) + # Dynamic node socket labels tuple((r"{}\(\s*[^,]+,\s*" + _msg_re + r"\s*\)").format(it) for it in ("node_sock_label",)) + - # Node panel declarations - tuple((r"\.{}\(\s*" + _msg_re + r"\s*\)").format(it) - for it in ("add_panel",)) + - # Geometry Nodes field inputs ((r"FieldInput\(CPPType::get<.*?>\(\),\s*" + _msg_re + r"\s*\)"),) +