X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=i18n.py;h=935bc3461b8792b665af79f8cb143997d2a77794;hp=ce28d25e99d1e6d359132a8fcba6ebeabbf1a78a;hb=c22f6ffdbf11ac7405e6f59c00fac3f5adc6c51a;hpb=bacdb2fee1a921060ad40e2db14c4e787ae188a9 diff --git a/i18n.py b/i18n.py index ce28d25e9..935bc3461 100644 --- a/i18n.py +++ b/i18n.py @@ -3,12 +3,12 @@ import os from waflib import Logs def command(c): - print c + print(c) os.system(c) def pot(dir, sources, name): s = "" - for f in sources.split('\n'): + for f in sources.split(): t = f.strip() if len(t) > 0: s += (os.path.join(dir, t)) + " " @@ -20,7 +20,7 @@ def pot(dir, sources, name): except: pass - command('xgettext -d %s -s --keyword=_ --add-comments=/ -p %s -o %s.pot %s' % (name, d, name, s)) + command('xgettext -d %s -s --keyword=_ --keyword=S_ --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')): @@ -32,5 +32,5 @@ def po_to_mo(dir, name, bld): po = os.path.join('po', '%s.po' % lang) mo = os.path.join('mo', lang, '%s.mo' % name) - bld(rule = 'msgfmt ${SRC} -o ${TGT}', source = bld.path.make_node(po), target = bld.path.get_bld().make_node(mo)) + bld(rule='msgfmt -c ${SRC} -o ${TGT}', source=bld.path.make_node(po), target=bld.path.get_bld().make_node(mo)) bld.install_files(os.path.join('${PREFIX}', 'share', 'locale', lang, 'LC_MESSAGES'), mo)