diff options
-rw-r--r-- | functions | 8 | ||||
-rw-r--r-- | locale.sh | 11 | ||||
-rw-r--r-- | rc.conf | 1 |
3 files changed, 16 insertions, 4 deletions
@@ -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 @@ -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 @@ -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 |