2009-05-07 18:09:01 +02:00
|
|
|
#!/sbin/runscript
|
|
|
|
|
|
|
|
description="Sets a system locale"
|
|
|
|
|
|
|
|
depend()
|
|
|
|
{
|
|
|
|
need localmount termencoding
|
|
|
|
after bootmisc
|
|
|
|
keyword noopenvz noprefix nouml novserver noxenu
|
|
|
|
}
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
|
|
|
: >/etc/profile.d/locale.sh
|
|
|
|
chmod 755 /etc/profile.d/locale.sh
|
|
|
|
|
|
|
|
# Check if requested locale was already created
|
|
|
|
if ! $(locale -a|grep -q $LOCALE.utf8); then
|
|
|
|
[ ! -d /usr/lib/locale ] && mkdir -p /usr/lib/locale
|
|
|
|
ebegin "Building locale [$LOCALE] [UTF-8]"
|
|
|
|
localedef -i $LOCALE -f UTF-8 $LOCALE
|
|
|
|
eend $?
|
|
|
|
fi
|
|
|
|
# Set user defined locale
|
|
|
|
[ -z "$LOCALE" ] && LOCALE="en_US"
|
|
|
|
einfo "Setting system locale [$LOCALE] [UTF-8]"
|
2009-05-07 18:34:50 +02:00
|
|
|
echo "export LANG=$LOCALE.UTF-8" >> /etc/profile.d/locale.sh
|
2009-05-07 18:09:01 +02:00
|
|
|
}
|