locale: What is the LANGUAGE variable used for? (and when?)
- by seya
I am trying to understand the locales used in Linux. On my Ubuntu 11.10 system locale puts out the following:
LANG=en_DK.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC="en_DK.UTF-8"
LC_TIME="en_DK.UTF-8"
LC_COLLATE=en_GB.UTF-8
LC_MONETARY="en_DK.UTF-8"
LC_MESSAGES=en_GB.UTF-8
LC_PAPER="en_DK.UTF-8"
LC_NAME="en_DK.UTF-8"
LC_ADDRESS="en_DK.UTF-8"
LC_TELEPHONE="en_DK.UTF-8"
LC_MEASUREMENT="en_DK.UTF-8"
LC_IDENTIFICATION="en_DK.UTF-8"
LC_ALL=
(en_dk is for using international day format, continental European number formatting (1.234,56) etc.)
I think I understand what the LC_* family does, that LANG is the fallback if one of them is not set and that LC_ALL sets all of the LC_* variables to its value.
What I don't know yet, is what LANGUAGE is used for. The notation en_GB:en reminds me of the Accept-Language HTTP header. With the settings above it would mean, British English is used, if a translation for it exists. Otherwise any existing English translation (en_US, en_AU, ..., whatever) would be used.
Am I right so far?
Also what programs actually obey the LANGUAGE setting? In how far is it different from LC_MESSAGES?
Unfortunately, man locale only documents the LC_* family. And searching the web for 'linux locale LANGUAGE' or similar is a mute point. (Of course language is a word often used when talking about locales, and it may also be shown just in the output of locale without being discussed).
Does anybody of you can help me out there?