In variable list there are missing following variables/notes: LC_ALL - It is not recommended to set this variable in system-wide environment. It breaks scripts like "LC_COLLATE=C sort". LANGUAGE - This variable is similar to LC_MESSAGES, but it allows to search in message catalogs of more languages and cannot be overriden by LC_ALL. For more see "(libc.info.gz)Using gettextized software". LINGUAS - see "(gettext.info.gz)Installers". I am not sure whether it is not overwritten by uselocale USE flag. Setting system-wide language environment. I don't know any clean solution. There are two solutions I found: Setting variable LANG by adding another file to /etc/env.d. But this has a drawback - display managers like gdm cannot set language. There is a solution I use: Adding following line to /etc/profile: [ -z "$LANG" ] && LANG="my_locale" Reproducible: Always Steps to Reproduce:
> LC_ALL - It is not recommended to set this variable in system-wide environment. It breaks scripts like "LC_COLLATE=C sort". If a script relies on LC_anything=C it's broken, but I do agree that it's probably best to leave system environment's locale settings to POSIX. Isn't this already told in the guide? > LANGUAGE - This variable is similar to LC_MESSAGES, but it allows to search in message catalogs of more languages and cannot be overriden by LC_ALL. For more see "(libc.info.gz)Using gettextized software". Yes, and actually, LANGUAGE does also affect man page selection while LC_MESSAGES doesn't, IIRC. > LINGUAS - see "(gettext.info.gz)Installers". I am not sure whether it is not overwritten by uselocale USE flag. userlocales? I don't think so, and IIRC the LINGUAS is even mentioned in some software's installation in same guide. > Setting variable LANG by adding another file to /etc/env.d. But this has a drawback - display managers like gdm cannot set language. Doesn't GDM set LC_ALL which overrides this? > There is a solution I use: Adding following line to /etc/profile: [ -z "$LANG" ] && LANG="my_locale" This seems like a good solution at first glance. I actually started another bug regarding environment variables in Gentoo docs in general after getting updates to guide-localization done. It seems that every other documentation gives a bit different instructions on setting local and global environments. As I don't think it's a good idea to track multiple problems in one bug I suggest further discussion on environment variable handling in bug 81152.
> > LC_ALL > Isn't this already told in the guide? Yes, it is, but recommendation to leave it unset would be nice. "LC_COLLATE=C sort" is not the only reason to not set in. Most programs will work with LC_ALL only, but some of them behaves incorrectly, if LC_ALL is set, but LANG not (e. g. gtk1). It can cause ugly bug reports. I have even found people setting LANG to UTF-8 locale and LC_ALL to ISO locale. > Doesn't GDM set LC_ALL which overrides this? No. It sets LANG variable and then starts login process. This is another reason, why to not use LC_ALL for system-wide locale.
*** Bug 81152 has been marked as a duplicate of this bug. ***
I've added a note on defining both LC_ALL and LANG and /why/ (i.e. misbehaving applications). However, I don't want to do more than this note as such programs need to be fixed, not the documentation.