1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-08 06:25:37 -05:00

Update terms

This commit is contained in:
bbedward
2025-10-11 11:37:09 -04:00
parent 7870dff0fd
commit f4cf66dc01
4 changed files with 192 additions and 102 deletions

View File

@@ -8,7 +8,7 @@ from collections import defaultdict
def extract_qstr_strings(root_dir):
translations = defaultdict(list)
qstr_pattern = re.compile(r'qsTr\(["\']([^"\']+)["\']\)')
i18n_pattern = re.compile(r'I18n\.tr\(["\']([^"\']+)["\'],\s*["\']([^"\']+)["\']\)')
i18n_pattern = re.compile(r'I18n\.tr\(["\']([^"\']+)["\']\)')
for qml_file in Path(root_dir).rglob('*.qml'):
relative_path = qml_file.relative_to(root_dir)
@@ -24,8 +24,7 @@ def extract_qstr_strings(root_dir):
i18n_matches = i18n_pattern.findall(line)
for match in i18n_matches:
term = match[0]
translations[term].append({
translations[match].append({
'file': str(relative_path),
'line': line_num
})