The system locale determines how numbers, dates, time, and currency are displayed, in addition to the default system language and character encoding. Programs can access the locale information to display the users' prefered language, date format, and more.
You can type "locale" at the command prompt to check your locale. A typical result would look like this:
$ locale 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_ALL= $
The string "en_US.UTF-8" reads like so: English language, US territory, UTF-8 character encoding. The British version of same would look like "en_GB.UTF-8". Most Russians would use "ru_RU.UTF-8". I use "he_IL.UTF-8"- can you guess where I am?
The meaning of each field is as follows:
LC_CTYPE
LC_CTYPE is used for character case converstion and classification. Programs typically use this value for determining regular expression matching, case-sensitive string comparison, and character conversion.
LC_NUMERIC
The LC_NUMERIC field determines the display properties of non-monetary, non-time, and non-telephone numerical values. For instance, while in North America one million is typically written out as 1,000,000 the Hindu would prefer 10,00,000 and the Russian would prefer 1000000.
LC_TIME
LC_TIME specifies the date and time formats. With this the user can specify if he wants the the month shown before the date, as Americans prefer, or the day shown before the month, as the rest of the world prefers. All other aspects of the date and time formats can be altered, such as am/pm display or 24 hour clock.
LC_COLLATE
LC_COLLATE is usually set by picky system administrators for very specific purposes. This field determines collation order for regex matching. While in English the letters are arranged from A to Z and then from a to z, there are those who prefer to order the letters like such: A, a, B, b, C, c and so forth. This field also determins the range of certain expressions, such as A-Z. In the first example, A-Z included all of the uppercase letters. In the second example, A-Z included all the letters exept for lowercase z.
LC_MONETARY
The LC_MONETARY ifield is one of the more common fields for a user to set. It controls, amoung other things, the currency symbol that the system uses and the way negative values are handled.
LC_MESSAGES
LC_MESSAGES lets the user recieve system messages in his own language. This is especially important in GUI applications and windows managers.
LC_PAPER
LC_PAPER lets the user inform the computer about the size and type of paper in the printers attached to the system. He can specify his preferences here, such as portrait or landscape printing, and double-sided printing if the printer supports it.
LC_NAME
With LC_NAME a user can inform the machine as to his preference for displaying names. Examples include "First Last" ; "Last, First" ; "Title First Last"
LC_ADDRESS
Through the LC_ADDRESS field the user can specify his address display format preference. This is important as not every country in the world is broken own into individual states, like some narrow-minded programmers assume.
LC_TELEPHONE
With the LC_TELEPHONE filed users can specify thier prefered telephone number formating.
LC_MEASUREMENT
LC_MEASUREMENT lets users specify what system of measurement they prefer. For instance, while I personally prefer to measure distance in kilometers there are those who only understand miles.
If all the locale values are set to the same value, then the user could simply set LC_ALL to his prefered locale. Often, users will want to customize one or more fields, so to do so more easily they set all the fields individually. A common example of this is the adding of the @euro option to the currency field. In countries where the euro has replaced the currency that was in use when the standard was formed, the locale can be modified as such:
$ locale LC_MONETARY="el_GR.UTF-8@euro" $
In fact, the only part of the locale setting that is mandatory is the language part. Territory settings and character encodings are optional but highly recommended. A Frenchman in France would be very surprised to get Canadian reports, because he left off the FR territory declaration.
