2150 |
mathias |
1 |
echo "["
|
|
|
2 |
for lang in $(ls [a-z][a-z].xml |sed s/.xml//)
|
|
|
3 |
do
|
|
|
4 |
echo '{ type: "language", iso: "'${lang}'",'
|
|
|
5 |
|
|
|
6 |
# countries that use this language
|
|
|
7 |
echo 'countries: ['
|
|
|
8 |
ls ${lang}_[A-Z][A-Z].xml | sed -e 's/^.*_/{_reference: "/' -e 's/.xml/"},/'
|
|
|
9 |
echo '],'
|
|
|
10 |
|
|
|
11 |
# name of this language (in this language)
|
|
|
12 |
grep '<language type="'${lang}'"[ >]' ${lang}.xml |head -1 |sed -e 's/.*<language type=".."[^>]*>/name: "/' -e 's/<\/language>/",/'
|
|
|
13 |
|
|
|
14 |
# names of other langauges (in this language)
|
|
|
15 |
grep '<language type="..">' ${lang}.xml |sed -e 's/.*<language type=//' -e 's/<\/language>/",/' -e 's/>/: "/' -e 's/-->//'
|
|
|
16 |
echo '},'
|
|
|
17 |
done
|
|
|
18 |
echo "]"
|