File: make_mo_files.py

package info (click to toggle)
svn-workbench 1.6.2-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,936 kB
  • sloc: python: 14,970; sh: 87; makefile: 48; ansic: 9
file content (27 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/python
import sys
import os

localedir = sys.argv[1]

all_lang = ['en', 'de']

for lang in all_lang:
    mo_output_dir = '%s/%s/LC_MESSAGES' % (localedir, lang)
    os.makedirs( mo_output_dir )

    if lang == 'en':
        po_file = 'I18N/pysvn_workbench_en.current.po'
    else:
        po_file = 'I18N/pysvn_workbench_%s.po' % lang

    rc = os.system( 'msgfmt '
        '%s '
        '--check-format '
        '--output-file=%s/pysvn_workbench.mo' %
            (po_file, mo_output_dir) )
    if rc != 0:
        sys.exit( rc )

    print 'Info: %s/pysvn_workbench.mo' % mo_output_dir
sys.exit( 0 )