.\" Copyright (C) 1994  Jochen Hein (Hein@Student.TU-Clausthal.de)
.\" Copyright (C) 2008  Petr Baudis (pasky@suse.cz)
.\"
.\" %%%LICENSE_START(GPLv2+_SW_3_PARA)
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.\" 2008-06-17 Petr Baudis <pasky@suse.cz>
.\"     LC_TIME: Describe first_weekday and first_workday
.\"
.TH LOCALE 5 2008-06-17 "Linux" "Linux User Manual"
.SH NAME
locale \- describes a locale definition file
.SH DESCRIPTION
The
.B locale
definition files contains all the information that the
.BR localedef (1)
command needs to convert it into the binary locale database.

The definition files consist of sections which each describe a
locale category in detail.
.SS Syntax
The locale definition file starts with a header that may consist
of the following keywords:
.TP
.I <escape_char>
is followed by a character that should be used as the
escape-character for the rest of the file to mark characters that
should be interpreted in a special way.
It defaults to the backslash (\\).
.TP
.I <comment_char>
is followed by a character that will be used as the
comment-character for the rest of the file.
It defaults to the number sign (#).
.PP
The locale definition has one part for each locale category.
Each part can be copied from another existing locale or
can be defined from scratch.
If the category should be copied,
the only valid keyword in the definition is
.B copy
followed by the name of the locale which should be copied.
.\" FIXME glibc 2.2.2 added new nonstandard locale categories:
.\" LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT, LC_NAME,
.\" LC_PAPER, LC_TELEPHONE.  These need to be documented.
.SS LC_CTYPE
The definition for the
.B LC_CTYPE
category starts with the string
.I LC_CTYPE
in the first column.

There are the following keywords allowed:
.TP
.I upper
followed by a list of uppercase letters.
The letters
.B A
through
.B Z
are included automatically.
Characters also specified as
.BR cntrl ,
.BR digit ,
.BR punct ,
or
.B space
are not allowed.
.TP
.I lower
followed by a list of lowercase letters.
The letters
.B a
through
.B z
are included automatically.
Characters also specified as
.BR cntrl ,
.BR digit ,
.BR punct ,
or
.B space
are not allowed.
.TP
.I alpha
followed by a list of letters.
All character specified as either
.B upper
or
.B lower
are automatically included.
Characters also specified as
.BR cntrl ,
.BR digit ,
.BR punct ,
or
.B space
are not allowed.
.TP
.I digit
followed by the characters classified as numeric digits.
Only the
digits
.B 0
through
.B 9
are allowed.
They are included by default in this class.
.TP
.I space
followed by a list of characters defined as white-space
characters.
Characters also specified as
.BR upper ,
.BR lower ,
.BR alpha ,
.BR digit ,
.BR graph ,
or
.B xdigit
are not allowed.
The characters
.BR <space> ,
.BR <form-feed> ,
.BR <newline> ,
.BR <carriage-return> ,
.BR <tab> ,
and
.B <vertical-tab>
are automatically included.
.TP
.I cntrl
followed by a list of control characters.
Characters also specified as
.BR upper ,
.BR lower ,
.BR alpha ,
.BR digit ,
.BR punct ,
.BR graph ,
.BR print ,
or
.B xdigit
are not allowed.
.TP
.I punct
followed by a list of punctuation characters.
Characters also
specified as
.BR upper ,
.BR lower ,
.BR alpha ,
.BR digit ,
.BR cntrl ,
.BR xdigit ,
or the
.B <space>
character are not allowed.
.TP
.I graph
followed by a list of printable characters, not including the
.B <space>
character.
The characters defined as
.BR upper ,
.BR lower ,
.BR alpha ,
.BR digit ,
.BR xdigit ,
and
.B punct
are automatically included.
Characters also specified as
.B cntrl
are not allowed.
.TP
.I print
followed by a list of printable characters, including the
.B <space>
character.
The characters defined as
.BR upper ,
.BR lower ,
.BR alpha ,
.BR digit ,
.BR xdigit ,
.BR punct ,
and the
.B <space>
character are automatically included.
Characters also specified as
.B cntrl
are not allowed.
.TP
.I xdigit
followed by a list of characters classified as hexadecimal
digits.
The decimal digits must be included followed by one or
more set of six characters in ascending order.
The following
characters are included by default:
.B 0
through
.BR 9 ,
.B a
through
.BR f ,
.B A
through
.BR F .
.TP
.I blank
followed by a list of characters classified as
.BR blank .
The characters
.B <space>
and
.B <tab>
are automatically included.
.TP
.I toupper
followed by a list of mappings from lowercase to uppercase
letters.
Each mapping is a pair of a lowercase and an uppercase letter
separated with a
.B ,
and enclosed in parentheses.
The members of the list are separated
with semicolons.
.TP
.I tolower
followed by a list of mappings from uppercase to lowercase
letters.
If the keyword tolower is not present, the reverse of the
toupper list is used.
.PP
The
.B LC_CTYPE
definition ends with the string
.IR "END LC_CYTPE" .
.SS LC_COLLATE
The
.B LC_COLLATE
category defines the rules for collating characters.
Due to
limitations of libc not all POSIX-options are implemented.

The definition starts with the string
.B LC_COLLATE
in the first column.

There are the following keywords allowed:
.TP
.I collating-element
.TP
.I collating-symbol
.PP
The order-definition starts with a line:
.TP
.I order_start
.PP
followed by a list of keywords out of
.BR forward ,
.BR backward ,
or
.BR position .
The order definition consists of lines that describe the order
and is terminated with the keyword
.TP
.IR order_end .
.PP
For more details see the sources in
.I /usr/lib/nls/src
notably the examples
.BR POSIX ,
.B Example
and
.B Example2
.PP
The
.B LC_COLLATE
definition ends with the string
.IR "END LC_COLLATE" .
.SS LC_MONETARY
The definition starts with the string
.B LC_MONETARY
in the first column.

There are the following keywords allowed:
.TP
.I int_curr_symbol
followed by the international currency symbol.
This must be a
4-character string containing the international currency symbol as
defined by the ISO 4217 standard (three characters) followed by a
separator.
.TP
.I currency_symbol
followed by the local currency symbol.
.TP
.I mon_decimal_point
followed by the string that will be used as the decimal delimiter
when formatting monetary quantities.
.TP
.I mon_thousands_sep
followed by the string that will be used as a group separator
when formatting monetary quantities.
.TP
.I mon_grouping
followed by a string that describes the formatting of numeric
quantities.
.TP
.I positive_sign
followed by a string that is used to indicate a positive sign for
monetary quantities.
.TP
.I negative_sign
followed by a string that is used to indicate a negative sign for
monetary quantities.
.TP
.I int_frac_digits
followed by the number of fractional digits that should be used when
formatting with the
.BR int_curr_symbol .
.TP
.I frac_digits
followed by the number of fractional digits that should be used when
formatting with the
.BR currency_symbol .
.TP
.I p_cs_precedes
followed by an integer set to
.B 1
if the
.I currency_symbol
or
.I int_curr_symbol
should precede the formatted monetary quantity or set to
.B 0
if the symbol succeeds the value.
.TP
.I p_sep_by_space
followed by an integer.
.RS
.TP
.B 0
means that no space should be printed between the symbol and the
value.
.TP
.B 1
means that a space should be printed between the symbol and the
value.
.TP
.B 2
means that a space should be printed between the symbol and the
sign string, if adjacent.
.RE
.TP
.I n_cs_precedes
.RS
.TP
.B 0
- the symbol succeeds the value.
.TP
.B 1
- the symbol precedes the value.
.RE
.TP
.I n_sep_by_space
An integer set to
.B 0
if no space separates the
.I currency_symbol
or
.I int_curr_symbol
from the value for a negative monetary quantity, set to
.B 1
if a space separates the symbol from the value and set to
.B 2
if a space separates the symbol and the sign string, if adjacent.
.TP
.I p_sign_posn
.RS
.TP
.B 0
Parentheses enclose the quantity and the
.I currency_symbol
or
.IR int_curr_symbol .
.TP
.B 1
The sign string precedes the quantity and the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 2
The sign string succeeds the quantity and the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 3
The sign string precedes the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 4
The sign string succeeds the
.I currency_symbol
or the
.IR int_curr_symbol .
.RE
.TP
.I n_sign_posn
.RS
.TP
.B 0
Parentheses enclose the quantity and the
.I currency_symbol
or
.IR int_curr_symbol .
.TP
.B 1
The sign string precedes the quantity and the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 2
The sign string succeeds the quantity and the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 3
The sign string precedes the
.I currency_symbol
or the
.IR int_curr_symbol .
.TP
.B 4
The sign string succeeds the
.I currency_symbol
or the
.IR int_curr_symbol .
.RE
.PP
The
.B LC_MONETARY
definition ends with the string
.IR "END LC_MONETARY" .
.SS LC_NUMERIC
The definition starts with the string
.B LC_NUMERIC
in the first column.

The following keywords are allowed:
.TP
.I decimal_point
followed by the string that will be used as the decimal delimiter
when formatting numeric quantities.
.TP
.I thousands_sep
followed by the string that will be used as a group separator
when formatting numeric quantities.
.TP
.I grouping
followed by a string that describes the formatting of numeric
quantities.
.PP
The
.B LC_NUMERIC
definition ends with the string
.IR "END LC_NUMERIC" .
.SS LC_TIME
The definition starts with the string
.B LC_TIME
in the first column.

The following keywords are allowed:
.TP
.I abday
followed by a list of abbreviated weekday names.
The list starts with the first day of the week
as specified by
.I week
(Sunday by default).
.TP
.I day
followed by a list of weekday names.
The list starts with the first day of the week
as specified by
.I week
(Sunday by default).
.TP
.I abmon
followed by a list of abbreviated month names.
.TP
.I mon
followed by a list of month names.
.TP
.I am_pm
The appropriate representation of the
.B am
and
.B pm
strings.
.TP
.I d_t_fmt
The appropriate date and time format.
.TP
.I d_fmt
The appropriate date format.
.TP
.I t_fmt
The appropriate time format.
.TP
.I t_fmt_ampm
The appropriate time format when using 12h clock format.
.TP
.I week
followed by a list of three values:
The number of days in a week (by default 7),
a date of beginning of the week (by default corresponds to Sunday),
and the minimal length of the first week in year (by default 4).
Regarding the start of the week,
.B 19971130
shall be used for Sunday and
.B 19971201
shall be used for Monday.
Thus, countries using
.B 19971130
should have local Sunday name as the first day in the
.I day
list,
while countries using
.B 19971201
should have Monday translation as the first item in the
.I day
list.
.TP
.IR first_weekday " (since glibc 2.2)"
Number of the first day from the
.I day
list to be shown in calendar applications.
The default value of
.B 1
corresponds to either Sunday or Monday depending
on the value of the second
.I week
list item.
.TP
.IR first_workday " (since glibc 2.2)"
Number of the first working day from the
.I day
list.
.PP
The
.B LC_TIME
definition ends with the string
.IR "END LC_TIME" .
.SS LC_MESSAGES
The definition starts with the string
.B LC_MESSAGES
in the first column.

The following keywords are allowed:
.TP
.I yesexpr
followed by a regular expression that describes possible
yes-responses.
.TP
.I noexpr
followed by a regular expression that describes possible
no-responses.
.PP
The
.B LC_MESSAGES
definition ends with the string
.IR "END LC_MESSAGES" .

See the POSIX.2 standard for details.
.SH FILES
/usr/lib/locale/
\(em database for the current locale setting of that category
.br
/usr/lib/nls/charmap/* \(em charmap-files
.SH CONFORMING TO
POSIX.2, ISO/IEC 14652.
.SH BUGS
This manual page isn't complete.
.\" .SH AUTHOR
.\" Jochen Hein (Hein@Student.TU-Clausthal.de)
.SH SEE ALSO
.BR locale (1),
.BR localedef (1),
.BR localeconv (3),
.BR setlocale (3),
.BR charmap (5)
.SH COLOPHON
This page is part of release 3.53 of the Linux
.I man-pages
project.
A description of the project,
and information about reporting bugs,
can be found at
\%http://www.kernel.org/doc/man\-pages/.
