1LOCALEDEF(1) Linux User Manual LOCALEDEF(1)
2
3
4
6 localedef - compile locale definition files
7
9 localedef [options] outputpath
10 localedef --list-archive [options]
11 localedef --delete-from-archive [options] localename ...
12 localedef --add-to-archive [options] compiledpath
13 localedef --version
14 localedef --help
15 localedef --usage
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 --delete-from-archive
53 Delete the named locales from the locale archive file.
54
55 --list-archive
56 List the locales contained in the locale archive file.
57
58 --add-to-archive
59 Add the compiledpath directories to the locale archive file.
60 The directories should have been created by previous runs of lo‐
61 caledef, using --no-archive.
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 --prefix=pathname
102 Set the prefix to be prepended to the full archive pathname. By
103 default, the prefix is empty. Setting the prefix to foo, the
104 archive would be placed in foo/usr/lib/locale/locale-archive.
105
106 -c, --force
107 Write the output files even if warnings were generated about the
108 input file.
109
110 -v, --verbose
111 Generate extra warnings about errors that are normally ignored.
112
113 --quiet
114 Suppress all notifications and warnings, and report only fatal
115 errors.
116
117 --posix
118 Conform strictly to POSIX. Implies --verbose. This option cur‐
119 rently has no other effect. POSIX conformance is assumed if the
120 environment variable POSIXLY_CORRECT is set.
121
122 --replace
123 Replace a locale in the locale archive file. Without this op‐
124 tion, if the locale is in the archive file already, an error oc‐
125 curs.
126
127 --no-archive
128 Do not use the locale archive file, instead create outputpath as
129 a subdirectory in the same directory as the locale archive file,
130 and create separate output files for locale categories in it.
131 This is helpful to prevent system locale archive updates from
132 overwriting custom locales created with localedef.
133
134 -?, --help
135 Print a usage summary and exit. Also prints the default paths
136 used by localedef.
137
138 --usage
139 Print a short usage summary and exit.
140
141 -V, --version
142 Print the version number, license, and disclaimer of warranty
143 for localedef.
144
146 One of the following exit values can be returned by localedef:
147
148 0 Command completed successfully.
149
150 1 Warnings or errors occurred, output files were written.
151
152 4 Errors encountered, no output created.
153
155 POSIXLY_CORRECT
156 The --posix flag is assumed if this environment variable is set.
157
158 I18NPATH
159 A colon-separated list of search directories for files.
160
162 /usr/share/i18n/charmaps
163 Usual default character map path.
164
165 /usr/share/i18n/locales
166 Usual default path for locale definition files.
167
168 /usr/share/i18n/repertoiremaps
169 Usual default repertoire map path.
170
171 /usr/lib/locale/locale-archive
172 Usual default locale archive location.
173
174 /usr/lib/locale
175 Usual default path for compiled individual locale data files.
176
177 outputpath/LC_ADDRESS
178 An output file that contains information about formatting of ad‐
179 dresses and geography-related items.
180
181 outputpath/LC_COLLATE
182 An output file that contains information about the rules for
183 comparing strings.
184
185 outputpath/LC_CTYPE
186 An output file that contains information about character class‐
187 es.
188
189 outputpath/LC_IDENTIFICATION
190 An output file that contains metadata about the locale.
191
192 outputpath/LC_MEASUREMENT
193 An output file that contains information about locale measure‐
194 ments (metric versus US customary).
195
196 outputpath/LC_MESSAGES/SYS_LC_MESSAGES
197 An output file that contains information about the language mes‐
198 sages should be printed in, and what an affirmative or negative
199 answer looks like.
200
201 outputpath/LC_MONETARY
202 An output file that contains information about formatting of
203 monetary values.
204
205 outputpath/LC_NAME
206 An output file that contains information about salutations for
207 persons.
208
209 outputpath/LC_NUMERIC
210 An output file that contains information about formatting of
211 nonmonetary numeric values.
212
213 outputpath/LC_PAPER
214 An output file that contains information about settings related
215 to standard paper size.
216
217 outputpath/LC_TELEPHONE
218 An output file that contains information about formats to be
219 used with telephone services.
220
221 outputpath/LC_TIME
222 An output file that contains information about formatting of da‐
223 ta and time values.
224
226 POSIX.1-2008.
227
229 Compile the locale files for Finnish in the UTF-8 character set and add
230 it to the default locale archive with the name fi_FI.UTF-8:
231
232 localedef -f UTF-8 -i fi_FI fi_FI.UTF-8
233
234 The next example does the same thing, but generates files into the
235 fi_FI.UTF-8 directory which can then be used by programs when the envi‐
236 ronment variable LOCPATH is set to the current directory (note that the
237 last argument must contain a slash):
238
239 localedef -f UTF-8 -i fi_FI ./fi_FI.UTF-8
240
242 locale(1), charmap(5), locale(5), repertoiremap(5), locale(7)
243
245 This page is part of release 5.02 of the Linux man-pages project. A
246 description of the project, information about reporting bugs, and the
247 latest version of this page, can be found at
248 https://www.kernel.org/doc/man-pages/.
249
250
251
252Linux 2019-03-06 LOCALEDEF(1)