diff options
author | Thomas Bächler <thomas@archlinux.org> | 2011-01-27 09:12:02 +0100 |
---|---|---|
committer | Thomas Bächler <thomas@archlinux.org> | 2011-01-27 09:12:02 +0100 |
commit | ef74507563bf994d6abb2621ebd3b6f6818b6b2f (patch) | |
tree | 330fffecee88b8976b0e227cde2f6c47aa4abbbf /functions | |
parent | 32310a7cfd3288bb002f5479effd8328127d1249 (diff) |
Allow setting the locale during boot and daemon startup.
This is configurable by the new rc.conf option DAEMON_LOCALE.
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -39,6 +39,16 @@ unset TERM_COLORS # clear the TZ envvar, so daemons always respect /etc/localtime unset TZ +# sanitize the locale settins +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 =~ yes|YES && -n $LOCALE ]]; then + export LANG="${LOCALE}" +else + export LANG=C +fi + # colors: if [[ $USECOLOR = YES || $USECOLOR = yes ]]; then C_MAIN="\033[1;37;40m" # main text |