1LOCALEDEF(1)                   Linux User Manual                  LOCALEDEF(1)
2
3
4

NAME

6       localedef - compile locale definition files
7

SYNOPSIS

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

DESCRIPTION

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

OPTIONS

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.
66
67       -f charmapfile, --charmap=charmapfile
68              Specify the file that defines the character set that is used  by
69              the  input  file.   If  charmapfile  contains  a slash character
70              ('/'), it is interpreted as the name of the character map.  Oth‐
71              erwise,  the file is sought in the current directory and the de‐
72              fault directory for character maps.  If the environment variable
73              I18NPATH  is  set,  $I18NPATH/charmaps/  and $I18NPATH/ are also
74              searched after the current directory.  The default directory for
75              character maps is printed by localedef --help.
76
77       -i inputfile, --inputfile=inputfile
78              Specify  the  locale  definition  file  to compile.  The file is
79              sought in the current directory and the  default  directory  for
80              locale  definition  files.  If the environment variable I18NPATH
81              is set, $I18NPATH/locales/ and $I18NPATH are also searched after
82              the current directory.  The default directory for locale defini‐
83              tion files is printed by localedef --help.
84
85       -u repertoirefile, --repertoire-map=repertoirefile
86              Read mappings from symbolic names to Unicode  code  points  from
87              repertoirefile.   If  repertoirefile  contains a slash character
88              ('/'), it is interpreted as the pathname of the repertoire  map.
89              Otherwise,  the  file is sought in the current directory and the
90              default directory for repertoire maps.  If the environment vari‐
91              able  I18NPATH  is  set, $I18NPATH/repertoiremaps/ and $I18NPATH
92              are also searched after the current directory.  The default  di‐
93              rectory for repertoire maps is printed by localedef --help.
94
95       -A aliasfile, --alias-file=aliasfile
96              Use  aliasfile to look up aliases for locale names.  There is no
97              default aliases file.
98
99       --prefix=pathname
100              Set the prefix to be prepended to the full archive pathname.  By
101              default,  the  prefix  is empty.  Setting the prefix to foo, the
102              archive would be placed in foo/usr/lib/locale/locale-archive.
103
104       -c, --force
105              Write the output files even if warnings were generated about the
106              input file.
107
108       -v, --verbose
109              Generate extra warnings about errors that are normally ignored.
110
111       --quiet
112              Suppress  all  notifications and warnings, and report only fatal
113              errors.
114
115       --posix
116              Conform strictly to POSIX.  Implies --verbose.  This option cur‐
117              rently has no other effect.  POSIX conformance is assumed if the
118              environment variable POSIXLY_CORRECT is set.
119
120       --replace
121              Replace a locale in the locale archive file.  Without  this  op‐
122              tion, if the locale is in the archive file already, an error oc‐
123              curs.
124
125       --no-archive
126              Do not use the locale archive file, instead create outputpath as
127              a subdirectory in the same directory as the locale archive file,
128              and create separate output files for locale  categories  in  it.
129              This  is  helpful  to prevent system locale archive updates from
130              overwriting custom locales created with localedef.
131
132       -?, --help
133              Print a usage summary and exit.  Also prints the  default  paths
134              used by localedef.
135
136       --usage
137              Print a short usage summary and exit.
138
139       -V, --version
140              Print  the  version  number, license, and disclaimer of warranty
141              for localedef.
142

EXIT STATUS

144       One of the following exit values can be returned by localedef:
145
146          0         Command completed successfully.
147
148          1         Warnings or errors occurred, output files were written.
149
150          4         Errors encountered, no output created.
151

ENVIRONMENT

153       POSIXLY_CORRECT
154              The --posix flag is assumed if this environment variable is set.
155
156       I18NPATH
157              A colon-separated list of search directories for files.
158

FILES

160       /usr/share/i18n/charmaps
161              Usual default character map path.
162
163       /usr/share/i18n/locales
164              Usual default path for locale definition files.
165
166       /usr/share/i18n/repertoiremaps
167              Usual default repertoire map path.
168
169       /usr/lib/locale/locale-archive
170              Usual default locale archive location.
171
172       /usr/lib/locale
173              Usual default path for compiled individual locale data files.
174
175       outputpath/LC_ADDRESS
176              An output file that contains information about formatting of ad‐
177              dresses and geography-related items.
178
179       outputpath/LC_COLLATE
180              An  output  file  that  contains information about the rules for
181              comparing strings.
182
183       outputpath/LC_CTYPE
184              An output file that contains information about character  class‐
185              es.
186
187       outputpath/LC_IDENTIFICATION
188              An output file that contains metadata about the locale.
189
190       outputpath/LC_MEASUREMENT
191              An  output  file that contains information about locale measure‐
192              ments (metric versus US customary).
193
194       outputpath/LC_MESSAGES/SYS_LC_MESSAGES
195              An output file that contains information about the language mes‐
196              sages  should be printed in, and what an affirmative or negative
197              answer looks like.
198
199       outputpath/LC_MONETARY
200              An output file that contains  information  about  formatting  of
201              monetary values.
202
203       outputpath/LC_NAME
204              An  output  file that contains information about salutations for
205              persons.
206
207       outputpath/LC_NUMERIC
208              An output file that contains  information  about  formatting  of
209              nonmonetary numeric values.
210
211       outputpath/LC_PAPER
212              An  output file that contains information about settings related
213              to standard paper size.
214
215       outputpath/LC_TELEPHONE
216              An output file that contains information  about  formats  to  be
217              used with telephone services.
218
219       outputpath/LC_TIME
220              An output file that contains information about formatting of da‐
221              ta and time values.
222

CONFORMING TO

224       POSIX.1-2008.
225

EXAMPLE

227       Compile the locale files for Finnish in the UTF-8 character set and add
228       it to the default locale archive with the name fi_FI.UTF-8:
229
230           localedef -f UTF-8 -i fi_FI fi_FI.UTF-8
231
232       The  next  example  does  the  same thing, but generates files into the
233       fi_FI.UTF-8 directory which can then be used by programs when the envi‐
234       ronment variable LOCPATH is set to the current directory (note that the
235       last argument must contain a slash):
236
237           localedef -f UTF-8 -i fi_FI ./fi_FI.UTF-8
238

SEE ALSO

240       locale(1), charmap(5), locale(5), repertoiremap(5), locale(7)
241

COLOPHON

243       This page is part of release 4.16 of the Linux  man-pages  project.   A
244       description  of  the project, information about reporting bugs, and the
245       latest    version    of    this    page,    can     be     found     at
246       https://www.kernel.org/doc/man-pages/.
247
248
249
250Linux                             2017-09-15                      LOCALEDEF(1)
Impressum