File: get-iso-codes

package info (click to toggle)
localechooser 2.84
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,612 kB
  • sloc: sh: 1,096; perl: 187; makefile: 71; awk: 42
file content (23 lines) | stat: -rwxr-xr-x 732 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
#!/bin/sh

# Get ISO codes from the iso-codes package and extract translations
set -e

rm -rf debian/iso-codes >/dev/null 2>&1
mkdir debian/iso-codes

for i in $(find /usr/share/locale/ -name iso_3166-1.mo); do
	language=$(echo $i | cut -f5 -d/)
	# If a file exists in iso-codes.updates, then use it
	# else extract translations from the iso-codes package
	if [ ! -f iso-codes.updates/$language.po ]; then
		msgunfmt $i >debian/iso-codes/${language}.po 2>/dev/null
	else
		cp iso-codes.updates/$language.po debian/iso-codes
	fi
done

# If no iso-codes translation is available for se, then use nb instead
if [ ! -f debian/iso-codes/se.po ] && [ -f debian/iso-codes/nb.po ]; then
	cp debian/iso-codes/nb.po debian/iso-codes/se.po
fi