7

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?

1 Answer 1

4

It overrides to locale given in $LC_ALL with regards to gettext message catalogs. Otherwise, it's not used.

2
  • 1
    Interesting. However to be precise: It overrides all LC_ variables and LANG for gettext (according to the post you linked). This is important to note as LC_ALL is usually not set by default.
    – zpea
    Apr 14, 2012 at 4:24
  • Great! Thank you, @zpea and Ignacio! That cleared up things a lot for me.
    – seya
    Apr 14, 2012 at 5:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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