From 0a9f97f4231dcfdfa58ecf501aedc54b9c7fbcfd Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 30 Mar 2022 18:21:46 +0800 Subject: Add more patterns for property path extraction --- editor/translations/extract.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'editor/translations/extract.py') diff --git a/editor/translations/extract.py b/editor/translations/extract.py index 4a7e87e271..eaaec21788 100755 --- a/editor/translations/extract.py +++ b/editor/translations/extract.py @@ -113,8 +113,12 @@ message_patterns = { r'RTRN\("(?P([^"\\]|\\.)*)", "(?P([^"\\]|\\.)*)",[^,)]+?(, "(?P([^"\\]|\\.)*)")?\)' ): ExtractType.TEXT, re.compile(r'_initial_set\("(?P[^"]+?)",'): ExtractType.PROPERTY_PATH, - re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?\("(?P[^".]+?)",'): ExtractType.PROPERTY_PATH, + re.compile(r'GLOBAL_DEF(_RST)?(_NOVAL)?(_BASIC)?\("(?P[^".]+?)",'): ExtractType.PROPERTY_PATH, + re.compile(r'GLOBAL_DEF_BASIC\(vformat\("(?Player_names/\w+)/layer_%d"'): ExtractType.PROPERTY_PATH, re.compile(r'EDITOR_DEF(_RST)?\("(?P[^"]+?)",'): ExtractType.PROPERTY_PATH, + re.compile( + r'EDITOR_SETTING(_USAGE)?\(Variant::[_A-Z0-9]+, [_A-Z0-9]+, "(?P[^"]+?)",' + ): ExtractType.PROPERTY_PATH, re.compile( r'(ADD_PROPERTYI?|ImportOption|ExportOption)\(PropertyInfo\(Variant::[_A-Z0-9]+, "(?P[^"]+?)"[,)]' ): ExtractType.PROPERTY_PATH, @@ -122,6 +126,7 @@ message_patterns = { r"(?!#define )LIMPL_PROPERTY(_RANGE)?\(Variant::[_A-Z0-9]+, (?P[^,]+?)," ): ExtractType.PROPERTY_PATH, re.compile(r'ADD_GROUP\("(?P[^"]+?)", "(?P[^"]*?)"\)'): ExtractType.GROUP, + re.compile(r'#define WRTC_\w+ "(?P[^"]+?)"'): ExtractType.PROPERTY_PATH, } -- cgit v1.2.3