Opened 11 months ago

Last modified 4 months ago

#18734 closed bug

LC_* envars not updated after changing "Preferred language" in Locale preflet. — at Version 1

Reported by: bipolar Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: Servers/launch_daemon Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by bipolar)

After changing "Preferred language" in Locale preflet, say, from "English" to "Español (Latinoamérica)", the LC_* environmental variables under a shell session are still set to en.UTF-8, and only updated after performing a reboot.

Seems that /system/boot/SetupEnvironment is where we set:

# Locale
export LC_MESSAGES=`locale --message`
export LC_NUMERIC=`locale --format`
export LC_TIME=`locale --time`
export LC_COLLATE=$LC_MESSAGES
export LC_CTYPE=$LC_MESSAGES
export LC_MONETARY=$LC_NUMERIC

Not sure if it is the best place, but... moving those to /system/settings/etc/profile makes the reboot unnecessary, as they get updated (for new shell sessions) right after changing languages.


Sidenote:

While testing these things... I've noticed that no matter what language I choose, LC_TYPE always has the same value: LC_TYPE=en_US.UTF-8.

That seems to be defined by launch_daemon, originally introduced in bd1c9bf338fdae8456577c557faf36aba7b87cd5.

I couldn't find much info on LC_TYPE, and considering that it doesn't seems to be part of LC categories, and not mentioned in POSIX...

I wonder if that's a typo, meant to be LC_CTYPE, as SetupEnvironment also exports at its start.

Change History (1)

comment:1 by bipolar, 11 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.