diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2011-09-16 14:36:28 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2011-09-16 14:36:28 +0200 |
| commit | 579ef7a535489d4aa632db11667a3b01deb6cafd (patch) | |
| tree | 55810021c02ac7d80d3a9702ef0b59e4af154b9c /main/project/localization | |
| parent | 96ea21fd50334479c262da692038965d0e4d596a (diff) | |
| download | cgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.zip cgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.tar.gz cgeo-579ef7a535489d4aa632db11667a3b01deb6cafd.tar.bz2 | |
Move sources into the main directory
This prepares the inclusion of tests into the same repository.
Diffstat (limited to 'main/project/localization')
| -rw-r--r-- | main/project/localization/findmissingtranslations.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/main/project/localization/findmissingtranslations.sh b/main/project/localization/findmissingtranslations.sh new file mode 100644 index 0000000..0e08d0a --- /dev/null +++ b/main/project/localization/findmissingtranslations.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +getnames () { + grep "<string" "$1" | grep "name=" | sed "s/^.*<string\(-array\)*\s*name\s*=\s*\"\([^\"]*\)\".*$/\2/" +} + +finddiffs () { + echo "Missing translations for language '$1':" > $1.missing + diff -y en.str $1.str > tmp.str + echo "Only in values/strings.xml (this doesn't mean, that everything has to be translated):" >> $1.missing + grep "<\||" tmp.str | cut -d " " -f 1 | while read s; do + grep "<string" ../../res/values/strings.xml | grep "name=\"$s\"" + done >> $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 + grep "<string" ../../res/values-$1/strings.xml | grep "name=\"$s\"" + done >> $1.missing + rm tmp.str + [ `cat $1.missing | wc -l` -lt 4 ] && rm $1.missing +} + +echo processing en... +getnames ../../res/values/strings.xml > en.str +for l in `find ../../res/values-* -name "strings.xml" | sed "s/^.*values-\(..\).*$/\1/"`; do + echo processing $l... + getnames ../../res/values-$l/strings.xml > $l.str + finddiffs $l +done +rm *.str +echo "missing translations:" +wc -l *.missing | sed "s/\.missing//" |
