aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--functions8
-rw-r--r--locale.sh11
-rw-r--r--rc.conf1
3 files changed, 16 insertions, 4 deletions
diff --git a/functions b/functions
index 2ea81f9..68f4229 100644
--- a/functions
+++ b/functions
@@ -67,8 +67,12 @@ unset TZ
unset LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE \
LC_MEASUREMENT LC_IDENTIFICATION LC_ALL
-if [[ $DAEMON_LOCALE = [yY][eE][sS] && $LOCALE ]]; then
- export LANG="${LOCALE}"
+if [[ $DAEMON_LOCALE = [yY][eE][sS] ]]; then
+ if [ -r /etc/locale.conf ]; then
+ . /etc/locale.conf
+ else
+ export LANG="${LOCALE}"
+ fi
else
export LANG=C
fi
diff --git a/locale.sh b/locale.sh
index 6723f95..e774659 100644
--- a/locale.sh
+++ b/locale.sh
@@ -1,3 +1,10 @@
-. /etc/rc.conf
+if [ -s /etc/rc.conf ]; then
+ LANG=$(. /etc/rc.conf 2> /dev/null ; echo "${LOCALE:=en_US.UTF-8}")
+fi
+if [ -s /etc/locale.conf ]; then
+ . /etc/locale.conf
+fi
-export LANG=${LOCALE:=en_US.UTF-8}
+export LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE
+export LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS
+export LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
diff --git a/rc.conf b/rc.conf
index 303a035..d91dff7 100644
--- a/rc.conf
+++ b/rc.conf
@@ -7,6 +7,7 @@
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
+# LANG in /etc/locale.conf takes precedence
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
# startup and during the boot process. If set to 'no', the C locale is used.
# HARDWARECLOCK: set to "", "UTC" or "localtime", any other value will result