blob: 420f6f9e06cbe42f55949f962893378f2a94ca5b (
plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
#!/bin/sh
cd `dirname "$0"`
. ./funcs.sh
finddiffs () {
echo "translations missing or not in the right place for language '$1':" > $1.missing
diff -y en.str $1.str > tmp.str
echo "Only in values/strings.xml:" >> $1.missing
grep "<\||" tmp.str | cut -d " " -f 1 | while read s; do
egrep "<(string|plurals)" ../../res/values/strings.xml | grep "name=\"$s\""
done | egrep -v '<string name="(contributors|changelog)">'>> $1.missing
echo "Only in values-$1/strings.xml:" >> $1.missing
grep ">\||" tmp.str | sed "s/^/x/;s/\s\s*/ /g" | cut -d " " -f 3 | while read s; do
egrep "<(string|plurals)" ../../res/values-$1/strings.xml | grep "name=\"$s\""
done >> $1.missing
rm tmp.str
}
usage() {
echo "Usage: $0 [ <lang-code> | all ]"
echo " where <lang-code> is one of:"
echo "$alllangs"
exit 1
}
alllangs=`find ../../res/values-* -name "strings.xml" | sed "s/^.*values-\(..\).*$/ \1/"`
if [ $# -ne 1 ]; then
usage
elif [ "$1" != "all" -a ! -f ../../res/values-$1/strings.xml ]; then
echo "language file res/values-$1/strings.xml not present"
echo
usage
fi
if [ "$1" = "all" ]; then
langs=$alllangs
else
langs=$1
fi
echo processing en...
getnames ../../res/values/strings.xml > en.str
for l in $langs; do
echo processing $l...
getnames ../../res/values-$l/strings.xml > $l.str
finddiffs $l
done
rm *.str
echo "missing translations:"
for l in $langs; do
# Do not count 3 comments
wc -l $l.missing | sed "s/\.missing//" | awk '{print $2": "$1-3}'
done
|