1LOCALEDEF(1) Linux User Manual LOCALEDEF(1)
2
3
4
6 localedef - compile locale definition files
7
9 localedef [options] outputpath
10 localedef --add-to-archive [options] compiledpath
11 localedef --delete-from-archive [options] localename ...
12 localedef --list-archive [options]
13 localedef --help
14 localedef --usage
15 localedef --version
16
18 The localedef program reads the indicated charmap and input files, com‐
19 piles them to a binary form quickly usable by the locale functions in
20 the C library (setlocale(3), localeconv(3), etc.), and places the out‐
21 put in outputpath.
22
23 The outputpath argument is interpreted as follows:
24
25 * If outputpath contains a slash character ('/'), it is interpreted as
26 the name of the directory where the output definitions are to be
27 stored. In this case, there is a separate output file for each lo‐
28 cale category (LC_TIME, LC_NUMERIC, and so on).
29
30 * If the --no-archive option is used, outputpath is the name of a sub‐
31 directory in /usr/lib/locale where per-category compiled files are
32 placed.
33
34 * Otherwise, outputpath is the name of a locale and the compiled lo‐
35 cale data is added to the archive file /usr/lib/locale/locale-ar‐
36 chive. A locale archive is a memory-mapped file which contains all
37 the system-provided locales; it is used by all localized programs
38 when the environment variable LOCPATH is not set.
39
40 In any case, localedef aborts if the directory in which it tries to
41 write locale files has not already been created.
42
43 If no charmapfile is given, the value ANSI_X3.4-1968 (for ASCII) is
44 used by default. If no inputfile is given, or if it is given as a dash
45 (-), localedef reads from standard input.
46
48 Operation-selection options
49 A few options direct localedef to do something other than compile lo‐
50 cale definitions. Only one of these options should be used at a time.
51
52 --add-to-archive
53 Add the compiledpath directories to the locale archive file.
54 The directories should have been created by previous runs of lo‐
55 caledef, using --no-archive.
56
57 --delete-from-archive
58 Delete the named locales from the locale archive file.
59
60 --list-archive
61 List the locales contained in the locale archive file.
62
63 Other options
64 Some of the following options are sensible only for certain operations;
65 generally, it should be self-evident which ones. Notice that -f and -c
66 are reversed from what you might expect; that is, -f is not the same as
67 --force.
68
69 -f charmapfile, --charmap=charmapfile
70 Specify the file that defines the character set that is used by
71 the input file. If charmapfile contains a slash character
72 ('/'), it is interpreted as the name of the character map. Oth‐
73 erwise, the file is sought in the current directory and the de‐
74 fault directory for character maps. If the environment variable
75 I18NPATH is set, $I18NPATH/charmaps/ and $I18NPATH/ are also
76 searched after the current directory. The default directory for
77 character maps is printed by localedef --help.
78
79 -i inputfile, --inputfile=inputfile
80 Specify the locale definition file to compile. The file is
81 sought in the current directory and the default directory for
82 locale definition files. If the environment variable I18NPATH
83 is set, $I18NPATH/locales/ and $I18NPATH are also searched after
84 the current directory. The default directory for locale defini‐
85 tion files is printed by localedef --help.
86
87 -u repertoirefile, --repertoire-map=repertoirefile
88 Read mappings from symbolic names to Unicode code points from
89 repertoirefile. If repertoirefile contains a slash character
90 ('/'), it is interpreted as the pathname of the repertoire map.
91 Otherwise, the file is sought in the current directory and the
92 default directory for repertoire maps. If the environment vari‐
93 able I18NPATH is set, $I18NPATH/repertoiremaps/ and $I18NPATH
94 are also searched after the current directory. The default di‐
95 rectory for repertoire maps is printed by localedef --help.
96
97 -A aliasfile, --alias-file=aliasfile
98 Use aliasfile to look up aliases for locale names. There is no
99 default aliases file.
100
101 -c, --force
102 Write the output files even if warnings were generated about the
103 input file.
104
105 -v, --verbose
106 Generate extra warnings about errors that are normally ignored.
107
108 --big-endian
109 Generate big-endian output.
110
111 --little-endian
112 Generate little-endian output.
113
114 --no-archive
115 Do not use the locale archive file, instead create outputpath as
116 a subdirectory in the same directory as the locale archive file,
117 and create separate output files for locale categories in it.
118 This is helpful to prevent system locale archive updates from
119 overwriting custom locales created with localedef.
120
121 --no-hard-links
122 Do not create hard links between installed locales.
123
124 --no-warnings=warnings
125 Comma-separated list of warnings to disable. Supported warnings
126 are ascii and intcurrsym.
127
128 --posix
129 Conform strictly to POSIX. Implies --verbose. This option cur‐
130 rently has no other effect. POSIX conformance is assumed if the
131 environment variable POSIXLY_CORRECT is set.
132
133 --prefix=pathname
134 Set the prefix to be prepended to the full archive pathname. By
135 default, the prefix is empty. Setting the prefix to foo, the
136 archive would be placed in foo/usr/lib/locale/locale-archive.
137
138 --quiet
139 Suppress all notifications and warnings, and report only fatal
140 errors.
141
142 --replace
143 Replace a locale in the locale archive file. Without this op‐
144 tion, if the locale is in the archive file already, an error oc‐
145 curs.
146
147 --warnings=warnings
148 Comma-separated list of warnings to enable. Supported warnings
149 are ascii and intcurrsym.
150
151 -?, --help
152 Print a usage summary and exit. Also prints the default paths
153 used by localedef.
154
155 --usage
156 Print a short usage summary and exit.
157
158 -V, --version
159 Print the version number, license, and disclaimer of warranty
160 for localedef.
161
163 One of the following exit values can be returned by localedef:
164
165 0 Command completed successfully.
166
167 1 Warnings or errors occurred, output files were written.
168
169 4 Errors encountered, no output created.
170
172 POSIXLY_CORRECT
173 The --posix flag is assumed if this environment variable is set.
174
175 I18NPATH
176 A colon-separated list of search directories for files.
177
179 /usr/share/i18n/charmaps
180 Usual default character map path.
181
182 /usr/share/i18n/locales
183 Usual default path for locale definition files.
184
185 /usr/share/i18n/repertoiremaps
186 Usual default repertoire map path.
187
188 /usr/lib/locale/locale-archive
189 Usual default locale archive location.
190
191 /usr/lib/locale
192 Usual default path for compiled individual locale data files.
193
194 outputpath/LC_ADDRESS
195 An output file that contains information about formatting of ad‐
196 dresses and geography-related items.
197
198 outputpath/LC_COLLATE
199 An output file that contains information about the rules for
200 comparing strings.
201
202 outputpath/LC_CTYPE
203 An output file that contains information about character class‐
204 es.
205
206 outputpath/LC_IDENTIFICATION
207 An output file that contains metadata about the locale.
208
209 outputpath/LC_MEASUREMENT
210 An output file that contains information about locale measure‐
211 ments (metric versus US customary).
212
213 outputpath/LC_MESSAGES/SYS_LC_MESSAGES
214 An output file that contains information about the language mes‐
215 sages should be printed in, and what an affirmative or negative
216 answer looks like.
217
218 outputpath/LC_MONETARY
219 An output file that contains information about formatting of
220 monetary values.
221
222 outputpath/LC_NAME
223 An output file that contains information about salutations for
224 persons.
225
226 outputpath/LC_NUMERIC
227 An output file that contains information about formatting of
228 nonmonetary numeric values.
229
230 outputpath/LC_PAPER
231 An output file that contains information about settings related
232 to standard paper size.
233
234 outputpath/LC_TELEPHONE
235 An output file that contains information about formats to be
236 used with telephone services.
237
238 outputpath/LC_TIME
239 An output file that contains information about formatting of da‐
240 ta and time values.
241
243 POSIX.1-2008.
244
246 Compile the locale files for Finnish in the UTF-8 character set and add
247 it to the default locale archive with the name fi_FI.UTF-8:
248
249 localedef -f UTF-8 -i fi_FI fi_FI.UTF-8
250
251 The next example does the same thing, but generates files into the
252 fi_FI.UTF-8 directory which can then be used by programs when the envi‐
253 ronment variable LOCPATH is set to the current directory (note that the
254 last argument must contain a slash):
255
256 localedef -f UTF-8 -i fi_FI ./fi_FI.UTF-8
257
259 locale(1), charmap(5), locale(5), repertoiremap(5), locale(7)
260
262 This page is part of release 5.07 of the Linux man-pages project. A
263 description of the project, information about reporting bugs, and the
264 latest version of this page, can be found at
265 https://www.kernel.org/doc/man-pages/.
266
267
268
269Linux 2020-04-11 LOCALEDEF(1)