File: make_mo_files.py

package info (click to toggle)
svn-workbench 1.6.8-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,172 kB
  • ctags: 2,147
  • sloc: python: 15,925; sh: 108; makefile: 15; ansic: 9
file content (27 lines) | stat: -rw-r--r-- 620 bytes parent folder | download | duplicates (3)
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', 'hu']

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 )