This answer attempts to directly quote relevant standards and contains no speculation or inaccurate statements. Edits and corrections welcome as long as they cite relevant standards and authoritative sources.
Environment Variable Priority
The priority of all four variables
LANGUAGE according to applicable standards:
man 7 local:
If the second argument to setlocale(3) is an empty string, "", for the
default locale, it is determined using the following steps:
If there is a non-null environment variable LC_ALL, the value of
LC_ALL is used.
If an environment variable with the same name as one of the
categories above exists and is non-null, its value is used for
If there is a non-null environment variable LANG, the value of LANG
- Gnu Gettext Manual:
When a program looks up locale dependent values, it does this according to the following environment variables, in priority order:
- LC_xxx, according to selected locale category: LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, ...
So the currently accepted answer is inaccurate.
Environment Variable Format
From another part of the Gnu Gettext Manual:
A locale name usually has the form ‘ll_CC’. Here ‘ll’ is an ISO 639 two-letter language code, and ‘CC’ is an ISO 3166 two-letter country code.
Many locale names have an extended syntax ‘ll_CC.encoding’ that also specifies the character encoding.
Some locale names use ‘ll_CC@variant’ instead of ‘ll_CC’. The ‘@variant’ can denote any kind of characteristics that is not already implied by the language ll and the country CC.