Create the .po file with the `update_po` subcommand if it doesn't exist
@@ -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')
+ 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):
