os.system('xgettext -d %s -s --keyword=_ --add-comments=/ -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')):
-
+def po_to_mo(dir, name, bld):
+ for f in glob.glob(os.path.join(os.getcwd(), 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
+ po = os.path.join('po', '%s.po' % lang)
+ mo = os.path.join('mo', lang, '%s.mo' % name)
- os.system('msgfmt %s -o %s' % (f, out))
- Logs.info('%s -> %s' % (f, out))
+ bld(rule = 'msgfmt ${SRC} -o ${TGT}', source = bld.path.make_node(po), target = bld.path.get_bld().make_node(mo))
+ bld.install_files(os.path.join('${PREFIX}', 'share', 'locale', lang, 'LC_MESSAGES'), mo)
obj.source = sources
obj.target = 'dvdomatic'
+ i18n.po_to_mo(os.path.join('src', 'lib'), 'libdvdomatic', bld)
+
def pot(bld):
i18n.pot(os.path.join('src', 'lib'), sources, 'libdvdomatic')
obj.source += ' ../../windows/dvdomatic.rc'
obj.target = t
+ i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic', bld)
+
def pot(bld):
i18n.pot(os.path.join('src', 'tools'), 'dvdomatic.cc', 'dvdomatic')
-
-def mo(bld):
- i18n.po_to_mo(os.path.join('src', 'tools'), 'dvdomatic')
-
bld.recurse('lib')
bld.recurse('wx')
bld.recurse('tools')
-
-def mo(bld):
- bld.recurse('wx')
- bld.recurse('tools')
obj.source = sources
obj.target = 'dvdomatic-wx'
+ i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx', bld)
+
def pot(bld):
i18n.pot(os.path.join('src', 'wx'), sources, 'libdvdomatic-wx')
-
-def mo(bld):
- i18n.po_to_mo(os.path.join('src', 'wx'), 'libdvdomatic-wx')
-
conf.env.append_value('CXXFLAGS', ['-D__STDC_CONSTANT_MACROS', '-msse', '-mfpmath=sse', '-ffast-math', '-fno-strict-aliasing',
'-Wall', '-Wno-attributes', '-Wextra',
- '-DLOCALE_DIR="%s/share/locale"' % conf.env.prefix])
+ '-DLOCALE_DIR="%s/share/locale"' % conf.env['PREFIX']])
if conf.options.target_windows:
conf.env.append_value('CXXFLAGS', ['-DDVDOMATIC_WINDOWS', '-DWIN32_LEAN_AND_MEAN', '-DBOOST_USE_WINDOWS_H', '-DUNICODE'])
def pot(bld):
bld.recurse('src')
-
-def mo(bld):
- bld.recurse('src')