www.delorie.com/gnu/docs/glibc/libc_111.html   search  
 
Buy the book!


The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.3 Categories of Activities that Locales Affect

The purposes that locales serve are grouped into categories, so that a user or a program can choose the locale for each category independently. Here is a table of categories; each name is both an environment variable that a user can set, and a macro name that you can use as an argument to setlocale.

LC_COLLATE
This category applies to collation of strings (functions strcoll and strxfrm); see 5.6 Collation Functions.

LC_CTYPE
This category applies to classification and conversion of characters, and to multibyte and wide characters; see 4. Character Handling, and 6. Character Set Handling.

LC_MONETARY
This category applies to formatting monetary values; see 7.6.1.1 Generic Numeric Formatting Parameters.

LC_NUMERIC
This category applies to formatting numeric values that are not monetary; see 7.6.1.1 Generic Numeric Formatting Parameters.

LC_TIME
This category applies to formatting date and time values; see 21.4.5 Formatting Calendar Time.

LC_MESSAGES
This category applies to selecting the language used in the user interface for message translation (see section 8.2 The Uniforum approach to Message Translation; see section 8.1 X/Open Message Catalog Handling) and contains regular expressions for affirmative and negative responses.

LC_ALL
This is not an environment variable; it is only a macro that you can use with setlocale to set a single locale for all purposes. Setting this environment variable overwrites all selections by the other LC_* variables or LANG.

LANG
If this environment variable is defined, its value specifies the locale to use for all purposes except as overridden by the variables above.

When developing the message translation functions it was felt that the functionality provided by the variables above is not sufficient. For example, it should be possible to specify more than one locale name. Take a Swedish user who better speaks German than English, and a program whose messages are output in English by default. It should be possible to specify that the first choice of language is Swedish, the second German, and if this also fails to use English. This is possible with the variable LANGUAGE. For further description of this GNU extension see 8.2.1.6 User influence on gettext.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003