aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2000-03-31 21:12:22 +0000
committerBill Nottingham <notting@redhat.com>2000-03-31 21:12:22 +0000
commit1c06cc652b19cc546909c46bbdb03816cd75ecbb (patch)
treefbb43527de6ce51a121d7dcfb022784741c51846
parentdb538e83c5f3e2b463a9edda232c1cba946733c8 (diff)
downloadinitscripts-1c06cc652b19cc546909c46bbdb03816cd75ecbb.tar
initscripts-1c06cc652b19cc546909c46bbdb03816cd75ecbb.tar.gz
initscripts-1c06cc652b19cc546909c46bbdb03816cd75ecbb.tar.bz2
initscripts-1c06cc652b19cc546909c46bbdb03816cd75ecbb.tar.xz
initscripts-1c06cc652b19cc546909c46bbdb03816cd75ecbb.zip
source /home/devel/notting/.i18n as well as /etc/sysconfig/i18n (idea from <ivanyi@internet.sk>)
-rwxr-xr-xlang.csh14
-rwxr-xr-xlang.sh10
2 files changed, 18 insertions, 6 deletions
diff --git a/lang.csh b/lang.csh
index 8e77e094..6471cd49 100755
--- a/lang.csh
+++ b/lang.csh
@@ -1,8 +1,15 @@
# /etc/profile.d/lang.csh - set i18n stuff
-test -f /etc/sysconfig/i18n
-if ($status == 0) then
- eval `sed 's|=C$|=en_US|g' /etc/sysconfig/i18n | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|' `
+set sourced=0
+foreach file (/etc/sysconfig/i18n $HOME/.i18n)
+ test -f $file
+ if ($status == 0) then
+ eval `sed 's|=C$|=en_US|g' $file | sed 's|\([^=]*\)=\([^=]*\)|setenv \1 \2|g' | sed 's|$|;|' `
+ endif
+ set sourced=1
+end
+
+if ($sourced == 1) then
if ($?LC_ALL && $?LANG) then
if ($LC_ALL == $LANG) then
unsetenv LC_ALL
@@ -28,4 +35,5 @@ if ($status == 0) then
endsw
endif
unsetenv SYSFONTACM
+ unsetenv SYSFONT
endif
diff --git a/lang.sh b/lang.sh
index ad8370da..416f6e8b 100755
--- a/lang.sh
+++ b/lang.sh
@@ -1,7 +1,11 @@
# /etc/profile.d/lang.sh - set i18n stuff
-if [ -f /etc/sysconfig/i18n ]; then
- . /etc/sysconfig/i18n
+sourced=0
+for langfile in /etc/sysconfig/i18n $HOME/.i18n ; do
+ [ -f $langfile ] && . $langfile && sourced=1
+done
+
+if [ "$sourced" = 1 ]; then
if [ -n "$LANG" ] ; then
[ "$LANG" = "C" ] && LANG="en_US"
export LANG
@@ -49,5 +53,5 @@ if [ -f /etc/sysconfig/i18n ]; then
esac
fi
- unset SYSFONTACM
+ unset SYSFONTACM SYSFONT
fi