lang. scripts replaced by files from r13129

This commit is contained in:
Tomas Srnka
2009-11-26 09:23:33 +00:00
parent 3120c65900
commit c9226433b1
6 changed files with 13 additions and 6 deletions

View File

@@ -14,17 +14,19 @@ fi
for file in *.inc.php
do
echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in
english*)
echo "$1 = '"$2"';" >> ${file}.new
;;
*)
echo "$1 = '"$2"'; //to translate" >> ${file}.new
;;
esac
echo "?>" >> ${file}.new
rm $file
mv ${file}.new $file
done
./sort_lang.sh english*
echo " "
echo "Message added to all message files (including english)"

View File

@@ -2,6 +2,7 @@
# $Id$
#
# Shell script that adds a message file to all message files
# adding "//to translate" on each line
#
# Example: add_message_file.sh xxx
#
@@ -13,6 +14,7 @@ fi
for file in *.inc.php
do
echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in
english*)
sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new
@@ -21,10 +23,10 @@ do
sed -n 's/\(.*\);/\1; \/\/to translate/p' $1 >> ${file}.new
;;
esac
echo "?>" >> ${file}.new
rm $file
mv ${file}.new $file
done
./sort_lang.sh english*
echo " "
echo "Messages added to add message files (including english)"

View File

@@ -29,6 +29,7 @@ do
awk "/$STRINGMATCH/ && ! /$IGNOREMATCH/ { print \$1 }" $f | sort > $TMPDIR/$f
done
# Build the diff files used for checking
# And if there are no differences, delete the empty files
echo "Comparing data"
@@ -59,4 +60,3 @@ echo "Dupe = Duplicate Variables"
echo "Miss = Missing Variables"
echo "For exact problem listings, look in the $TMPDIR/ directory"
echo "Please remember to remove '$TMPDIR/' once you are done"

View File

@@ -21,4 +21,3 @@ do
echo " lines after:" `wc -l $file`
done
echo " "

View File

@@ -27,6 +27,7 @@ sortlang()
targetdir=tmp-$f
mkdir -p $targetdir
TRANSLATIONSTRING='//.*translate.*$'
STRINGSTRING='^\$str[[:alnum:]_]+'
WHITESPACE='^[[:blank:]]*$'
CVSID='/\* \$Id$ \*/'
@@ -34,6 +35,7 @@ sortlang()
echo -n "Extracting:"
echo -n " head"
egrep -i -v $TRANSLATIONSTRING $f | \
egrep -v "$STRINGSTRING|$CVSID|\?>|<\?php" >> $targetdir/head
echo -n " cvs"
egrep "$CVSID" $f >>$targetdir/cvs
@@ -52,6 +54,7 @@ sortlang()
echo -n " pending_translations"
if [ -s $targetdir/tmp-translate ] ; then
echo '// To translate:' > $targetdir/translate
specialsort $targetdir/tmp-translate $targetdir/translate
else
echo -n > $targetdir/translate
@@ -59,8 +62,10 @@ sortlang()
echo
echo "Assembling final"
echo "<?php" > $f
cat $targetdir/cvs $targetdir/head $targetdir/sort $targetdir/translate \
| uniq >> $f
echo "?>" >> $f
rm -rf $targetdir
}
@@ -76,4 +81,3 @@ do
fi
echo "-------------------------------------------------------------------"
done;

View File

@@ -10,6 +10,7 @@
##
srcfilelist=${@}
destfilelist=""
translationmatch='//to translate'
suffixtoremove='.inc.php'
added=0
if [ -z "${srcfilelist}" ]; then
@@ -28,4 +29,3 @@ destfilelist=`echo ${destfilelist} | xargs -n1 | egrep '.inc.php$'`
if [ ! -z "${destfilelist}" ]; then
grep -c -- "${translationmatch}" ${destfilelist} | sort -t':' -n +1 | sed -e "s/${suffixtoremove}//g" | xargs -n1 | egrep -v ':0$'
fi;