Add i18n/l10n for jack_mix_box and jack_mixer C library
[jack_mixer.git] / tools / merge-messages.py
blob6ff2c47d28a6aaa39663b05a0a8cfd94959a373c
1 #!/usr/bin/env python3
2 """Merge new/updated messages from jack_mixer.pot into existing translations with msgmerge."""
4 import glob
5 import os
6 from os.path import basename, join, splitext
7 from subprocess import run
9 LOCALEDIR = join(os.getcwd(), "data", "locale")
11 for po in glob.glob(join(LOCALEDIR, "*.po")):
12 fn = basename(po)
13 domain, lang = splitext(fn)[0].rsplit("-", 1)
14 pot = join(LOCALEDIR, domain + ".pot")
15 print(f"Merging new/updated messages from {pot} into {po} ...")
16 run(["msgmerge", "-U", po, pot])