vp-build/templates/OpenRC/files/locale.rc
Juan RP 27286b694b OpenRC: always set the UTF-8 variant for the locale.
--HG--
extra : convert_revision : 0f0ff2481fb5797a0e7759854ec3efd0a184f6fd
2009-05-07 16:34:50 +00:00

29 lines
666 B
Plaintext

#!/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]"
echo "export LANG=$LOCALE.UTF-8" >> /etc/profile.d/locale.sh
}