summaryrefslogtreecommitdiff
path: root/i18n.py
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-20 10:41:25 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-20 10:41:25 +0000
commitbacdb2fee1a921060ad40e2db14c4e787ae188a9 (patch)
tree7df6ab34f30d0d30931a44d868b757a7775602de /i18n.py
parentb19e695723dc7f3a34b655414cad1a80f95b55b7 (diff)
Target pot_merge to merge new .pot files with existing .po; update translations accordingly.
Diffstat (limited to 'i18n.py')
-rw-r--r--i18n.py11
1 files changed, 9 insertions, 2 deletions
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')):