-def po_to_mo(dir, name):
- for f in glob.glob(os.path.join(dir, 'po', '*.po')):
-
+def command(c):
+ print(c)
+ os.system(c)
+
+def pot(dir, sources, name):
+ s = ""
+ for f in sources.split():
+ t = f.strip()
+ if len(t) > 0:
+ s += (os.path.join(dir, t)) + " "
+
+ Logs.info('Making %s.pot' % os.path.join('build', dir, name))
+ d = os.path.join('build', dir)
+ try:
+ os.makedirs(d)
+ except:
+ pass
+
+ command('xgettext --from-code=UTF-8 -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')):
+ 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')):