Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

It seems both the LANG and LANGUAGE environment variable are used by some programs to determine their user interface language.

What are the exact semantics of these variables and where can I read about their correct usage? The manpage for locale(1) only mentions the LC_* family of environment variables. Additionally there is also an LC_ALL variable commonly in place which isn't described there either.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

LANG contain the setting for every categories that are not directly set by a LC_* variable. LC_ALL is used to override every LC_* and LANG and LANGUAGE, it should not be set in a normal user environment, but can be useful when you are writing a script that depend on the precise output of a internationalized command.

LANGUAGE is used to set messages languages (as LC_MESSAGES) to a multivaluated value: setting it to "fr:de:en" will use French message where they exists, if not it will use German messages, and will fallback to English one if there isn't German nor French messages.

share|improve this answer
    
Where can I find documentation about LANGUAGE? Is it mutually exclusive to LC_MESSAGES? –  aef Feb 22 '12 at 0:44
    
Everything is in the locale(7) manpage. LC_MESSAGES changes the language messages are displayed in and what an affirmative or negative answer looks like. The GNU C-library contains the gettext(3), ngettext(3), and rpmatch(3) functions to ease the use of these information. The GNU gettext family of functions also obey the environment variable LANGUAGE (containing a colon-separated list of locales) if the category is set to a valid locale other than "C". –  Rémi Feb 24 '12 at 15:08

Have a look at the manpage locale(7): it describes that LANG is a fallback setting, while LC_ALL overrides all separate LC_* settings.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.