FS#19409 - [initscripts] locale: support all the LC_* variables
Attached to Project:
Arch Linux
Opened by Mark (voidzero) - Monday, 10 May 2010, 12:37 GMT
Last edited by Tom Gundersen (tomegun) - Thursday, 20 October 2011, 22:52 GMT
Opened by Mark (voidzero) - Monday, 10 May 2010, 12:37 GMT
Last edited by Tom Gundersen (tomegun) - Thursday, 20 October 2011, 22:52 GMT
|
Details
I opt to split LANG and LC_ALL in rc.conf and rc.sysinit. I
suggest this because for me, there is a need Dutch locales
and a preference to set en_GB.utf8 as LANG. Currently, the
LOCALE variable is used to set LANG and LC_ALL.
In rc.sysinit checks exist that test if LOCALE has been set, and if it hasn't, it will be set to "en_US" (why not C, or en_US.utf8 or even en_GB.utf8? What if the locales haven't been added during setup?) There should be some tests for LANG as well: if LANG is unset and LOCALE is unset, set them both to e.g. en_US.utf8 (since Arch has moved to utf8 by default for about everything else now); if LANG is unset and LOCALE is set, set LANG to LOCALE; if both are set, use them both. This also introduces a new variable in rc.conf. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Thursday, 20 October 2011, 22:52 GMT
Reason for closing: Implemented
Thursday, 20 October 2011, 22:52 GMT
Reason for closing: Implemented
When I changed LOCALE in rc.conf, nothing but LANG got changed. So, there is a need to set the proper LOCALEs, by setting each of the individual LC-variables. Perhaps we could exclude LC_MESSAGES and set that to LANG as well.
Just set any LC_* var in ~/.bashrc or similar place (for per-user setting) or _at the end_ of /etc/profile for global setting.
The fundamental reason that I add this request to the tracker is that LOCALE *is* set in /etc/rc.conf but what it actually sets is LANG, which are two different things. Secondly, the use of /etc/profile and ~/.bashrc are only valid for bash and not for, say, zsh or csh.
Thirdly, it seemed to me that changing LOCALE after the initial installation doesn't really do anything logical. Zsh for example does not read /etc/profile.d/locale.sh. Therefore the current solution needs to be adapted, imho, which is a matter that could be discussed, even if nothing else is appropriate.
That said, the whole locale setting needs a redesign anyway.
I can write up some patches; please share your thoughts first.
And, do you think we should attract some attention from the Archlinux BBS?
They are sourced from /etc/profile which should be sourced by all shells,
otherwise we have much bigger problems.
(if this is a case - file a separate report)
I suggest to close this report and open a separate feature request with proposal for redesigning the locale settings.
Thomas, if you have a concrete proposal - please describe it in the above-mentioned report,
I don't really have any specific ideas about that (except that locale.sh can die, but I am not sure about alternatives).
I'm also interested in redesigning locale support, has anything been done in this regard yet. The scheme being implemented by Fedora and SuSE (and maybe others?) as part of systemd is very simple and might make sense to copy: <http://0pointer.de/public/systemd-man/locale.conf.html>. (We could maybe skip support for changing locale settings via kernel parameters.)
If there is interest I'd be more than happy to help.
I'm not that well known on working with locale support and recently my real life has been attracting most of my attention. We all know how that can go.
Tom/Thomas, do you want to pick up this bug?
I think the correct approach is to define system-wide settings in rc.conf, which are inherited by user sessions and daemons alike. Then it is up to the user to override these if they want.
Even if these settings are not applied to users, only to daemons. I think it is within our scope to support fine-tuning by the LC_* variables. Though, it is not high on my list of priorities. First of all we should make sure the inheritance of these variables is clear and consistent.
Lastly, LC_ALL should not be set by us, it is for debugging only, and would contradict the other settings.