other: Improve finding translatable files

This commit is contained in:
Philipp Hörist
2025-02-08 22:36:19 +01:00
parent 9cd4a64419
commit 8a4aacf27a

View File

@@ -13,6 +13,19 @@ TRANSLATABLE_FILES = [
"*.py",
"*.ui",
]
PLUGIN_DIRS = [
"acronyms_expander",
"anti_spam",
"clients_icons",
"length_notifier",
"message_box_size",
"now_listen",
"openpgp",
"pgp",
"plugins_translations",
"quick_replies",
"triggers",
]
def template_is_equal(old_template_path: Path, new_template: str) -> bool:
@@ -30,7 +43,9 @@ def template_is_equal(old_template_path: Path, new_template: str) -> bool:
def update_translation_template() -> bool:
paths: list[Path] = []
for file_path in TRANSLATABLE_FILES:
paths += list(REPO_DIR.rglob(file_path))
for plugin_dir in PLUGIN_DIRS:
plugin_path = REPO_DIR / plugin_dir
paths += list(plugin_path.rglob(file_path))
cmd = [
"xgettext",