diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-25 22:17:49 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-05-25 22:17:49 +0300 |
commit | e092a58fb53ce1dbf5387af1690f08be7bf7a5a6 (patch) | |
tree | d6cd94a29593c205f1ac45d485ebae173dc2841a /release/scripts/modules/bl_i18n_utils/bl_extract_messages.py | |
parent | 5e66827029b8964fa969dc033df8dbece89cdf2e (diff) |
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")`...
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils/bl_extract_messages.py')
-rw-r--r-- | release/scripts/modules/bl_i18n_utils/bl_extract_messages.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py index c3b2ae9908b..527bb714a22 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py +++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py @@ -576,8 +576,9 @@ def dump_py_messages_from_files(msgs, reports, files, settings): #print(func_translate_args) # Break recursive nodes look up on some kind of nodes. - # E.g. we don’t want to get strings inside subscripts (blah["foo"])! - stopper_nodes = {ast.Subscript} + # E.g. we don't want to get strings inside subscripts (blah["foo"])! + # 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") separate_nodes = {ast.IfExp} |