Improve localedef(1) manpage
Obtained from: DragonflyBSD
This commit is contained in:
parent
cadf70cee5
commit
59e611f28e
@ -30,6 +30,9 @@
|
|||||||
.\" add the following below this CDDL HEADER, with the fields enclosed by
|
.\" add the following below this CDDL HEADER, with the fields enclosed by
|
||||||
.\" brackets "[]" replaced with your own identifying information:
|
.\" brackets "[]" replaced with your own identifying information:
|
||||||
.\" Portions Copyright [yyyy] [name of copyright owner]
|
.\" Portions Copyright [yyyy] [name of copyright owner]
|
||||||
|
.\"
|
||||||
|
.\" $FreeBSD$
|
||||||
|
.\"
|
||||||
.Dd July 28, 2015
|
.Dd July 28, 2015
|
||||||
.Dt LOCALEDEF 1
|
.Dt LOCALEDEF 1
|
||||||
.Os
|
.Os
|
||||||
@ -38,123 +41,139 @@
|
|||||||
.Nd define locale environment
|
.Nd define locale environment
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl D
|
.Op Fl cDUv
|
||||||
.Op Fl c
|
|
||||||
.Op Fl v
|
|
||||||
.Op Fl U
|
|
||||||
.Op Fl f Ar charmap
|
.Op Fl f Ar charmap
|
||||||
.Op Fl w Ar widthfile
|
|
||||||
.Op Fl i Ar sourcefile
|
.Op Fl i Ar sourcefile
|
||||||
.Op Fl u Ar codeset
|
.Op Fl u Ar codeset
|
||||||
localename
|
.Op Fl w Ar widthfile
|
||||||
|
.Ar localename
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm localedef
|
.Nm
|
||||||
utility converts source definitions for locale categories
|
utility converts source definitions for locale categories
|
||||||
into a format usable by the functions and utilities whose operational behavior
|
into a format usable by the functions and utilities whose operational behavior
|
||||||
is determined by the setting of the locale environment variables; see
|
is determined by the setting of the locale environment variables; see
|
||||||
.Xr environ 5 .
|
.Xr environ 7 .
|
||||||
.Pp
|
.Pp
|
||||||
The utility reads source definitions for one or more locale categories
|
The utility reads source definitions for one or more locale categories
|
||||||
belonging to the same locale from the file named in the \fB-i\fR option (if
|
belonging to the same locale from the file named in the
|
||||||
specified) or from standard input.
|
.Fl i
|
||||||
|
option (if specified) or from standard input.
|
||||||
.Pp
|
.Pp
|
||||||
Each category source definition is identified by the corresponding environment
|
Each category source definition is identified by the corresponding environment
|
||||||
variable name and terminated by an
|
variable name and terminated by an
|
||||||
.Sy END
|
.Sy END
|
||||||
.Em category-name
|
.Em category-name
|
||||||
statement. The following categories are supported:
|
statement.
|
||||||
.Bl -tag -width LC_MONETARY
|
The following categories are supported:
|
||||||
.It LC_CTYPE
|
.Bl -tag -width ".Ev LC_MONETARY"
|
||||||
|
.It Ev LC_CTYPE
|
||||||
Defines character classification and case conversion.
|
Defines character classification and case conversion.
|
||||||
.It LC_COLLATE
|
.It Ev LC_COLLATE
|
||||||
Defines collation rules.
|
Defines collation rules.
|
||||||
.It LC_MONETARY
|
.It Ev LC_MONETARY
|
||||||
Defines the format and symbols used in formatting of monetary information.
|
Defines the format and symbols used in formatting of monetary information.
|
||||||
.It LC_NUMERIC
|
.It Ev LC_NUMERIC
|
||||||
Defines the decimal delimiter, grouping and grouping symbol for non-monetary
|
Defines the decimal delimiter, grouping and grouping symbol for non-monetary
|
||||||
numeric editing.
|
numeric editing.
|
||||||
.It LC_TIME
|
.It Ev LC_TIME
|
||||||
Defines the format and content of date and time information.
|
Defines the format and content of date and time information.
|
||||||
.It LC_MESSAGES
|
.It Ev LC_MESSAGES
|
||||||
Defines the format and values of affirmative and negative responses.
|
Defines the format and values of affirmative and negative responses.
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The following options are supported:
|
The following options are supported:
|
||||||
.Bl -tag -width xx_sourcefile
|
.Bl -tag -width indent
|
||||||
.It -D
|
.It Fl c
|
||||||
BSD-style output. Rather than the default of creating the
|
|
||||||
.Sy localename
|
|
||||||
directory and creating files like LC_CTYPE, LC_COLLATE, etc, in that directory,
|
|
||||||
the output files have the format "<localename>.<category>" and are
|
|
||||||
dumped to the current directory.
|
|
||||||
.It -c
|
|
||||||
Creates permanent output even if warning messages have been issued.
|
Creates permanent output even if warning messages have been issued.
|
||||||
.It -v
|
.It Fl D
|
||||||
Emit verbose debugging output on standard output.
|
.Dx Ns -style
|
||||||
.It -U
|
output.
|
||||||
|
Rather than the default of creating the
|
||||||
|
.Ar localename
|
||||||
|
directory and creating files like
|
||||||
|
.Pa LC_CTYPE ,
|
||||||
|
.Pa LC_COLLATE ,
|
||||||
|
etc.\& in that directory,
|
||||||
|
the output file names have the format
|
||||||
|
.Dq <localename>.<category>
|
||||||
|
and are dumped to the current directory.
|
||||||
|
.It Fl f Ar charmap
|
||||||
|
Specifies the pathname of a file containing a mapping of character symbols and
|
||||||
|
collating element symbols to actual character encodings.
|
||||||
|
This option must be specified if symbolic names (other than collating symbols
|
||||||
|
defined in a
|
||||||
|
.Sy collating-symbol
|
||||||
|
keyword) are used.
|
||||||
|
If the
|
||||||
|
.Fl f
|
||||||
|
option is not present, the default character mapping will be used.
|
||||||
|
.It Fl i Ar sourcefile
|
||||||
|
The path name of a file containing the source definitions.
|
||||||
|
If this option is not present, source definitions will be read from
|
||||||
|
standard input.
|
||||||
|
.It Fl u Ar codeset
|
||||||
|
Specifies the name of a codeset used as the target mapping of character symbols
|
||||||
|
and collating element symbols whose encoding values are defined in terms of the
|
||||||
|
ISO/IEC 10646-1:2000 standard position constant values.
|
||||||
|
See
|
||||||
|
.Sx NOTES .
|
||||||
|
.It Fl U
|
||||||
Ignore the presence of character symbols that have no matching character
|
Ignore the presence of character symbols that have no matching character
|
||||||
definition. This facilitates the use of a common locale definition file
|
definition. This facilitates the use of a common locale definition file
|
||||||
to be used across multiple encodings, even when some symbols are not
|
to be used across multiple encodings, even when some symbols are not
|
||||||
present in a given encoding.
|
present in a given encoding.
|
||||||
.It -f charmap
|
.It Fl v
|
||||||
Specifies the pathname of a file containing a mapping of character symbols and
|
Emit verbose debugging output on standard output.
|
||||||
collating element symbols to actual character encodings. This option must be
|
.It Fl w Ar widthfile
|
||||||
specified if symbolic names (other than collating symbols defined in a
|
|
||||||
.Sy collating-symbol
|
|
||||||
keyword) are used. If the
|
|
||||||
.Sy -f
|
|
||||||
option is not present, the default character mapping will be used.
|
|
||||||
.It -w widthfile
|
|
||||||
The path name of the file containing character screen width definitions.
|
The path name of the file containing character screen width definitions.
|
||||||
If not supplied, then default screen widths will be assumed, which will
|
If not supplied, then default screen widths will be assumed, which will
|
||||||
generally not account for East Asian encodings requiring more than a single
|
generally not account for East Asian encodings requiring more than a single
|
||||||
character cell to display, nor for combining or accent marks that occupy
|
character cell to display, nor for combining or accent marks that occupy
|
||||||
no additional screen width.
|
no additional screen width.
|
||||||
.It -i sourcefile
|
|
||||||
The path name of a file containing the source definitions. If this option is
|
|
||||||
not present, source definitions will be read from standard input.
|
|
||||||
.It -u codeset
|
|
||||||
Specifies the name of a codeset used as the target mapping of character symbols
|
|
||||||
and collating element symbols whose encoding values are defined in terms of the
|
|
||||||
ISO/IEC 10646-1: 2000 standard position constant values. See NOTES.
|
|
||||||
.El
|
.El
|
||||||
.Pp
|
.Pp
|
||||||
The following operands are required:
|
The following operands are required:
|
||||||
.Bl -tag -width localename
|
.Bl -tag -width ".Ar localename"
|
||||||
.It localename
|
.It Ar localename
|
||||||
Identifies the locale. If the name contains one or more slash characters,
|
Identifies the locale.
|
||||||
|
If the name contains one or more slash characters,
|
||||||
.Ar localename
|
.Ar localename
|
||||||
will be interpreted as a path name where the created locale
|
will be interpreted as a path name where the created locale
|
||||||
definitions will be stored. This capability may be restricted to users with
|
definitions will be stored.
|
||||||
appropriate privileges. (As a consequence of specifying one
|
This capability may be restricted to users with appropriate privileges.
|
||||||
|
(As a consequence of specifying one
|
||||||
.Ar localename ,
|
.Ar localename ,
|
||||||
although several categories can be processed in one execution, only categories
|
although several categories can be processed in one execution, only categories
|
||||||
belonging to the same locale can be processed.)
|
belonging to the same locale can be processed.)
|
||||||
.El
|
.El
|
||||||
.Sh OUTPUT
|
.Sh OUTPUT
|
||||||
.Nm
|
.Nm
|
||||||
creates a directory of files that represents the locale's data, unless instructed
|
creates a directory of files that represents the locale's data,
|
||||||
otherwise by the
|
unless instructed otherwise by the
|
||||||
.Sy -D
|
.Fl D (
|
||||||
(BSD output) option. The contants of this directory should generally be
|
.Dx
|
||||||
copied into the appropriate subdirectory of /usr/share/locale in order the
|
output) option.
|
||||||
definitions to be visible to programs linked with libc.
|
The contants of this directory should generally be copied into the
|
||||||
|
appropriate subdirectory of
|
||||||
|
.Pa /usr/share/locale
|
||||||
|
in order the definitions to be visible to programs linked with libc.
|
||||||
.Sh ENVIRONMENT
|
.Sh ENVIRONMENT
|
||||||
See
|
See
|
||||||
.Xr Benviron 5
|
.Xr environ 7
|
||||||
for definitions of the following environment variables that affect the execution of
|
for definitions of the following environment variables that affect the
|
||||||
|
execution of
|
||||||
.Nm :
|
.Nm :
|
||||||
.Sy LANG ,
|
.Ev LANG ,
|
||||||
.Sy LC_ALL ,
|
.Ev LC_ALL ,
|
||||||
.Sy LC_COLLATE ,
|
.Ev LC_COLLATE ,
|
||||||
.Sy LC_CTYPE ,
|
.Ev LC_CTYPE ,
|
||||||
.Sy LC_MESSAGES ,
|
.Ev LC_MESSAGES ,
|
||||||
.Sy LC_MONETARY ,
|
.Ev LC_MONETARY ,
|
||||||
.Sy LC_MUMERIC ,
|
.Ev LC_MUMERIC ,
|
||||||
.Sy LC_TIME ,
|
.Ev LC_TIME ,
|
||||||
and
|
and
|
||||||
.Sy NLSPATH .
|
.Ev NLSPATH .
|
||||||
.Sh EXIT STATUS
|
.Sh EXIT STATUS
|
||||||
The following exit values are returned:
|
The following exit values are returned:
|
||||||
.Bl -tag -width XX
|
.Bl -tag -width XX
|
||||||
@ -176,48 +195,53 @@ If an error is detected, no permanent output will be created.
|
|||||||
.Xr iconv_open 3 ,
|
.Xr iconv_open 3 ,
|
||||||
.Xr nl_langinfo 3 ,
|
.Xr nl_langinfo 3 ,
|
||||||
.Xr strftime 3 ,
|
.Xr strftime 3 ,
|
||||||
.Xr environ 5
|
.Xr environ 7
|
||||||
.Sh WARNINGS
|
.Sh WARNINGS
|
||||||
If warnings occur, permanent output will be created if the
|
If warnings occur, permanent output will be created if the
|
||||||
.Sy -c
|
.Fl c
|
||||||
option was specified. The following conditions will cause warning messages to be issued:
|
option was specified.
|
||||||
.Bl -tag -width X
|
The following conditions will cause warning messages to be issued:
|
||||||
.It *
|
.Bl -bullet
|
||||||
|
.It
|
||||||
If a symbolic name not found in the
|
If a symbolic name not found in the
|
||||||
.Em charmap
|
.Pa charmap
|
||||||
file is used for the descriptions of the
|
file is used for the descriptions of the
|
||||||
.Sy LC_CTYPE
|
.Sy LC_CTYPE
|
||||||
or
|
or
|
||||||
.Sy LC_COLLATE
|
.Sy LC_COLLATE
|
||||||
categories (for other categories, this will be an error condition).
|
categories (for other categories, this will be an error condition).
|
||||||
.It *
|
.It
|
||||||
If optional keywords not supported by the implementation are present in the
|
If optional keywords not supported by the implementation are present in the
|
||||||
source.
|
source.
|
||||||
.El
|
.El
|
||||||
.Sh NOTES
|
.Sh NOTES
|
||||||
When the
|
When the
|
||||||
.Sy -u
|
.Fl u
|
||||||
option is used, the
|
option is used, the
|
||||||
.Em codeset
|
.Ar codeset
|
||||||
option-argument is interpreted as a name of a codeset to which the
|
option-argument is interpreted as a name of a codeset to which the
|
||||||
ISO/IEC 10646-1: 2000 standard position constant values are converted. Both the
|
ISO/IEC 10646-1:2000 standard position constant values are converted.
|
||||||
ISO/IEC 10646-1: 2000 standard position constant values and other formats (decimal,
|
Both the ISO/IEC 10646-1:2000 standard position constant values and
|
||||||
hexadecimal, or octal) are valid as encoding values within the charmap file. The
|
other formats (decimal, hexadecimal, or octal) are valid as encoding
|
||||||
codeset can be any codeset that is supported by the \fBiconv_open\fR(3C) function
|
values within the charmap file.
|
||||||
on the system.
|
The
|
||||||
|
.Ar codeset
|
||||||
|
can be any codeset that is supported by the
|
||||||
|
.Fn iconv_open 3
|
||||||
|
function.
|
||||||
.Pp
|
.Pp
|
||||||
When conflicts occur between the charmap specification of
|
When conflicts occur between the charmap specification of
|
||||||
.Em codeset ,
|
.Ar codeset ,
|
||||||
.Em mb_cur_max ,
|
.Em mb_cur_max ,
|
||||||
or
|
or
|
||||||
.Em mb_cur_min
|
.Em mb_cur_min
|
||||||
and the corresponding value for the codeset represented by the
|
and the corresponding value for the codeset represented by the
|
||||||
.Sy -u
|
.Fl u
|
||||||
option-argument
|
option-argument
|
||||||
.Em codeset ,
|
.Ar codeset ,
|
||||||
the
|
the
|
||||||
.Nm
|
.Nm
|
||||||
utility fails as an error.
|
utility fails with an error.
|
||||||
.Pp
|
.Pp
|
||||||
When conflicts occur between the charmap encoding values specified for symbolic
|
When conflicts occur between the charmap encoding values specified for symbolic
|
||||||
names of characters of the portable character set and the character encoding
|
names of characters of the portable character set and the character encoding
|
||||||
@ -225,13 +249,13 @@ values defined by the US-ASCII, the result is unspecified.
|
|||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Nm
|
.Nm
|
||||||
first appeared in
|
first appeared in
|
||||||
.Dx
|
.Dx 4.3 .
|
||||||
4.4. It was ported from Illumos from the point
|
It was ported from Illumos from the point
|
||||||
.An Garrett D'Amore
|
.An Garrett D'Amore
|
||||||
.Aq garrett@nexenta.com
|
.Aq Mt garrett@nexenta.com
|
||||||
added multibyte support (October 2010).
|
added multibyte support (October 2010).
|
||||||
.An John Marino
|
.An John Marino
|
||||||
.Aq draco@marino.st
|
.Aq Mt draco@marino.st
|
||||||
provided the alternations necessary to compile cleanly on
|
provided the alternations necessary to compile cleanly on
|
||||||
.Dx
|
.Dx
|
||||||
as well as altered libc to use the new collation (the changes were also based
|
as well as altered libc to use the new collation (the changes were also based
|
||||||
|
Loading…
Reference in New Issue
Block a user