]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man5/locale.5
locale.5: Document LC_ADDRESS
[thirdparty/man-pages.git] / man5 / locale.5
1 .\" Copyright (C) 1994 Jochen Hein (Hein@Student.TU-Clausthal.de)
2 .\" Copyright (C) 2008 Petr Baudis (pasky@suse.cz)
3 .\" Copyright (C) 2014 Michael Kerrisk <mtk@manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(GPLv2+_SW_3_PARA)
6 .\" This program is free software; you can redistribute it and/or modify
7 .\" it under the terms of the GNU General Public License as published by
8 .\" the Free Software Foundation; either version 2 of the License, or
9 .\" (at your option) any later version.
10 .\"
11 .\" This program is distributed in the hope that it will be useful,
12 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
13 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 .\" GNU General Public License for more details.
15 .\"
16 .\" You should have received a copy of the GNU General Public
17 .\" License along with this manual; if not, see
18 .\" <http://www.gnu.org/licenses/>.
19 .\" %%%LICENSE_END
20 .\"
21 .\" 2008-06-17 Petr Baudis <pasky@suse.cz>
22 .\" LC_TIME: Describe first_weekday and first_workday
23 .\"
24 .TH LOCALE 5 2014-03-03 "Linux" "Linux User Manual"
25 .SH NAME
26 locale \- describes a locale definition file
27 .SH DESCRIPTION
28 The
29 .B locale
30 definition files contains all the information that the
31 .BR localedef (1)
32 command needs to convert it into the binary locale database.
33
34 The definition files consist of sections which each describe a
35 locale category in detail.
36 .SS Syntax
37 The locale definition file starts with a header that may consist
38 of the following keywords:
39 .TP
40 .I <escape_char>
41 is followed by a character that should be used as the
42 escape-character for the rest of the file to mark characters that
43 should be interpreted in a special way.
44 It defaults to the backslash (\\).
45 .TP
46 .I <comment_char>
47 is followed by a character that will be used as the
48 comment-character for the rest of the file.
49 It defaults to the number sign (#).
50 .PP
51 The locale definition has one part for each locale category.
52 Each part can be copied from another existing locale or
53 can be defined from scratch.
54 If the category should be copied,
55 the only valid keyword in the definition is
56 .B copy
57 followed by the name of the locale which should be copied.
58 .\" FIXME glibc 2.2.2 added new nonstandard locale categories:
59 .\" LC_ADDRESS, LC_IDENTIFICATION.
60 .\" These need to be documented.
61 .SS Locale category sections
62 The following category sections are defined by POSIX:
63 .IP * 3
64 .B LC_CTYPE
65 .IP *
66 .B LC_COLLATE
67 .IP *
68 .B LC_MESSAGES
69 .IP *
70 .B LC_MONETARY
71 .IP *
72 .B LC_NUMERIC
73 .IP *
74 .B LC_TIME
75 .PP
76 In addition, since version 2.2,
77 the GNU C library supports the following nonstandard categories:
78 .IP * 3
79 .B LC_ADDRESS
80 .IP *
81 .B LC_IDENTIFICATION
82 .IP *
83 .B LC_MEASUREMENT
84 .IP *
85 .B LC_NAME
86 .IP *
87 .B LC_PAPER
88 .IP *
89 .B LC_TELEPHONE
90 .SS LC_ADDRESS
91 The definition for the
92 .B LC_ADDRESS
93 category starts with the string
94 .I LC_ADDRESS
95 in the first column.
96
97 The following keywords are allowed:
98 .\" Thanks to the kind folk who wrote localedata/locales/uk_UA
99 .TP
100 .I postal_fmt
101 followed by a string containing field descriptors that define
102 the format used for postal addresses in the locale.
103 The following field descriptors are recognized:
104 .\" From localedata/locales/uk_UA:
105 .RS
106 .\" .TP
107 .\" %n
108 .\" BUG: %l escape sequence from ISO/IEC 14652:2002 is not supported
109 .\" by glibc
110 .\" Person's name, possibly constructed with the
111 .\" .B LC_NAME
112 .\" .I name_fmt
113 .\" keyword.
114 .TP
115 %a
116 Care of person, or organization.
117 .TP
118 %f
119 Firm name.
120 .TP
121 %d
122 Department name.
123 .TP
124 %b
125 Building name.
126 .TP
127 %s
128 Street or block (e.g., Japanese) name.
129 .TP
130 %h
131 House number or designation.
132 .TP
133 %N
134 Insert an end-of-line if the previous descriptor's value was not an empty
135 string; otherwise ignore.
136 .TP
137 %t
138 Insert a space if the previous descriptor's value was not an empty string;
139 otherwise ignore.
140 .TP
141 %r
142 Room number, door designation.
143 .TP
144 %e
145 Floor number.
146 .TP
147 %C
148 Country designation, from the <country_post> keyword.
149 .\" .TP
150 .\" %l
151 .\" BUG: %l escape sequence from ISO/IEC 14652:2002 is not
152 .\" supported by glibc
153 .\" Local township within town or city.
154 .TP
155 %z
156 Zip number, postal code.
157 .TP
158 %T
159 Town, city.
160 .TP
161 %S
162 State, province, or prefecture.
163 .TP
164 %c
165 Country, as taken from data record.
166 .PP
167 Each field descriptor may have an \(aqR\(aq after
168 the \(aq%\(aq to specify that the
169 information is taken from a Romanized version string of the
170 entity.
171 .RE
172
173 .TP
174 .I country_name
175 followed by the country name in the language of the current document
176 (e.g., "Deutschland for the
177 .IR de_DE
178 locale).
179 .TP
180 .I country_post
181 followed by the abbreviation of the country (see CERT_MAILCODES).
182 .TP
183 .I country_ab2
184 followed by the two-letter abbreviation of the country (ISO 3166).
185 .TP
186 .I country_ab3
187 followed by the three-letter abbreviation of the country (ISO 3166).
188 .TP
189 .I country_num
190 followed by the numeric country code (ISO 3166).
191 .TP
192 .I country_car
193 followed by the code for the country car number.
194 .TP
195 .I country_isbn
196 followed by the ISBN code (for books).
197 .TP
198 .I lang_name
199 followed by the language name in the language of the current document.
200 .TP
201 .I lang_ab
202 followed by the two-letter abbreviation of the language (ISO 639).
203 .TP
204 .I lang_term
205 followed by the three-letter abbreviation of the language (ISO 639-2).
206 .TP
207 .I lang_lib
208 followed by the three-letter abbreviation of the language for
209 library use (ISO 639-2)
210 .PP
211 The
212 .B LC_ADDRESS
213 definition ends with the string
214 .IR "END LC_ADDRESS" .
215 .SS LC_CTYPE
216 The definition for the
217 .B LC_CTYPE
218 category starts with the string
219 .I LC_CTYPE
220 in the first column.
221
222 The following keywords are allowed:
223 .TP
224 .I upper
225 followed by a list of uppercase letters.
226 The letters
227 .B A
228 through
229 .B Z
230 are included automatically.
231 Characters also specified as
232 .BR cntrl ,
233 .BR digit ,
234 .BR punct ,
235 or
236 .B space
237 are not allowed.
238 .TP
239 .I lower
240 followed by a list of lowercase letters.
241 The letters
242 .B a
243 through
244 .B z
245 are included automatically.
246 Characters also specified as
247 .BR cntrl ,
248 .BR digit ,
249 .BR punct ,
250 or
251 .B space
252 are not allowed.
253 .TP
254 .I alpha
255 followed by a list of letters.
256 All character specified as either
257 .B upper
258 or
259 .B lower
260 are automatically included.
261 Characters also specified as
262 .BR cntrl ,
263 .BR digit ,
264 .BR punct ,
265 or
266 .B space
267 are not allowed.
268 .TP
269 .I digit
270 followed by the characters classified as numeric digits.
271 Only the
272 digits
273 .B 0
274 through
275 .B 9
276 are allowed.
277 They are included by default in this class.
278 .TP
279 .I space
280 followed by a list of characters defined as white-space
281 characters.
282 Characters also specified as
283 .BR upper ,
284 .BR lower ,
285 .BR alpha ,
286 .BR digit ,
287 .BR graph ,
288 or
289 .B xdigit
290 are not allowed.
291 The characters
292 .BR <space> ,
293 .BR <form-feed> ,
294 .BR <newline> ,
295 .BR <carriage-return> ,
296 .BR <tab> ,
297 and
298 .B <vertical-tab>
299 are automatically included.
300 .TP
301 .I cntrl
302 followed by a list of control characters.
303 Characters also specified as
304 .BR upper ,
305 .BR lower ,
306 .BR alpha ,
307 .BR digit ,
308 .BR punct ,
309 .BR graph ,
310 .BR print ,
311 or
312 .B xdigit
313 are not allowed.
314 .TP
315 .I punct
316 followed by a list of punctuation characters.
317 Characters also
318 specified as
319 .BR upper ,
320 .BR lower ,
321 .BR alpha ,
322 .BR digit ,
323 .BR cntrl ,
324 .BR xdigit ,
325 or the
326 .B <space>
327 character are not allowed.
328 .TP
329 .I graph
330 followed by a list of printable characters, not including the
331 .B <space>
332 character.
333 The characters defined as
334 .BR upper ,
335 .BR lower ,
336 .BR alpha ,
337 .BR digit ,
338 .BR xdigit ,
339 and
340 .B punct
341 are automatically included.
342 Characters also specified as
343 .B cntrl
344 are not allowed.
345 .TP
346 .I print
347 followed by a list of printable characters, including the
348 .B <space>
349 character.
350 The characters defined as
351 .BR upper ,
352 .BR lower ,
353 .BR alpha ,
354 .BR digit ,
355 .BR xdigit ,
356 .BR punct ,
357 and the
358 .B <space>
359 character are automatically included.
360 Characters also specified as
361 .B cntrl
362 are not allowed.
363 .TP
364 .I xdigit
365 followed by a list of characters classified as hexadecimal
366 digits.
367 The decimal digits must be included followed by one or
368 more set of six characters in ascending order.
369 The following
370 characters are included by default:
371 .B 0
372 through
373 .BR 9 ,
374 .B a
375 through
376 .BR f ,
377 .B A
378 through
379 .BR F .
380 .TP
381 .I blank
382 followed by a list of characters classified as
383 .BR blank .
384 The characters
385 .B <space>
386 and
387 .B <tab>
388 are automatically included.
389 .TP
390 .I toupper
391 followed by a list of mappings from lowercase to uppercase
392 letters.
393 Each mapping is a pair of a lowercase and an uppercase letter
394 separated with a
395 .B ,
396 and enclosed in parentheses.
397 The members of the list are separated
398 with semicolons.
399 .TP
400 .I tolower
401 followed by a list of mappings from uppercase to lowercase
402 letters.
403 If the keyword tolower is not present, the reverse of the
404 toupper list is used.
405 .PP
406 The
407 .B LC_CTYPE
408 definition ends with the string
409 .IR "END LC_CYTPE" .
410 .SS LC_COLLATE
411 .\" FIXME: the decsription of LC_COLLATE lacks a lot of details
412 The
413 .B LC_COLLATE
414 category defines the rules for collating characters.
415 Due to
416 limitations of libc not all POSIX-options are implemented.
417
418 The definition starts with the string
419 .B LC_COLLATE
420 in the first column.
421
422 The following keywords are allowed:
423 .TP
424 .I collating-element
425 .TP
426 .I collating-symbol
427 .PP
428 The order-definition starts with a line:
429 .TP
430 .I order_start
431 .PP
432 followed by a list of keywords chosen from
433 .BR forward ,
434 .BR backward ,
435 or
436 .BR position .
437 The order definition consists of lines that describe the order
438 and is terminated with the keyword
439 .TP
440 .IR order_end .
441 .PP
442 For more details see the sources in
443 .I /usr/lib/nls/src
444 notably the examples
445 .BR POSIX ,
446 .B Example
447 and
448 .B Example2
449 .PP
450 The
451 .B LC_COLLATE
452 definition ends with the string
453 .IR "END LC_COLLATE" .
454 .SS LC_MESSAGES
455 The definition starts with the string
456 .B LC_MESSAGES
457 in the first column.
458
459 The following keywords are allowed:
460 .TP
461 .I yesexpr
462 followed by a regular expression that describes possible
463 yes-responses.
464 .TP
465 .I noexpr
466 followed by a regular expression that describes possible
467 no-responses.
468 .PP
469 The
470 .B LC_MESSAGES
471 definition ends with the string
472 .IR "END LC_MESSAGES" .
473 .SS LC_MEASUREMENT
474 The definition starts with the string
475 .B LC_MEASUREMENT
476 in the first column.
477
478 The following keywords are allowed:
479 .TP
480 .I measurement
481 folowed by number identifying the standard used for measurement.
482 The following values are recognized:
483 .RS
484 .TP
485 .B 1
486 Metric.
487 .TP
488 .B 2
489 US customary measurements.
490 .RE
491 .PP
492 The
493 .B LC_MEASUREMENT
494 definition ends with the string
495 .IR "END LC_MEASUREMENT" .
496 .SS LC_MONETARY
497 The definition starts with the string
498 .B LC_MONETARY
499 in the first column.
500
501 The following keywords are llowed:
502 .TP
503 .I int_curr_symbol
504 followed by the international currency symbol.
505 This must be a
506 4-character string containing the international currency symbol as
507 defined by the ISO 4217 standard (three characters) followed by a
508 separator.
509 .TP
510 .I currency_symbol
511 followed by the local currency symbol.
512 .TP
513 .I mon_decimal_point
514 followed by the string that will be used as the decimal delimiter
515 when formatting monetary quantities.
516 .TP
517 .I mon_thousands_sep
518 followed by the string that will be used as a group separator
519 when formatting monetary quantities.
520 .TP
521 .I mon_grouping
522 followed by a string that describes the formatting of numeric
523 quantities.
524 .TP
525 .I positive_sign
526 followed by a string that is used to indicate a positive sign for
527 monetary quantities.
528 .TP
529 .I negative_sign
530 followed by a string that is used to indicate a negative sign for
531 monetary quantities.
532 .TP
533 .I int_frac_digits
534 followed by the number of fractional digits that should be used when
535 formatting with the
536 .BR int_curr_symbol .
537 .TP
538 .I frac_digits
539 followed by the number of fractional digits that should be used when
540 formatting with the
541 .BR currency_symbol .
542 .TP
543 .I p_cs_precedes
544 followed by an integer set to
545 .B 1
546 if the
547 .I currency_symbol
548 or
549 .I int_curr_symbol
550 should precede the formatted monetary quantity or set to
551 .B 0
552 if the symbol succeeds the value.
553 .TP
554 .I p_sep_by_space
555 followed by an integer.
556 .RS
557 .TP
558 .B 0
559 means that no space should be printed between the symbol and the
560 value.
561 .TP
562 .B 1
563 means that a space should be printed between the symbol and the
564 value.
565 .TP
566 .B 2
567 means that a space should be printed between the symbol and the
568 sign string, if adjacent.
569 .RE
570 .TP
571 .I n_cs_precedes
572 .RS
573 .TP
574 .B 0
575 - the symbol succeeds the value.
576 .TP
577 .B 1
578 - the symbol precedes the value.
579 .RE
580 .TP
581 .I n_sep_by_space
582 An integer set to
583 .B 0
584 if no space separates the
585 .I currency_symbol
586 or
587 .I int_curr_symbol
588 from the value for a negative monetary quantity, set to
589 .B 1
590 if a space separates the symbol from the value and set to
591 .B 2
592 if a space separates the symbol and the sign string, if adjacent.
593 .TP
594 .I p_sign_posn
595 .RS
596 .TP
597 .B 0
598 Parentheses enclose the quantity and the
599 .I currency_symbol
600 or
601 .IR int_curr_symbol .
602 .TP
603 .B 1
604 The sign string precedes the quantity and the
605 .I currency_symbol
606 or the
607 .IR int_curr_symbol .
608 .TP
609 .B 2
610 The sign string succeeds the quantity and the
611 .I currency_symbol
612 or the
613 .IR int_curr_symbol .
614 .TP
615 .B 3
616 The sign string precedes the
617 .I currency_symbol
618 or the
619 .IR int_curr_symbol .
620 .TP
621 .B 4
622 The sign string succeeds the
623 .I currency_symbol
624 or the
625 .IR int_curr_symbol .
626 .RE
627 .TP
628 .I n_sign_posn
629 .RS
630 .TP
631 .B 0
632 Parentheses enclose the quantity and the
633 .I currency_symbol
634 or
635 .IR int_curr_symbol .
636 .TP
637 .B 1
638 The sign string precedes the quantity and the
639 .I currency_symbol
640 or the
641 .IR int_curr_symbol .
642 .TP
643 .B 2
644 The sign string succeeds the quantity and the
645 .I currency_symbol
646 or the
647 .IR int_curr_symbol .
648 .TP
649 .B 3
650 The sign string precedes the
651 .I currency_symbol
652 or the
653 .IR int_curr_symbol .
654 .TP
655 .B 4
656 The sign string succeeds the
657 .I currency_symbol
658 or the
659 .IR int_curr_symbol .
660 .RE
661 .PP
662 The
663 .B LC_MONETARY
664 definition ends with the string
665 .IR "END LC_MONETARY" .
666 .SS LC_NAME
667 The definition starts with the string
668 .B LC_NAME
669 in the first column.
670
671 The following keywords are allowed:
672 .TP
673 .I name_fmt
674 followed by a string containing field descriptors that define
675 the format used for names in the locale.
676 The following field descriptors are recognized:
677 .\" From localedata/locales/uk_UA:
678 .RS
679 .TP
680 %f
681 Family name(s).
682 .TP
683 %F
684 Family names in uppercase.
685 .TP
686 %g
687 First given name.
688 .TP
689 %G
690 First given initial.
691 .TP
692 %l
693 First given name with Latin letters.
694 .TP
695 %o
696 Other shorter name.
697 .TP
698 %m
699 Additional given name(s).
700 .TP
701 %M
702 Initials for additional given name(s).
703 .TP
704 %p
705 Profession.
706 .TP
707 %s
708 Salutation, such as "Doctor".
709 .TP
710 %S
711 Abbreviated salutation, such as "Mr." or "Dr.".
712 .TP
713 %d
714 Salutation, using the FDCC-sets conventions.
715 .\" 1 for the name_gen
716 .\" In glibc 2.19, %d1 is used in only:
717 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/bem_ZM
718 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/zh_HK
719 .\" In glibc 2.19, %d[2-5] appear to be not used at all
720 .\" 2 for name_mr
721 .\" 3 for name_mrs
722 .\" 4 for name_miss
723 .\" 5 for name_ms
724 .TP
725 %t
726 If the preceding field descriptor resulted in an empty string,
727 then the empty string, otherwise a space character.
728 .RE
729 .TP
730 .I name_gen
731 followed by the general salutation for any gender.
732 .TP
733 .I name_mr
734 followed by the salutation for men.
735 .TP
736 .I name_mrs
737 followed by the salutation for married women.
738 .TP
739 .I name_miss
740 followed by the salutation for unmarried women.
741 .TP
742 .I name_ms
743 followed by the salutation valid for all women.
744 .PP
745 The
746 .B LC_NAME
747 definition ends with the string
748 .IR "END LC_NAME" .
749 .SS LC_NUMERIC
750 The definition starts with the string
751 .B LC_NUMERIC
752 in the first column.
753
754 The following keywords are allowed:
755 .TP
756 .I decimal_point
757 followed by the string that will be used as the decimal delimiter
758 when formatting numeric quantities.
759 .TP
760 .I thousands_sep
761 followed by the string that will be used as a group separator
762 when formatting numeric quantities.
763 .TP
764 .I grouping
765 followed by a string that describes the formatting of numeric
766 quantities.
767 .PP
768 The
769 .B LC_NUMERIC
770 definition ends with the string
771 .IR "END LC_NUMERIC" .
772 .SS LC_PAPER
773 The definition starts with the string
774 .B LC_PAPER
775 in the first column.
776
777 The following keywords are allowed:
778 .TP
779 .I height
780 followed by the height, in millimeters, of the standard paper format.
781 .TP
782 .I width
783 followed by the width, in millimeters, of the standard paper format.
784 .PP
785 The
786 .B LC_PAPER
787 definition ends with the string
788 .IR "END LC_PAPER" .
789 .SS LC_TELEPHONE
790 The definition starts with the string
791 .B LC_TELEPHONE
792 in the first column.
793
794 The following keywords are allowed:
795 .TP
796 .I tel_int_fmt
797 followed by a string that contains field descriptors that identify
798 the format used to dial international numbers.
799 The following field descriptors are recognized:
800 .\" From localedata/locales/uk_UA
801 .RS
802 .TP
803 %a
804 Area code without nationwide prefix (the prefix is often "0").
805 .TP
806 %A
807 Area code including nationwide prefix.
808 .TP
809 %l
810 Local number (within area code).
811 .TP
812 %e
813 Extension (to local number).
814 .TP
815 %c
816 Country code.
817 .TP
818 %C
819 Alternate carrier service code used for dialling abroad.
820 .TP
821 %t
822 If the preceding field descriptor resulted in an empty string,
823 then the empty string, otherwise a space character.
824 .RE
825 .TP
826 .I tel_dom_fmt
827 followed by a string that contains field descriptors that identify
828 the format used to dial domestic numbers.
829 The recognized field descriptrs are the same as for
830 .IR tel_int_fmt .
831 .TP
832 .I int_select
833 followed by the prefix used to call international phone numbers.
834 .TP
835 .I int_prefix
836 followed by the prefix used from other countries to dial this country.
837 .PP
838 The
839 .B LC_TELEPHONE
840 definition ends with the string
841 .IR "END LC_TELEPHONE" .
842 .SS LC_TIME
843 The definition starts with the string
844 .B LC_TIME
845 in the first column.
846
847 The following keywords are allowed:
848 .TP
849 .I abday
850 followed by a list of abbreviated names of the days of the week.
851 The list starts with the first day of the week
852 as specified by
853 .I week
854 (Sunday by default).
855 .TP
856 .I day
857 followed by a list of names of the days of the week.
858 The list starts with the first day of the week
859 as specified by
860 .I week
861 (Sunday by default).
862 .TP
863 .I abmon
864 followed by a list of abbreviated month names.
865 .TP
866 .I mon
867 followed by a list of month names.
868 .TP
869 .I am_pm
870 The appropriate representation of the
871 .B am
872 and
873 .B pm
874 strings.
875 .TP
876 .I d_t_fmt
877 The appropriate date and time format.
878 .TP
879 .I d_fmt
880 The appropriate date format.
881 .TP
882 .I t_fmt
883 The appropriate time format.
884 .TP
885 .I t_fmt_ampm
886 The appropriate time format when using 12h clock format.
887 .TP
888 .I week
889 followed by a list of three values:
890 The number of days in a week (by default 7),
891 a date of beginning of the week (by default corresponds to Sunday),
892 and the minimal length of the first week in year (by default 4).
893 Regarding the start of the week,
894 .B 19971130
895 shall be used for Sunday and
896 .B 19971201
897 shall be used for Monday.
898 Thus, countries using
899 .B 19971130
900 should have local Sunday name as the first day in the
901 .I day
902 list,
903 while countries using
904 .B 19971201
905 should have Monday translation as the first item in the
906 .I day
907 list.
908 .TP
909 .IR first_weekday " (since glibc 2.2)"
910 Number of the first day from the
911 .I day
912 list to be shown in calendar applications.
913 The default value of
914 .B 1
915 corresponds to either Sunday or Monday depending
916 on the value of the second
917 .I week
918 list item.
919 .TP
920 .IR first_workday " (since glibc 2.2)"
921 Number of the first working day from the
922 .I day
923 list.
924 .PP
925 The
926 .B LC_TIME
927 definition ends with the string
928 .IR "END LC_TIME" .
929 .SH FILES
930 /usr/lib/locale/
931 \(em database for the current locale setting of that category
932 .br
933 /usr/lib/nls/charmap/* \(em charmap-files
934 .SH CONFORMING TO
935 POSIX.2, ISO/IEC 14652.
936 .SH BUGS
937 This manual page isn't complete.
938 .\" .SH AUTHOR
939 .\" Jochen Hein (Hein@Student.TU-Clausthal.de)
940 .SH SEE ALSO
941 .BR locale (1),
942 .BR localedef (1),
943 .BR localeconv (3),
944 .BR setlocale (3),
945 .BR charmap (5),
946 .BR locale (7)