Try to centralise .pot building.
[dcpomatic.git] / i18n.py
diff --git a/i18n.py b/i18n.py
index d5531834b29c34b00686314cd5b2c0ccc7a897ba..10eaa38e900578536d92bded978853d8efb6be58 100644 (file)
--- a/i18n.py
+++ b/i18n.py
@@ -2,6 +2,17 @@ import glob
 import os
 from waflib import Logs
 
+def pot(dir, sources, name):
+    s = ""
+    for f in sources.split('\n'):
+        t = f.strip()
+        if len(t) > 0:
+            s += (os.path.join(dir, t)) + " "
+
+    Logs.info('Making %s.pot' % os.path.join('build', dir, name))
+    os.system('xgettext -d %s -s --keyword=_ -p %s -o %s.pot %s' % (name, os.path.join('build', dir), name, s))
+    
+
 def po_to_mo(dir, name):
     for f in glob.glob(os.path.join(dir, 'po', '*.po')):