X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=i18n.py;h=ce28d25e99d1e6d359132a8fcba6ebeabbf1a78a;hb=2f2a08ec7d5114a479b3ce180a645c3ccb6e0ff6;hp=8e2fd6404e5d4d031c92fc31f72727b1ba95fad0;hpb=011572ec64f344779d06e0a149dd8e3823f79885;p=dcpomatic.git diff --git a/i18n.py b/i18n.py index 8e2fd6404..ce28d25e9 100644 --- a/i18n.py +++ b/i18n.py @@ -2,6 +2,10 @@ import glob import os from waflib import Logs +def command(c): + print c + os.system(c) + def pot(dir, sources, name): s = "" for f in sources.split('\n'): @@ -16,8 +20,11 @@ def pot(dir, sources, name): except: pass - os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s)) - + command('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s)) + +def pot_merge(dir, name): + for f in glob.glob(os.path.join(os.getcwd(), dir, 'po', '*.po')): + command('msgmerge %s %s.pot -o %s' % (f, os.path.join('build', dir, name), f)) def po_to_mo(dir, name, bld): for f in glob.glob(os.path.join(os.getcwd(), dir, 'po', '*.po')):