Content-type: text/html
locale - Displays information about locales
locale [-a|-m]
locale [-c] [-k] name...
Interfaces documented on this reference page conform to industry standards as follows:
locale: POSIX.1, XPG4
Refer to the
standards(5)
reference page for more information
about industry standards and associated tags.
Writes information about all available public locales.
Writes the names of the specified locale categories.
Writes the names and values of specified locale keywords.
Writes the names of all character map (charmap)
files that are available for specification to the
-f
option
of the
localedef
command.
Specifies one or more of the following: A locale category, such as LC_TIME A keyword, such as am_pm in a locale category The reserved word charmap, which requests the name of the character map file used to produce the current locale
The locale command without any options or arguments writes to standard output the names and values of all the current locale environment variables, such as LANG and LC_COLLATE.
The locale command with the -a or -m options displays information about available locales and character maps on your system. If the -a option is specified, locale writes the names of all available public locales. These are locales that are available to any application. If the -m option is specified, locale writes a list of the names of all available character-mapping files. These values are suitable variable values for the -f option with the localedef command.
The locale command with the name operand displays information about locale categories and keywords in the current locale. For example, the command could display information about the decimal_point keyword in the LC_NUMERIC category or information about all keywords in the LC_NUMERIC category. The name operand can be either a locale category, a keyword from a category, or the keyword charmap.
The following table shows how the -c and -k options determine the level of information displayed by the locale command with respect to locale keywords:
Options Set | Information Written to Standard Output |
None |
Value of keyword specified by the
name
operand or values of all keywords in the category specified
by the
name
operand.
|
-c |
Name of category containing the keyword specified
by the
name
operand or the name of the category
specified by the
name
operand, followed by values
of locale keywords.
|
-k | Names and values of locale keywords. |
-ck |
Name of category, followed by names and values
of locale keywords.
|
Following are the locale categories and the locale keywords that you can use in the name operand. Note that there are no keywords that you can specify in the locale command for the LC_COLLATE and LC_CTYPE categories; X/Open allows vendors to determine whether the locale command displays values for keywords in these two categories.
Locale Category | Locale Keywords |
LC_COLLATE | None. |
LC_CTYPE | None. |
CHARMAP |
charmap code_set_name mb_cur_max mb_cur_min
|
LC_MESSAGES |
yesexpr noexpr yesstr nostr
|
LC_MONETARY |
int_curr_symbol currency_symbol mon_decimal_point mon_grouping mon_thousands_sep positive_sign negative_sign int_frac_digits frac_digits p_cs_precedes p_sep_by_space n_cs_precedes n_sep_by_space p_sign_posn n_sign_posn debit_sign credit_sign left_parenthesis right_parenthesis
|
LC_NUMERIC |
decimal_point thousands_sep grouping
|
LC_TIME |
abday abmon alt_digits am_pm d_fmt d_t_fmt day era era_d_fmt era_d_t_fmt era_t_fmt era_year mon t_fmt t_fmt_ampm
|
To review locale diagnostic messages, enter the following command: % dspcat /usr/lib/nls/msg/en_US.ISO8859-1/locale.cat | more
Assume that the LANG environment variable is set to fr_FR.ISO8859-1 and the LC_MONETARY environment variable to fr_CA.ISO8859-1. The following example shows the results when you enter the locale command without options: % locale LANG=fr_FR.ISO8859-1 LC_COLLATE="fr_FR.ISO8859-1" LC_CTYPE="fr_FR.ISO8859-1" LC_MONETARY="fr_CA.ISO8859-1" LC_NUMERIC="fr_FR.ISO8859-1" LC_TIME="fr_FR.ISO8859-1" LC_MESSAGES="fr_FR.ISO8859-1" LC_ALL=
The following environment variables affect the behavior of the
locale
command:
Provides a default value for the locale category variables
that are not set or null.
If set, overrides the values of all locale variables, including
LANG.
Determines the locale for the interpretation of byte sequences
as characters (single-byte or multibyte) in input operands and files.
Determines the locale used to find the message catalog for
diagnostic messages and other text displayed by the command.
Determines the location of message catalogs for processing
of
LC_MESSAGES.
Commands: localedef(1), printf(1)
Functions: setlocale(3)
Files: locale(4)
Others: i18n_intro(5), l10n_intro(5), standards(5)
Writing Software for the International Market