]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man1/localedef.1
Various pages: [GPL-2.0-or-later] Use SPDX-License-Identifier
[thirdparty/man-pages.git] / man1 / localedef.1
CommitLineData
869f1c65
MM
1.\" Copyright (C) 2001 Richard Braakman
2.\" Copyright (C) 2004 Alastair McKinstry
3.\" Copyright (C) 2005 Lars Wirzenius
4.\" Copyright (C) 2014 Marko Myllynen
f2efbf2f 5.\"
e4a74ca8 6.\" SPDX-License-Identifier: GPL-2.0-or-later
869f1c65
MM
7.\"
8.\" This manual page was initially written by Richard Braakman
9.\" on behalf of the Debian GNU/Linux Project and anyone else
f2efbf2f 10.\" who wants it. It was amended by Alastair McKinstry to
869f1c65
MM
11.\" explain new ISO 14652 elements, and amended further by
12.\" Lars Wirzenius to document new functionality (as of GNU
13.\" C library 2.3.5).
14.\"
1d767b55 15.TH LOCALEDEF 1 2021-03-22 "Linux" "Linux User Manual"
869f1c65
MM
16.SH NAME
17localedef \- compile locale definition files
18.SH SYNOPSIS
19.ad l
20.nh
21.B localedef
22.RI [ options ]
23.I outputpath
24.br
c27b4907 25.B "localedef \-\-add\-to\-archive"
869f1c65 26.RI [ options ]
c27b4907 27.I compiledpath
869f1c65
MM
28.br
29.B "localedef \-\-delete\-from\-archive"
30.RI [ options ]
31.IR localename " ..."
32.br
c27b4907 33.B "localedef \-\-list\-archive"
869f1c65 34.RI [ options ]
869f1c65
MM
35.br
36.B "localedef \-\-help"
37.br
38.B "localedef \-\-usage"
c27b4907
MM
39.br
40.B "localedef \-\-version"
869f1c65
MM
41.ad b
42.hy
43.SH DESCRIPTION
44The
45.B localedef
46program reads the indicated
47.I charmap
48and
49.I input
50files, compiles them to a binary form quickly usable by the
74183758
MK
51locale functions in the C library
52.RB ( setlocale (3),
53.BR localeconv (3),
f2efbf2f 54etc.), and places the output in
869f1c65 55.IR outputpath .
2a86152e 56.PP
3e4895ed
MK
57The
58.I outputpath
59argument is interpreted as follows:
60.IP * 3
869f1c65
MM
61If
62.I outputpath
3e4895ed 63contains a slash character ('/'), it is interpreted as the name of the
56b0fba4 64directory where the output definitions are to be stored.
869f1c65 65In this case, there is a separate output file for each locale category
2a9e359e 66.RI ( LC_TIME ,
3e4895ed
MK
67.IR LC_NUMERIC ,
68and so on).
69.IP *
f2efbf2f 70If the
869f1c65
MM
71.B \-\-no\-archive
72option is used,
73.I outputpath
74is the name of a subdirectory in
3e4895ed 75.I /usr/lib/locale
869f1c65 76where per-category compiled files are placed.
3e4895ed 77.IP *
f2efbf2f 78Otherwise,
869f1c65
MM
79.I outputpath
80is the name of a locale and the compiled locale data is added to the
f2efbf2f 81archive file
b49c2acb 82.IR /usr/lib/locale/locale\-archive .
3e4895ed
MK
83A locale archive is a memory-mapped file which contains all the
84system-provided locales;
85it is used by all localized programs when the environment variable
869f1c65
MM
86.B LOCPATH
87is not set.
88.PP
89In any case,
90.B localedef
91aborts if the directory in which it tries to write locale files has
92not already been created.
93.PP
94If no
95.I charmapfile
96is given, the value
cd415e73 97.I ANSI_X3.4\-1968
869f1c65
MM
98(for ASCII) is used by default.
99If no
100.I inputfile
101is given, or if it is given as a dash
3e4895ed 102(\-),
869f1c65
MM
103.B localedef
104reads from standard input.
105.SH OPTIONS
3e4895ed 106.SS Operation-selection options
f2efbf2f 107A few options direct
869f1c65 108.B localedef
3e4895ed
MK
109to do something other than compile locale definitions.
110Only one of these options should be used at a time.
869f1c65 111.TP
869f1c65 112.B \-\-add\-to\-archive
f2efbf2f 113Add the
869f1c65
MM
114.I compiledpath
115directories to the locale archive file.
f2efbf2f 116The directories should have been created by previous runs of
869f1c65 117.BR localedef ,
f2efbf2f 118using
869f1c65 119.BR \-\-no\-archive .
c27b4907
MM
120.TP
121.B \-\-delete\-from\-archive
122Delete the named locales from the locale archive file.
123.TP
124.B \-\-list\-archive
125List the locales contained in the locale archive file.
3e4895ed 126.SS Other options
2941a9b7 127Some of the following options are sensible only for certain operations;
869f1c65 128generally, it should be self-evident which ones.
8d150d79
MK
129Notice that
130.B \-f
131and
132.B \-c
133are reversed from what you might expect; that is,
134.B \-f
135is not the same as
136.BR \-\-force .
869f1c65 137.TP
53f2ec07 138.BI \-f " charmapfile" "\fR, \fP\-\-charmap=" charmapfile
03ba14f9
MM
139Specify the file that defines the character set
140that is used by the input file.
869f1c65
MM
141If
142.I charmapfile
143contains a slash character ('/'),
3e4895ed 144it is interpreted as the name of the character map.
f2efbf2f 145Otherwise, the file is sought in the current directory
869f1c65
MM
146and the default directory for character maps.
147If the environment variable
148.B I18NPATH
f2efbf2f 149is set,
3e4895ed 150.I $I18NPATH/charmaps/
869f1c65 151and
3e4895ed 152.I $I18NPATH/
869f1c65
MM
153are also searched after the current directory.
154The default directory for character maps is printed by
155.BR "localedef \-\-help" .
156.TP
53f2ec07 157.BI \-i " inputfile" "\fR, \fP\-\-inputfile=" inputfile
869f1c65 158Specify the locale definition file to compile.
3e4895ed 159The file is sought in the current directory
869f1c65
MM
160and the default directory for locale definition files.
161If the environment variable
162.B I18NPATH
f2efbf2f 163is set,
3e4895ed 164.I $I18NPATH/locales/
869f1c65 165and
3e4895ed 166.I $I18NPATH
869f1c65
MM
167are also searched after the current directory.
168The default directory for locale definition files is printed by
169.BR "localedef \-\-help" .
170.TP
28a4c58c 171.BI \-u " repertoirefile" "\fR, \fP\-\-repertoire\-map=" repertoirefile
03ba14f9 172Read mappings from symbolic names to Unicode code points from
869f1c65
MM
173.IR repertoirefile .
174If
175.I repertoirefile
176contains a slash character ('/'),
3e4895ed
MK
177it is interpreted as the pathname of the repertoire map.
178Otherwise, the file is sought in the current directory
869f1c65
MM
179and the default directory for repertoire maps.
180If the environment variable
181.B I18NPATH
f2efbf2f 182is set,
3e4895ed 183.I $I18NPATH/repertoiremaps/
869f1c65 184and
3e4895ed 185.I $I18NPATH
869f1c65
MM
186are also searched after the current directory.
187The default directory for repertoire maps is printed by
188.BR "localedef \-\-help" .
189.TP
53f2ec07 190.BI \-A " aliasfile" "\fR, \fP\-\-alias\-file=" aliasfile
f2efbf2f 191Use
869f1c65
MM
192.I aliasfile
193to look up aliases for locale names.
194There is no default aliases file.
195.TP
fb787570 196.BR \-c ", " \-\-force
869f1c65
MM
197Write the output files even if warnings were generated about the input
198file.
199.TP
fb787570 200.BR \-v ", " \-\-verbose
869f1c65
MM
201Generate extra warnings about errors that are normally ignored.
202.TP
c27b4907 203.B \-\-big\-endian
9226b361 204Generate big-endian output.
c27b4907
MM
205.TP
206.B \-\-little\-endian
9226b361 207Generate little-endian output.
c27b4907
MM
208.TP
209.B \-\-no\-archive
210Do not use the locale archive file, instead create
211.I outputpath
212as a subdirectory in the same directory as the locale archive file,
213and create separate output files for locale categories in it.
214This is helpful to prevent system locale archive updates from overwriting
215custom locales created with
216.BR localedef .
217.TP
218.B \-\-no\-hard\-links
219Do not create hard links between installed locales.
220.TP
221.BI \-\-no\-warnings= warnings
222Comma-separated list of warnings to disable.
223Supported warnings are
224.I ascii
225and
226.IR intcurrsym .
869f1c65
MM
227.TP
228.B \-\-posix
5e833e27
MK
229Conform strictly to POSIX.
230Implies
869f1c65
MM
231.BR \-\-verbose .
232This option currently has no other effect.
233POSIX conformance is assumed if the environment variable
234.B POSIXLY_CORRECT
235is set.
236.TP
c27b4907
MM
237.BI \-\-prefix= pathname
238Set the prefix to be prepended to the full archive pathname.
239By default, the prefix is empty.
240Setting the prefix to
241.IR foo ,
242the archive would be placed in
b49c2acb 243.IR foo/usr/lib/locale/locale\-archive .
c27b4907
MM
244.TP
245.B \-\-quiet
246Suppress all notifications and warnings, and report only fatal errors.
247.TP
869f1c65
MM
248.B \-\-replace
249Replace a locale in the locale archive file.
250Without this option, if the locale is in the archive file already,
251an error occurs.
252.TP
c27b4907
MM
253.BI \-\-warnings= warnings
254Comma-separated list of warnings to enable.
255Supported warnings are
256.I ascii
257and
258.IR intcurrsym .
869f1c65 259.TP
fb787570 260.BR \-? ", " \-\-help
869f1c65
MM
261Print a usage summary and exit.
262Also prints the default paths used by
263.BR localedef .
264.TP
265.B "\-\-usage"
266Print a short usage summary and exit.
267.TP
fb787570 268.BR \-V ", " \-\-version
869f1c65
MM
269Print the version number, license, and disclaimer of warranty for
270.BR localedef .
271.SH EXIT STATUS
272One of the following exit values can be returned by
273.BR localedef :
0019177e 274.TP
869f1c65
MM
275.B 0
276Command completed successfully.
277.TP
278.B 1
279Warnings or errors occurred, output files were written.
280.TP
281.B 4
282Errors encountered, no output created.
869f1c65
MM
283.SH ENVIRONMENT
284.TP
285.B POSIXLY_CORRECT
286The
287.B \-\-posix
288flag is assumed if this environment variable is set.
289.TP
290.B I18NPATH
291A colon-separated list of search directories for files.
292.SH FILES
293.TP
294.I /usr/share/i18n/charmaps
295Usual default character map path.
296.TP
297.I /usr/share/i18n/locales
298Usual default path for locale definition files.
299.TP
300.I /usr/share/i18n/repertoiremaps
301Usual default repertoire map path.
302.TP
b49c2acb 303.I /usr/lib/locale/locale\-archive
869f1c65 304Usual default locale archive location.
360d3116
MK
305.TP
306.I /usr/lib/locale
3d49eaad 307Usual default path for compiled individual locale data files.
869f1c65
MM
308.TP
309.I outputpath/LC_ADDRESS
f156df7b 310An output file that contains information about formatting of
869f1c65
MM
311addresses and geography-related items.
312.TP
313.I outputpath/LC_COLLATE
f2efbf2f 314An output file that contains information about the rules for comparing
869f1c65
MM
315strings.
316.TP
317.I outputpath/LC_CTYPE
318An output file that contains information about character classes.
319.TP
320.I outputpath/LC_IDENTIFICATION
321An output file that contains metadata about the locale.
322.TP
323.I outputpath/LC_MEASUREMENT
f2efbf2f 324An output file that contains information about locale measurements
869f1c65
MM
325(metric versus US customary).
326.TP
327.I outputpath/LC_MESSAGES/SYS_LC_MESSAGES
f2efbf2f
MK
328An output file that contains information about the language messages
329should be printed in, and what an affirmative or negative answer looks
869f1c65
MM
330like.
331.TP
332.I outputpath/LC_MONETARY
f2efbf2f 333An output file that contains information about formatting of monetary
869f1c65
MM
334values.
335.TP
336.I outputpath/LC_NAME
337An output file that contains information about salutations for persons.
338.TP
339.I outputpath/LC_NUMERIC
f2efbf2f 340An output file that contains information about formatting of nonmonetary
869f1c65
MM
341numeric values.
342.TP
343.I outputpath/LC_PAPER
f2efbf2f 344An output file that contains information about settings related to
869f1c65
MM
345standard paper size.
346.TP
347.I outputpath/LC_TELEPHONE
f2efbf2f 348An output file that contains information about formats to be used with
869f1c65
MM
349telephone services.
350.TP
351.I outputpath/LC_TIME
f2efbf2f 352An output file that contains information about formatting of data and
869f1c65
MM
353time values.
354.SH CONFORMING TO
355POSIX.1-2008.
a14af333 356.SH EXAMPLES
869f1c65 357Compile the locale files for Finnish in the UTF\-8 character set
f2efbf2f 358and add it to the default locale archive with the name
869f1c65
MM
359.BR fi_FI.UTF\-8 :
360.PP
a81c452b
MK
361.in +4n
362.EX
869f1c65 363localedef \-f UTF\-8 \-i fi_FI fi_FI.UTF\-8
a81c452b
MK
364.EE
365.in
869f1c65
MM
366.PP
367The next example does the same thing, but generates files into the
3e4895ed 368.I fi_FI.UTF\-8
869f1c65
MM
369directory which can then be used by programs when the environment
370variable
371.B LOCPATH
f2efbf2f 372is set to the current directory (note that the last argument must
869f1c65
MM
373contain a slash):
374.PP
a81c452b
MK
375.in +4n
376.EX
869f1c65 377localedef \-f UTF\-8 \-i fi_FI ./fi_FI.UTF\-8
a81c452b
MK
378.EE
379.in
d282bb24 380.SH SEE ALSO
869f1c65 381.BR locale (1),
03ba14f9 382.BR charmap (5),
869f1c65 383.BR locale (5),
03ba14f9 384.BR repertoiremap (5),
869f1c65 385.BR locale (7)