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')):
import os
+import i18n
sources = """
ab_transcode_job.cc
obj.target = 'dvdomatic'
def pot(bld):
- s = ""
- for f in sources.split('\n'):
- t = f.strip()
- if len(t) > 0:
- s += (os.path.join('src', 'lib', t)) + " "
-
- os.system('xgettext -d libdvdomatic -s --keyword=_ -p build/src/lib -o libdvdomatic.pot %s' % s)
+ i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic')
obj.target = t
def pot(bld):
- os.system('xgettext -d dvdomatic -s --keyword=_ -p build/src/tools -o dvdomatic.pot %s' % os.path.join('src', 'tools', 'dvdomatic.cc'))
+ i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic')
def mo(bld):
i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic')
obj.target = 'dvdomatic-wx'
def pot(bld):
- s = ""
- for f in sources.split('\n'):
- t = f.strip()
- if len(t) > 0:
- s += (os.path.join('src', 'wx', t)) + " "
-
- os.system('xgettext -d libdvdomatic-wx -s --keyword=_ -p build/src/wx -o libdvdomatic-wx.pot %s' % s)
+ i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx')
def mo(bld):
i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx')