From b694b022c17a3f7bd39e8504c2c736e962b0eb0f Mon Sep 17 00:00:00 2001 From: tfheen Date: Thu, 21 Apr 2005 22:44:15 +0000 Subject: [PATCH] Only set LANG if unset git-svn-id: file:///svn/tfheen/trunk/dotfiles@753 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf --- environment | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/environment b/environment index 1d562fe..097659a 100644 --- a/environment +++ b/environment @@ -24,11 +24,12 @@ findcommand() { fi if [ -x "$D/$1" ]; then echo "$D/$1" - return + return 0 fi done shift done + return 1 } blog () { @@ -174,16 +175,18 @@ case `uname -s` in ;; esac -if type -p locale > /dev/null 2>&1; then - if locale -a | grep -q '^no_NO$' ; then - LANG=no_NO - elif locale -a | grep -q '^en_US$'; then - LANG=en_US +if [ -z "$LANG" ] || [ "$LANG" = "C" ]; then + if findcommand locale; then + if locale -a | grep -q '^no_NO$' ; then + LANG=no_NO + elif locale -a | grep -q '^en_US$'; then + LANG=en_US + fi fi fi -if [ -z "$LANG" ]|| [ "$LANG" = "C" ]; then - if type -p localedef > /dev/null 2>&1; then +if [ -z "$LANG" ] || [ "$LANG" = "C" ]; then + if findcommand localedef; then localedef --list-archive > /dev/null 2>&1 if test "$?" = "0"; then if localedef --list-archive | grep -q '^no_NO$' ; then -- 2.39.5