﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
11193	Locale settings in /etc/profile.d/i18n.sh and /etc/locale.conf	Xi Ruoyao	dj	"From http://lists.linuxfromscratch.org/pipermail/blfs-dev/2018-September/034916.html:

> On 09/26/2018 09:19 AM, Xi Ruoyao via blfs-dev wrote:
>> In LFS systemd book section 7.7 we create /etc/locale.conf as locale
>> configuation file.  But, in BLFS systemd book Chapter 3 section ""The
>> Bash Startup Files"" we create /etc/profile.d/i18n.sh which sets up the
>> locale for bash.  Their settings may be inconsistent and confuse the
>> users (I was confused several times).
>> 
>> We should add a note about this issue in LFS or BLFS book.  Now I use
>> an i18n.sh reading /etc/locale.conf (copied from Arch :) to make the
>> settings consistent.
>
> I suppose that we could change /etc/profile.d/i18n.sh to:
>
> if [ -f /etc/locale.conf ]; then
>   source /etc/locale.conf
> else
>    export LANG=<ll>_<CC>.<charmap><@modifiers>
> fi
> 
> We may need to update  ~/.profile and ~/.bashrc also.
> 
> I've used 'source' above to make it clear, but for ~/.profile and 
> i18n.sh is should probably be the dot (.) operator.
> 
>    -- Bruce

The locale variables need to be exported:

{{{
# Begin /etc/profile.d/i18n.sh

if [ -s /etc/locale.conf ]; then
  . /etc/locale.conf
else
  LANG=<ll>_<CC>.<charmap><@modifiers>
fi

export LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY
export LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE
export LC_MEASUREMENT LC_IDENTIFICATION LC_ALL

# End /etc/profile.d/i18n.sh
}}}"	task	closed	normal	8.4	BOOK	systemd	medium	fixed		
