5

I'm used to environment variables such as LANG and LC_*, but I recently noticed a LANGUAGE variable on my Ubuntu desktop. It's value was pt_BR:pt:en, and I'm wondering exactly what is meaning is. LANG, for one thing, was pt_BR.UTF-8, so if that first field is supposed to be the default locale/charset, it was at odds with was LANG set.

So, what's the exact meaning and format of LANGUAGE?

2 Answers 2

5

LANGUAGE determines the order of preference for user interface message localization with gettext. http://www.gnu.org/software/gettext/manual/gettext.html#The-LANGUAGE-variable

1
  • Thanks for providing the link to where this is actually defined.
    – Victor
    Jan 22, 2012 at 17:35
4

LANGUAGE serves a similar purpose to LANG and LC_MESSAGES in that it controls what language the user interface is displayed in.

The main difference between them is that while LANG and LC_MESSAGES can only take a single locale specifier, LANGUAGE can take a list of colon separated list of locale specifiers.

As an example, this would allow a user to have programs display in Catalan if available and fall back to Spanish if not before finally falling back to untranslated English, which is not possible with the other variables. In this case would be LANGUAGE="ca:es:en" (ISO 639-1 codes).

The other environment variables are set for the benefit of applications not using gettext for translation that only support the older environment variables.

Reference

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .