Rev Author Line No. Line
250 kaklik 1 #!/bin/sh
2 # $Id: translatecount.sh,v 2.0 2003/11/18 15:20:42 nijel Exp $
3 ##
4 # Shell script to produce counts of just how out of date the translations are!
5 ##
6 # Accepts optional parameters of a list of files to produce counts from
7 # Defaults to using all files
8 ##
9 # Written by Robin Johnson <robbat2 at users.sourceforge.net>
10 ##
11 srcfilelist=${@}
12 destfilelist=""
13 translationmatch='//to translate'
14 suffixtoremove='.inc.php'
15 added=0
16 if [ -z "${srcfilelist}" ]; then
17 srcfilelist="*.inc.php"
18 added=1
19 fi;
20 for i in ${srcfilelist}; do
21 if [ ! -e ${i} ]; then
22 $i=`eval ${i}*php3`
23 fi
24 if [ -e ${i} ]; then
25 destfilelist="${destfilelist} ${i}"
26 fi;
27 done;
28 destfilelist=`echo ${destfilelist} | xargs -n1 | egrep '.inc.php$'`
29 if [ ! -z "${destfilelist}" ]; then
30 grep -c -- "${translationmatch}" ${destfilelist} | sort -t':' -n +1 | sed -e "s/${suffixtoremove}//g" | xargs -n1 | egrep -v ':0$'
31 fi;