Locale Definition Source File Format

Purpose

Contains one or more categories that describe a locale.

Description

A locale definition source file contains one or more categories that describe a locale. Files using this format can be converted into a locale by using the localedef command. Locales can be modified only by editing a locale definition source file and then using the localedef command again on the new source file. Locales are not affected by a locale definition source file unless the file is first converted using the localedef command.

The locale definition source file sections define categories of locale data. A source file should not contain more than one section for the same category. The following categories are supported:

Item Description
LC_COLLATE Defines character or string collation information.
LC_CTYPE Defines character classification, case conversion, and other character attributes.
LC_MESSAGES Defines the format for affirmative and negative responses.
LC_MONETARY Defines rules and symbols for formatting monetary numeric information.
LC_NUMERIC Defines a list of rules and symbols for formatting non-monetary numeric information.
LC_TIME Defines a list of rules and symbols for formatting time and date information.

The category definition consists of:

For example:

LC_CTYPE source for LC_CTYPE category END LC_CTYPE

The source for all of the categories is specified using keywords, strings, character literals, and character symbols. Each keyword identifies either a definition or a rule. The remainder of the statement containing the keyword contains the operands to the keyword. Operands are separated from the keyword by one or more blank characters. A statement may be continued on the next line by placing a / (slash) as the last character before the new-line character that terminates the line. Lines containing the comment_char entry in the first column are treated as comment lines. The default is # (pound sign).

The first category header in the file can be preceded by a line that changes the comment character. It has the following format, starting in column 1:

comment_char character

where character is the new comment character.

Blank lines and lines containing the comment character in the first position are ignored.

A character symbol begins with the < (less-than) character, followed by up to 30 non-control, non-space characters, and ends with the > (greater-than) character. For example, <A-diaeresis> is a valid character symbol. Any character symbol referenced in the source file should either be one of the portable character set symbols or should be defined in the provided character set description (charmap) source file.

A character literal is the character itself, or else a decimal, hexadecimal, or octal constant. A decimal constant is of the form:

\dxxx

where x is a decimal digit. A hexadecimal constant is of the form:

\xddd

where d is a hexadecimal digit. An octal constant is of the form:

\ddd

where d is an octal digit.

A string is a sequence of character symbols, or literals enclosed by " " (double-quotation marks). For example:

"<A-diaeresis> \d65\d120 <B>"

The explicit definition of each category in a locale definition source file is not required. When a category is undefined in a locale definition source file, it defaults to the C locale definition.

The first category header in the file can be preceded by a line that changes the escape character used in the file. It has the following format, starting in column 1:

escape_char character

where character is the new escape character.

The escape character defaults to the / (backslash).

Files

Item Description
/usr/lib/nls/loc/* Specifies locale definition source files for supported locales.
/usr/lib/nls/charmap/* Specifies character set description (charmap) source files for supported locales.