Create the .po file with the `update_po` subcommand if it doesn't exist

pull/2449/head
Corentin Noël 7 years ago committed by Jussi Pakkanen
parent 7b36897ff9
commit 93d2ced31f
  1. 5
      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):

Loading…
Cancel
Save