support for glade and new new session dialog
[ardour.git] / gtk2_ardour / po / SConscript
1 # -*- python -*-
2 import os
3 import os.path
4 import glob
5
6 Import ('env gtkardour install_prefix intl_files')
7
8 potfiles_in = open('POTFILES.in', 'w')
9
10 intl_files.sort()
11
12 print "Generating POTFILES.in in gtk_ardour/po"
13
14 potfiles_in.write("""# This file was automatically generated by a configuration script.
15 # Contains a list of source files containing translatable
16 # strings sorted alphabetically.
17 [encoding: UTF-8]
18 """)
19
20 for f in intl_files[:]:
21     potfiles_in.write(f + '\n')
22
23 potfiles_in.close()
24
25 print "Updating pot file: "
26
27 domain = gtkardour['DOMAIN']
28 potfile = gtkardour['POTFILE']
29
30 poaction = Action('intltool-update -p -g=' + domain)
31
32 Execute(poaction)
33
34 # this should probably be merged with the i18n builder somehow
35
36 p_oze = [ os.path.basename (po) for po in glob.glob ('*.po') ]
37 languages = [ po.replace ('.po', '') for po in p_oze ]
38 m_oze = [ po.replace (".po", ".mo") for po in p_oze ]
39     
40 for mo in m_oze[:]:
41     po = mo.replace (".mo", ".po")
42     env.Alias ('install', gtkardour.MoBuild (mo, [ po, potfile ]))
43         
44 for lang in languages[:]:
45     modir = (os.path.join (install_prefix, 'share/locale/' + lang + '/LC_MESSAGES/'))
46     moname = domain + '.mo'
47     env.Alias('install', env.InstallAs (os.path.join (modir, moname), lang + '.mo'))