X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fgrml-setlang;h=ae6a096703298087f9fe75b1cdf6563ca8c1a687;hb=2706049698b8bc7478aa252f5e3a4f394bad4e5e;hp=f8cb28bd98a39586a9088060322ecd6fcf3c7c9b;hpb=ecb125a69f73cb71197a1db5c870a1263060d496;p=grml-scripts.git diff --git a/usr_sbin/grml-setlang b/usr_sbin/grml-setlang index f8cb28b..ae6a096 100755 --- a/usr_sbin/grml-setlang +++ b/usr_sbin/grml-setlang @@ -4,7 +4,6 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Mit Sep 05 18:33:23 CEST 2007 [mika] ################################################################################ PN="$(basename $0)" @@ -166,29 +165,36 @@ if ! grep -qe "${LANGUAGE})" -qe "${LANGUAGE}|" $LANGFUNC ; then ewarn "Language ${LANGUAGE} not supported, using default." ; eend 0 fi +# fallback to C if using an ISO system (which is latin1 for LC_CTYPE); +# this should prevent users from broken ctype settings if the set +# locale isn't available on a remote system +if echo $LANGUAGE | grep -q -- '-iso' ; then + LC_CTYPE=C +fi + # read in the file where all the $LANGUAGE stuff is defined - source $LANGFUNC + . $LANGFUNC # make sure the file exists if ! [ -r $CONFFILE ] ; then cat > $CONFFILE < LC_* > LANG +# LANGUAGE is glibc only and binds stronger than LC_ALL EOF fi -setvalue 'LANGUAGE=' $LANGUAGE -setvalue 'LANG=' $LANG -setvalue 'LC_MESSAGES=' $LANG -# setvalue 'TZ=' $TZ +setvalue 'LANG=' $LANG retval=$? case $retval in