I18n message extractor script: py code: do not consider strings inside 'Compare' AST nodes.
Otherwise, we'd get 'MOVIE' from `text="Build Proxy / Timecode" if clip.source == 'MOVIE' else "Build Proxy")`...
This commit is contained in:
@@ -576,8 +576,9 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
|
|||||||
#print(func_translate_args)
|
#print(func_translate_args)
|
||||||
|
|
||||||
# Break recursive nodes look up on some kind of nodes.
|
# Break recursive nodes look up on some kind of nodes.
|
||||||
# E.g. we don’t want to get strings inside subscripts (blah["foo"])!
|
# E.g. we don't want to get strings inside subscripts (blah["foo"])!
|
||||||
stopper_nodes = {ast.Subscript}
|
# we don't want to get strings from comparisons (foo.type == 'BAR').
|
||||||
|
stopper_nodes = {ast.Subscript, ast.Compare}
|
||||||
# Consider strings separate: ("a" if test else "b")
|
# Consider strings separate: ("a" if test else "b")
|
||||||
separate_nodes = {ast.IfExp}
|
separate_nodes = {ast.IfExp}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user