lang/sync_lang.sh also now works with POSIX sh

This commit is contained in:
Michal Čihař
2002-12-16 21:04:04 +00:00
parent 959459e7bb
commit 231f984a58
2 changed files with 7 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ $Id$
$Source$ $Source$
2002-12-13 Michal Cihar <nijel@users.sourceforge.net> 2002-12-13 Michal Cihar <nijel@users.sourceforge.net>
* lang/sort_lang.sh: Make it work with POSIX sh. * lang/{sort_lang.sh,sync_lang.sh}: Make it work with POSIX sh.
2002-12-16 Marc Delisle <lem9@users.sourceforge.net> 2002-12-16 Marc Delisle <lem9@users.sourceforge.net>
* lang/russian: update, thanks to Nicolay Zakharov * lang/russian: update, thanks to Nicolay Zakharov

View File

@@ -28,10 +28,12 @@
# CONVERTOR_PARAMS is used for printf and it also receives two params: source # CONVERTOR_PARAMS is used for printf and it also receives two params: source
# and target charset # and target charset
# #
case "$1" in case "$1" in
--iconv) --iconv)
echo Using iconv on user request echo Using iconv on user request
CONVERTOR=iconv CONVERTOR=iconv
# the space on following is REQUIRED
CONVERTOR_PARAMS=" -f %s -t %s" CONVERTOR_PARAMS=" -f %s -t %s"
shift shift
;; ;;
@@ -159,16 +161,16 @@ for base in $BASE_TRANSLATIONS ; do
if [ $charset = 'utf-8' ] ; then if [ $charset = 'utf-8' ] ; then
# if we convert to utf-8, we should add allow_recoding # if we convert to utf-8, we should add allow_recoding
is_utf=yes is_utf=yes
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed -e "s/$src_charset/$charset/" -e '/\$charset/a\ $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed -e "s/$src_charset/$charset/" -e '/\$charset/a\
$allow_recoding = TRUE;' > $file $allow_recoding = TRUE;' > $file
echo done echo done
elif [ $src_charset = 'utf-8' ] ; then elif [ $src_charset = 'utf-8' ] ; then
# if we convert from utf-8, we should remove allow_recoding # if we convert from utf-8, we should remove allow_recoding
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| grep -v allow_recoding > $file $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| grep -v allow_recoding > $file
echo done echo done
else else
# just convert # just convert
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed "s/$src_charset/$charset/" > $file $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed "s/$src_charset/$charset/" > $file
echo done echo done
fi fi
done done