aboutsummaryrefslogtreecommitdiff
path: root/packages/darwin_app/embed-languages-in-info-list.py
blob: 5f9acbdc1845c78cd992abd958c7e60505f2c697 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python

import sys
import re

f = open(sys.argv[1], 'r')
for line in f.readlines():
    if re.match('^ALL_LINGUAS = (.*)', line):
        for po in line.split('=')[1].strip().rstrip().split(' '):
            s = po.split('_')
            if len(s) == 2:
                iso = s[0] + '_' + s[1].upper()
            else:
                iso = po
            print '<string>' + iso + '</string>',