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 for file in *.inc.php
do do
echo $file " " echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in case $file in
english*) english*)
echo "$1 = '"$2"';" >> ${file}.new echo "$1 = '"$2"';" >> ${file}.new
;; ;;
*) *)
echo "$1 = '"$2"'; //to translate" >> ${file}.new
;; ;;
esac esac
echo "?>" >> ${file}.new
rm $file rm $file
mv ${file}.new $file mv ${file}.new $file
done done
./sort_lang.sh english* ./sort_lang.sh english*
echo " " echo " "
echo "Message added to all message files (including english)" echo "Message added to all message files (including english)"

View File

@@ -2,6 +2,7 @@
# $Id$ # $Id$
# #
# Shell script that adds a message file to all message files # Shell script that adds a message file to all message files
# adding "//to translate" on each line
# #
# Example: add_message_file.sh xxx # Example: add_message_file.sh xxx
# #
@@ -13,6 +14,7 @@ fi
for file in *.inc.php for file in *.inc.php
do do
echo $file " " echo $file " "
grep -v '?>' ${file} > ${file}.new
case $file in case $file in
english*) english*)
sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new sed -n 's/\(.*\);/\1;/p' $1 >> ${file}.new
@@ -21,10 +23,10 @@ do
sed -n 's/\(.*\);/\1; \/\/to translate/p' $1 >> ${file}.new sed -n 's/\(.*\);/\1; \/\/to translate/p' $1 >> ${file}.new
;; ;;
esac esac
echo "?>" >> ${file}.new
rm $file rm $file
mv ${file}.new $file mv ${file}.new $file
done done
./sort_lang.sh english* ./sort_lang.sh english*
echo " " echo " "
echo "Messages added to add message files (including english)" 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 awk "/$STRINGMATCH/ && ! /$IGNOREMATCH/ { print \$1 }" $f | sort > $TMPDIR/$f
done done
# Build the diff files used for checking # Build the diff files used for checking
# And if there are no differences, delete the empty files # And if there are no differences, delete the empty files
echo "Comparing data" echo "Comparing data"
@@ -59,4 +60,3 @@ echo "Dupe = Duplicate Variables"
echo "Miss = Missing Variables" echo "Miss = Missing Variables"
echo "For exact problem listings, look in the $TMPDIR/ directory" echo "For exact problem listings, look in the $TMPDIR/ directory"
echo "Please remember to remove '$TMPDIR/' once you are done" echo "Please remember to remove '$TMPDIR/' once you are done"

View File

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

View File

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

View File

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