diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-03-20 10:41:25 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-03-20 10:41:25 +0000 |
| commit | bacdb2fee1a921060ad40e2db14c4e787ae188a9 (patch) | |
| tree | 7df6ab34f30d0d30931a44d868b757a7775602de /i18n.py | |
| parent | b19e695723dc7f3a34b655414cad1a80f95b55b7 (diff) | |
Target pot_merge to merge new .pot files with existing .po; update translations accordingly.
Diffstat (limited to 'i18n.py')
| -rw-r--r-- | i18n.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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')): |
