#11193: Locale settings in /etc/profile.d/i18n.sh and /etc/locale.conf
-------------------------+-----------------------
 Reporter:  xry111       |      Owner:  blfs-book
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  8.4
Component:  BOOK         |    Version:  systemd
 Severity:  normal       |   Keywords:
-------------------------+-----------------------
 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
 }}}

--
Ticket URL: <http://wiki.linuxfromscratch.org/blfs/ticket/11193>
BLFS Trac <http://wiki.linuxfromscratch.org/blfs>
Beyond Linux From Scratch
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to