aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlang.csh25
-rwxr-xr-xlang.sh21
2 files changed, 17 insertions, 29 deletions
diff --git a/lang.csh b/lang.csh
index 72f39435..6a4867b7 100755
--- a/lang.csh
+++ b/lang.csh
@@ -3,24 +3,19 @@
set sourced=0
if ($?LANG) then
set sourced=1
-else
- foreach file (/etc/sysconfig/i18n $HOME/.i18n)
- if ( -f $file ) then
- eval `grep -v '^[:blank:]*#' $file | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`
- endif
- set sourced=1
- end
+ set saved_lang=$LANG
endif
-if ($?GDM_LANG) then
- set sourced=1
- setenv LANG $GDM_LANG
- if ($?LANGUAGE) then
- unsetenv LANGUAGE
- endif
- if ("$GDM_LANG" == "zh_CN.GB18030") then
- setenv LANGUAGE "zh_CN.GB18030:zh_CN.GB2312:zh_CN"
+foreach file (/etc/sysconfig/i18n $HOME/.i18n)
+ if ( -f $file ) then
+ eval `grep -v '^[:blank:]*#' $file | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|'`
+ set sourced=1
endif
+end
+
+if ($?saved_lang) then
+ setenv LANG $saved_lang
+ unset saved_lang
endif
if ($sourced == 1) then
diff --git a/lang.sh b/lang.sh
index 62364d06..705e7a58 100755
--- a/lang.sh
+++ b/lang.sh
@@ -2,22 +2,15 @@
sourced=0
-if [ -n "$LANG" ]; then
- sourced=1
-else
- for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do
- [ -f $langfile ] && . $langfile && sourced=1
- done
-fi
+saved_lang="$LANG"
+for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do
+ [ -f $langfile ] && . $langfile && sourced=1
+done
-if [ -n "$GDM_LANG" ]; then
- sourced=1
- LANG="$GDM_LANG"
- unset LANGUAGE
- if [ "$GDM_LANG" = "zh_CN.GB18030" ]; then
- export LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
- fi
+if [ -n "$saved_lang" ]; then
+ LANG="$saved_lang"
fi
+unset saved_lang
if [ "$sourced" = 1 ]; then
[ -n "$LANG" ] && export LANG || unset LANG