summaryrefslogtreecommitdiff
path: root/editor/translations/extract.py
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-03-30 18:21:46 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-03-30 18:21:46 +0800
commit0a9f97f4231dcfdfa58ecf501aedc54b9c7fbcfd (patch)
tree02c721dbe397ad88ac7f425f5fc4e89f37786e79 /editor/translations/extract.py
parent60f8df380df7ddc5dde4de4384b488e8a342ce79 (diff)
Add more patterns for property path extraction
Diffstat (limited to 'editor/translations/extract.py')
-rwxr-xr-xeditor/translations/extract.py7
1 files changed, 6 insertions, 1 deletions
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,15 +113,20 @@ 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)?\("(?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(
+ r'EDITOR_SETTING(_USAGE)?\(Variant::[_A-Z0-9]+, [_A-Z0-9]+, "(?P<message>[^"]+?)",'
+ ): ExtractType.PROPERTY_PATH,
+ re.compile(
r'(ADD_PROPERTYI?|ImportOption|ExportOption)\(PropertyInfo\(Variant::[_A-Z0-9]+, "(?P<message>[^"]+?)"[,)]'
): ExtractType.PROPERTY_PATH,
re.compile(
r"(?!#define )LIMPL_PROPERTY(_RANGE)?\(Variant::[_A-Z0-9]+, (?P<message>[^,]+?),"
): ExtractType.PROPERTY_PATH,
re.compile(r'ADD_GROUP\("(?P<message>[^"]+?)", "(?P<prefix>[^"]*?)"\)'): ExtractType.GROUP,
+ re.compile(r'#define WRTC_\w+ "(?P<message>[^"]+?)"'): ExtractType.PROPERTY_PATH,
}