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