From f13d2750765fdd42e579427681da844e54a12f8e Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 6 Feb 2022 00:11:38 +0100 Subject: [PATCH] sandbox/update_pot.py: Run msgmerge as well --- sandbox/update_pot.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sandbox/update_pot.py b/sandbox/update_pot.py index 8f78a41be..a8722dad5 100644 --- a/sandbox/update_pot.py +++ b/sandbox/update_pot.py @@ -10,5 +10,12 @@ for plugin_path in pathlib.Path("plugins/").iterdir(): continue subprocess.run(["pygettext3", "-D", "config.py", "plugin.py"], cwd=plugin_path) + for po_path in plugin_path.glob("locales/*.po"): + subprocess.run(["msgmerge", "--quiet", "--update", po_path, plugin_path / "messages.pot"], stdout=subprocess.DEVNULL) + core_files = pathlib.Path("src/").glob("**/*.py") subprocess.run(["pygettext3", "-p", "locales/", *core_files]) + +pot_path = pathlib.Path("locales/messages.pot") +for po_path in pathlib.Path("").glob("locales/*.po"): + subprocess.run(["msgmerge", "--quiet", "--update", po_path, pot_path], stdout=subprocess.DEVNULL)