From 137a7347ff975e4988d7fd999a0a6c32fee0464b Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 17 Oct 2011 20:55:38 +0200 Subject: locale.sh: support /etc/locale.conf This is mainly to support non-bash shells that cannot source rc.conf. The format of /etc/locale.conf is described here: . If LANG is not set in locale.conf, then we fall back to LOCALE from rc.conf, as before. Signed-off-by: Tom Gundersen --- locale.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'locale.sh') 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 -- cgit v1.2.3