rationalize destruction pathway (some more); tidy-ify some ImageFrame code
[ardour.git] / w18n.py
1 #!/usr/bin/env python
2
3 import autowaf
4 import os
5 import glob
6
7 def build_i18n(bld,dir,name,sources):
8         pwd = bld.get_curdir()
9         os.chdir(pwd)
10
11         pot_file = '%s.pot' % name
12
13         args = [ 'xgettext',
14                  '--keyword=_',
15                  '--keyword=N_',
16                  '--from-code=UTF-8',
17                  '-o', pot_file,
18                  '--copyright-holder="Paul Davis"' ]
19         args += sources
20         print 'Updating ', pot_file
21         os.spawnvp (os.P_WAIT, 'xgettext', args)
22         
23         po_files = glob.glob ('po/*.po')
24         
25         for po_file in po_files:
26                 args = [ 'msgmerge',
27                          '--update',
28                          po_file,
29                          pot_file ]
30                 print 'Updating ', po_file
31                 os.spawnvp (os.P_WAIT, 'msgmerge', args)
32                 
33         for po_file in po_files:
34                 mo_file = po_file.replace ('.po', '.mo')
35                 args = [ 'msgfmt',
36                          '-c',
37                          '-o',
38                          mo_file,
39                          po_file ]
40                 print 'Generating ', po_file
41                 os.spawnvp (os.P_WAIT, 'msgfmt', args)