mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
I18n: fix node socket extraction regexes
The node socket extraction regexes introduced in 6d39ba7b41 suffered
from two issues:
1. the contextless name extraction would also extract socket names
which did have a context. To solve, this, use a negative lookahead
at the end of the regex, containing ".translation_context(".
2. the number of characters in a message was limited to 1, because the
_str_base component would match one or more chars after the first
one, while it should have matched zero or more.
This last issues existed before, and the fix allows the extraction of
three new messages.
Pull Request: https://projects.blender.org/blender/blender/pulls/108052
This commit is contained in:
parent
b7a71d65f8
commit
e718f29ec3
1 changed files with 3 additions and 2 deletions
|
|
@ -206,7 +206,7 @@ _str_base = (
|
|||
r"(?:(?!<\\)(?:\\\\)*\\(?=(?P={_}2)))|"
|
||||
# The most common case.
|
||||
".(?!(?P={_}2))"
|
||||
")+.)" # Don't forget the last char!
|
||||
")*.)" # Don't forget the last char!
|
||||
"(?P={_}2)" # And closing quote.
|
||||
)
|
||||
str_clean_re = _str_base.format(_="g", capt="P<clean>")
|
||||
|
|
@ -257,7 +257,8 @@ PYGETTEXT_KEYWORDS = (() +
|
|||
for it in ("modifier_subpanel_register", "gpencil_modifier_subpanel_register")) +
|
||||
|
||||
# Node socket declarations: contextless names
|
||||
tuple((r"\.{}<decl::.*?>\(\s*" + _msg_re + r"(?:,[^),]+)*\s*\)").format(it)
|
||||
tuple((r"\.{}<decl::.*?>\(\s*" + _msg_re + r"(?:,[^),]+)*\s*\)"
|
||||
r"(?![^;]*\.translation_context\()").format(it)
|
||||
for it in ("add_input", "add_output")) +
|
||||
|
||||
# Node socket declarations: names with contexts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue