From 93d2ced31f9e23491ce010161475956b795a6235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 5 Oct 2017 00:12:30 +0200 Subject: Create the .po file with the `update_po` subcommand if it doesn't exist --- mesonbuild/scripts/gettext.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mesonbuild/scripts/gettext.py b/mesonbuild/scripts/gettext.py index ef4f42a..30ac54c 100644 --- a/mesonbuild/scripts/gettext.py +++ b/mesonbuild/scripts/gettext.py @@ -70,7 +70,10 @@ def update_po(src_sub, pkgname, langs): potfile = os.path.join(src_sub, pkgname + '.pot') for l in langs: pofile = os.path.join(src_sub, l + '.po') - subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile]) + if os.path.exists(pofile): + subprocess.check_call(['msgmerge', '-q', '-o', pofile, pofile, potfile]) + else: + subprocess.check_call(['msginit', '--input', potfile, '--output-file', pofile, '--locale', l, '--no-translator']) return 0 def do_install(src_sub, bld_sub, dest, pkgname, langs): -- cgit v1.1