Ubuntu – Understanding the LANGUAGE Environment Variable

localizationUbuntuubuntu-12.04

For setting locale in Ubuntu, what does the LANGUAGE environment variable mean?

It is not defined in Ubuntu Community Docs or on man 1 locale.

Related question: In Ubuntu, what is the difference between en_US:utf8 and en_US: when setting LANGUAGE

Best Answer

The LANG environment variable determines the language in which software programs communicate with the user.

More details are here: Ubuntu Wiki - Environment Variables

For Language, Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called LANGUAGE. GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for the purpose of message handling, but you still need to have LANG (or LC_ALL) set to the primary language; This is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set LANGUAGE=sv:de while leaving LANG=sv_SE.

More details can be found here: GNU gettext manual - The LANGUAGE variable