summaryrefslogtreecommitdiff
path: root/i18n.py
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-02-22 23:36:32 +0000
committerCarl Hetherington <cth@carlh.net>2013-02-22 23:36:32 +0000
commitbc5df5cc9c2b11524938281f1b2043b185373020 (patch)
tree3a56dc58b1da2483182645da3a392eb186b6c1b3 /i18n.py
parent62365221dd3cd80d6b771e9bf22b4f9365ee096a (diff)
Some i18n stuff.
Diffstat (limited to 'i18n.py')
-rw-r--r--i18n.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/i18n.py b/i18n.py
new file mode 100644
index 000000000..d5531834b
--- /dev/null
+++ b/i18n.py
@@ -0,0 +1,16 @@
+import glob
+import os
+from waflib import Logs
+
+def po_to_mo(dir, name):
+ for f in glob.glob(os.path.join(dir, 'po', '*.po')):
+
+ lang = os.path.basename(f).replace('.po', '')
+ out = os.path.join('build', dir, 'mo', lang, '%s.mo' % name)
+ try:
+ os.makedirs(os.path.dirname(out))
+ except:
+ pass
+
+ os.system('msgfmt %s -o %s' % (f, out))
+ Logs.info('%s -> %s' % (f, out))