diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-03-29 19:21:28 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2022-03-30 20:29:43 +0800 |
commit | 39245c82163274829f44aabc1d3e570c87fa57cf (patch) | |
tree | 5797b1e919980e9d878505d82f705278c632c3b3 /editor | |
parent | 432859de7a53a6588de298b97d2b24a35b8001d7 (diff) |
Strip feature tag manually when extracting property paths
Diffstat (limited to 'editor')
-rwxr-xr-x | editor/translations/extract.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/translations/extract.py b/editor/translations/extract.py index eaaec21788..cb918c0092 100755 --- a/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -113,7 +113,7 @@ message_patterns = { r'RTRN\("(?P<message>([^"\\]|\\.)*)", "(?P<plural_message>([^"\\]|\\.)*)",[^,)]+?(, "(?P<context>([^"\\]|\\.)*)")?\)' ): ExtractType.TEXT, re.compile(r'_initial_set\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, - re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?(_BASIC)?\("(?P<message>[^".]+?)",'): ExtractType.PROPERTY_PATH, + re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?(_BASIC)?\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, re.compile(r'GLOBAL_DEF_BASIC\(vformat\("(?P<message>layer_names/\w+)/layer_%d"'): ExtractType.PROPERTY_PATH, re.compile(r'EDITOR_DEF(_RST)?\("(?P<message>[^"]+?)",'): ExtractType.PROPERTY_PATH, re.compile( @@ -236,6 +236,8 @@ def process_file(f, fname): msg = msg[len(current_group) :] else: current_group = "" + if "." in msg: # Strip feature tag. + msg = msg.split(".", 1)[0] for part in msg.split("/"): _add_message(_process_editor_string(part), msg_plural, msgctx, location, translator_comment) elif extract_type == ExtractType.GROUP: |