root / trunk / install / IzPack / bin / langpacks / checklangpack @ 11445
History | View | Annotate | Download (856 Bytes)
1 |
#!/bin/sh |
---|---|
2 |
# |
3 |
|
4 |
tmpfile="stringids.tmp" |
5 |
|
6 |
# rather use English as the authoritative source for string IDs? |
7 |
reference_file="*.xml" |
8 |
|
9 |
idfilter='/^.*id="\([^"]*\)".*$/{ |
10 |
s//\1/ |
11 |
p |
12 |
}' |
13 |
|
14 |
checkfiles="*.xml" |
15 |
|
16 |
if [ $# -ge 1 -a -n "$1" ] ; then |
17 |
checkfiles="$1" |
18 |
fi |
19 |
|
20 |
# basic sanity check |
21 |
if [ ! -f eng.xml ] ; then |
22 |
echo "Could not find eng.xml - please go to the directory containing the" |
23 |
echo "translation files before executing this script." |
24 |
exit 1 |
25 |
fi |
26 |
|
27 |
sed -n -e "$idfilter" $reference_file | sort | uniq > $tmpfile |
28 |
|
29 |
echo "lines starting with \"-\" mark missing strings, lines with \"+\" are superfluous" |
30 |
|
31 |
for i in $checkfiles ; do |
32 |
if [ ! -f "$i" ] ; then |
33 |
echo "$i not found. Skipping" |
34 |
continue |
35 |
fi |
36 |
|
37 |
echo "report of $i (- = missing, + = probably superfluous)" |
38 |
sed -n -e "$idfilter" $i | sort | diff -U 0 $tmpfile - | sed -n -e '/^[-+][^-+]/p' |
39 |
done |
40 |
|