User Tools

Site Tools


linux:linux_locales

Locale variables on linux

root@debian7:/root# locale 
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
LANG Determines the default locale in the absence of other locale related environment variables
LANGUAGE
LC_ADDRESS Convention used for formatting of street or postal addresses
LC_ALL High precedence override for locale specific behaviour (overrides all other locale variables)
LC_COLLATE Collation order
LC_CTYPE Character classification and case conversion
LC_MONETARY Monetary formatting
LC_MEASUREMENT Default measurement system used within the region
LC_MESSAGES Format of interactive words and responses
LC_NUMERIC Numeric formatting
LC_PAPER Default paper size for region
LC_RESPONSE Determines how responses (such as Yes and No) appear in the local language
LC_TELEPHONE Conventions used for representation of telephone numbers
LC_TIME Date and time formats 

<box 100% red|WARNING>Using LC_ALL is strongly discouraged as it overrides everything. Please use it only when testing and never set it in a startup file.</box>

Samples : Monday is the first day of the week

You might want to use the default en_US locale because some software doesn't play nice when locale's set to something else, but you want to have the first day of the week set to Monday, not to Sunday, like it's defined in en_US. To get this desired behaviour you can add the following to

root@debian7:/root# cat /etc/default/locale
LC_TIME="en_GB.UTF-8"

Samples : Measuring units and paper size

You might also want to change the measuring units and the paper size if you're from Europe:

root@debian7:/root# cat /etc/default/locale
LC_PAPER="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"

localedef -c -f UTF-8 -i en_US en_US.UTF-8

linux/linux_locales.txt · Last modified: 2021/01/01 21:25 (external edit)