4 # Shell script to check that all language files are syncronized
5 # Catches duplicate/missing strings
7 # Robin Johnson <robbat2@users.sourceforge.net>
11 MASTER
="english-iso-8859-1.inc.php"
14 STRINGMATCH
='^[[:space:]]*\$[[:alnum:]_]+[[:blank:]]+='
15 IGNOREMATCH
='strEncto|strKanjiEncodConvert|strXkana|allow_recoding|doc_lang'
17 if [ "`which diffstat`" = "" ] ; then
18 echo 'You need diffstat to use this!'
25 # Build the list of variables in each file
29 awk "/$STRINGMATCH/ && ! /$IGNOREMATCH/ { print \$1 }" $f |
sort > $TMPDIR/$f
33 # Build the diff files used for checking
34 # And if there are no differences, delete the empty files
38 if [ ! $MASTER = $f ]; then
39 if diff -u $TMPDIR/$MASTER $TMPDIR/$f >$TMPDIR/$f.
diff ; then
40 rm -f $TMPDIR/$f.
diff $TMPDIR/$f
48 # Build the nice difference table
50 diffstat
-f 0 $TMPDIR/*.
diff >$TMPDIR/diffstat
2>/dev
/null
51 echo "Dupe Miss Filename"
52 head -n -1 $TMPDIR/diffstat | \
53 while read filename sep change add plus sub minus edits exclaim
;
55 echo "$add $sub $filename";
59 echo "Dupe = Duplicate Variables"
60 echo "Miss = Missing Variables"
61 echo "For exact problem listings, look in the $TMPDIR/ directory"
62 echo "Please remember to remove '$TMPDIR/' once you are done"