File: get-iso-codes

package info (click to toggle)
choose-mirror 2.13etch4
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,208 kB
  • ctags: 120
  • sloc: perl: 1,199; ansic: 636; sh: 195; makefile: 123; python: 38
file content (32 lines) | stat: -rwxr-xr-x 927 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
28
29
30
31
32
#!/bin/sh

set -e

#
# Get ISO codes from the iso-codes package and extract translations
set -e
[ -r /usr/share/xml/iso-codes/iso_3166.xml ] || exit 1
rm -rf debian/iso-codes >/dev/null 2>&1
mkdir debian/iso-codes
for i in `find /usr/share/locale/ -name iso_3166.mo` ; do
  language=`echo $i | cut -f5 -d/`
  # Extract translations from the iso-codes package
  msgunfmt $i >debian/iso-codes/${language}.po 2>/dev/null
done

DATE="$(date +'%Y-%m-%d %H:%M%z')"
cat <<EOF >debian/iso-codes/en.po
msgid ""
msgstr ""
"Project-Id-Version: iso_3166 CVS\\n"
"Report-Msgid-Bugs-To: Alastair McKinstry <mckinstry@debian.org>\\n"
"POT-Creation-Date: $DATE\\n"
"PO-Revision-Date: $DATE\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"

EOF
./iso3166tab.py /usr/share/xml/iso-codes/iso_3166.xml \
  | perl -pe 's/.*?\t(.*)/msgid "$1"\nmsgstr "$1"\n/' \
  >>debian/iso-codes/en.po