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.
This commit is contained in:
committed by
Bastien Montagne
parent
14957fe2ac
commit
61b0ff9e57
@@ -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*\)"),) +
|
||||
|
||||
|
||||
Reference in New Issue
Block a user