2005-11-14 03:38:16 -05:00
|
|
|
# -*- python -*-
|
|
|
|
import os
|
|
|
|
import os.path
|
|
|
|
import glob
|
|
|
|
|
|
|
|
Import ('env gtkardour install_prefix intl_files')
|
|
|
|
|
|
|
|
potfiles_in = open('POTFILES.in', 'w')
|
|
|
|
|
|
|
|
intl_files.sort()
|
|
|
|
|
|
|
|
print "Generating POTFILES.in in gtk_ardour/po"
|
|
|
|
|
|
|
|
potfiles_in.write("""# This file was automatically generated by a configuration script.
|
|
|
|
# Contains a list of source files containing translatable
|
|
|
|
# strings sorted alphabetically.
|
|
|
|
[encoding: UTF-8]
|
|
|
|
""")
|
|
|
|
|
|
|
|
for f in intl_files[:]:
|
|
|
|
potfiles_in.write(f + '\n')
|
|
|
|
|
|
|
|
potfiles_in.close()
|
|
|
|
|
|
|
|
print "Updating pot file: "
|
|
|
|
|
|
|
|
domain = gtkardour['DOMAIN']
|
|
|
|
potfile = gtkardour['POTFILE']
|
|
|
|
|
|
|
|
poaction = Action('intltool-update -p -g=' + domain)
|
|
|
|
|
|
|
|
Execute(poaction)
|
|
|
|
|
|
|
|
# this should probably be merged with the i18n builder somehow
|
|
|
|
|
|
|
|
p_oze = [ os.path.basename (po) for po in glob.glob ('*.po') ]
|
|
|
|
languages = [ po.replace ('.po', '') for po in p_oze ]
|
|
|
|
m_oze = [ po.replace (".po", ".mo") for po in p_oze ]
|
|
|
|
|
|
|
|
for mo in m_oze[:]:
|
|
|
|
po = mo.replace (".mo", ".po")
|
|
|
|
env.Alias ('install', gtkardour.MoBuild (mo, [ po, potfile ]))
|
|
|
|
|
|
|
|
for lang in languages[:]:
|
|
|
|
modir = (os.path.join (install_prefix, 'share/locale/' + lang + '/LC_MESSAGES/'))
|
|
|
|
moname = domain + '.mo'
|
|
|
|
env.Alias('install', env.InstallAs (os.path.join (modir, moname), lang + '.mo'))
|
2006-01-09 23:25:47 -05:00
|
|
|
|
|
|
|
env.Alias ('tarball', env.Distribute (env['DISTTREE'],
|
2006-01-17 11:40:57 -05:00
|
|
|
[ 'SConscript', 'gtk_ardour.pot' ] +
|
2006-01-09 23:25:47 -05:00
|
|
|
glob.glob('*.po')))
|