4 # Shell script to check that all language files are syncronized
5 # Catches duplicate/missing strings
7 # Robin Johnson <robbat2@users.sourceforge.net>
10 MASTER
="english-iso-8859-1.inc.php3"
13 STRINGSTRING
='^[[:space:]]*\$[[:alnum:]_]*[[:blank:]]* ='
18 #Build the list of variables in each file
19 #Note the special case to strip out allow_recoding
20 echo -e "Building data"
24 egrep "$STRINGSTRING" $f | \
25 grep -v 'allow_recoding' | \
26 cut
-d= -f1 | cut
-d'$' -f2 | \
30 #Build the diff files used for checking
31 #And if there are no differences, delete the empty files
32 echo -e "Comparing data"
35 diff -u $TMPDIR/$MASTER $TMPDIR/$f >$TMPDIR/$f.
diff
36 if [ ! $MASTER == $f ]; then
37 if [ `wc -l $TMPDIR/$f.diff | cut -c-8|xargs` == "0" ] ;
39 rm -f $TMPDIR/$f.
diff $TMPDIR/$f
44 #build the nice difference table
46 diffstat
-f 0 $TMPDIR/*.
diff >$TMPDIR/diffstat
2>/dev
/null
47 head -n $
((`wc -l <$TMPDIR/diffstat` - 1)) $TMPDIR/diffstat
> $TMPDIR/diffstat.res
48 echo -e "Dupe\tMiss\tFilename"
49 cat $TMPDIR/diffstat.res | \
50 while read filename sep change add plus sub minus edits exclaim
;
52 echo -e "$add\t$sub\t$filename";
56 echo "Dupe = Duplicate Variables"
57 echo "Miss = Missing Variables"
58 echo "For exact problem listings, look in the $TMPDIR/ directory"
59 echo "Please remember to remove '$TMPDIR/' once you are done"