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>
5 .\" SPDX-License-Identifier: GPL-2.0-or-later
7 .\" 2008-06-17 Petr Baudis <pasky@suse.cz>
8 .\" LC_TIME: Describe first_weekday and first_workday
10 .TH LOCALE 5 2021-03-22 "Linux" "Linux User Manual"
12 locale \- describes a locale definition file
16 definition file contains all the information that the
18 command needs to convert it into the binary locale database.
20 The definition files consist of sections which each describe a
21 locale category in detail.
24 for additional details for these categories.
26 The locale definition file starts with a header that may consist
27 of the following keywords:
30 is followed by a character that should be used as the
31 escape-character for the rest of the file to mark characters that
32 should be interpreted in a special way.
33 It defaults to the backslash (\e).
36 is followed by a character that will be used as the
37 comment-character for the rest of the file.
38 It defaults to the number sign (#).
40 The locale definition has one part for each locale category.
41 Each part can be copied from another existing locale or
42 can be defined from scratch.
43 If the category should be copied,
44 the only valid keyword in the definition is
46 followed by the name of the locale in double quotes which should be
48 The exceptions for this rule are
54 statement can be followed by locale-specific rules and selected overrides.
56 When defining a locale or a category from scratch, an existing system-
57 provided locale definition file should be used as a reference to follow
58 common glibc conventions.
59 .SS Locale category sections
60 The following category sections are defined by POSIX:
74 In addition, since version 2.2,
75 the GNU C library supports the following nonstandard categories:
91 for a more detailed description of each category.
93 The definition starts with the string
97 The following keywords are allowed:
100 followed by a string containing field descriptors that define
101 the format used for postal addresses in the locale.
102 The following field descriptors are recognized:
106 Person's name, possibly constructed with the
109 keyword (since glibc 2.24).
112 Care of person, or organization.
124 Street or block (e.g., Japanese) name.
127 House number or designation.
130 Insert an end-of-line if the previous descriptor's value was not an empty
131 string; otherwise ignore.
134 Insert a space if the previous descriptor's value was not an empty string;
138 Room number, door designation.
144 Country designation, from the
149 Local township within town or city (since glibc 2.24).
152 Zip number, postal code.
158 State, province, or prefecture.
161 Country, as taken from data record.
163 Each field descriptor may have an \(aqR\(aq after
164 the \(aq%\(aq to specify that the
165 information is taken from a Romanized version string of the
170 followed by the country name in the language of the current document
171 (e.g., "Deutschland" for the
176 followed by the abbreviation of the country (see CERT_MAILCODES).
179 followed by the two-letter abbreviation of the country (ISO 3166).
182 followed by the three-letter abbreviation of the country (ISO 3166).
185 followed by the numeric country code (ISO 3166).
188 followed by the international license plate country code.
191 followed by the ISBN code (for books).
194 followed by the language name in the language of the current document.
197 followed by the two-letter abbreviation of the language (ISO 639).
200 followed by the three-letter abbreviation of the language (ISO 639-2/T).
203 followed by the three-letter abbreviation of the language for library
205 Applications should in general prefer
212 definition ends with the string
213 .IR "END LC_ADDRESS" .
215 The definition starts with the string
219 The following keywords are allowed:
222 followed by a list of uppercase letters.
227 are included automatically.
228 Characters also specified as
237 followed by a list of lowercase letters.
242 are included automatically.
243 Characters also specified as
252 followed by a list of letters.
253 All character specified as either
257 are automatically included.
258 Characters also specified as
267 followed by the characters classified as numeric digits.
274 They are included by default in this class.
277 followed by a list of characters defined as white-space
279 Characters also specified as
292 .BR <carriage-return> ,
296 are automatically included.
299 followed by a list of control characters.
300 Characters also specified as
313 followed by a list of punctuation characters.
324 character are not allowed.
327 followed by a list of printable characters, not including the
330 The characters defined as
338 are automatically included.
339 Characters also specified as
344 followed by a list of printable characters, including the
347 The characters defined as
356 character are automatically included.
357 Characters also specified as
362 followed by a list of characters classified as hexadecimal
364 The decimal digits must be included followed by one or
365 more set of six characters in ascending order.
367 characters are included by default:
379 followed by a list of characters classified as
385 are automatically included.
388 followed by a list of locale-specific character class names
389 which are then to be defined in the locale.
392 followed by a list of mappings from lowercase to uppercase
394 Each mapping is a pair of a lowercase and an uppercase letter
397 and enclosed in parentheses.
400 followed by a list of mappings from uppercase to lowercase
402 If the keyword tolower is not present, the reverse of the
403 toupper list is used.
406 followed by a list of mapping pairs of
407 characters and letters
408 to be used in titles (headings).
411 followed by a locale-specific character class definition,
412 starting with the class name followed by the characters
413 belonging to the class.
416 followed by a list of locale-specific character mapping names
417 which are then to be defined in the locale.
420 followed by a list of alternate output digits for the locale.
423 followed by a list of mapping pairs of
424 alternate digits and separators
425 for input digits for the locale.
428 followed by a list of mapping pairs of
430 for output for the locale.
433 marks the start of the transliteration rules section.
434 The section can contain the
436 keyword in the beginning followed by
437 locale-specific rules and overrides.
438 Any rule specified in the locale file
439 will override any rule
440 copied or included from other files.
441 In case of duplicate rule definitions in the locale file,
442 only the first rule is used.
444 A transliteration rule consist of a character to be transliterated
445 followed by a list of transliteration targets separated by semicolons.
446 The first target which can be presented in the target character set
447 is used, if none of them can be used the
449 character will be used instead.
452 in the transliteration rules section includes
453 a transliteration rule file
454 (and optionally a repertoire map file).
457 in the transliteration rules section
458 defines the default character to be used for
459 transliteration where none of the targets cannot be presented
460 in the target character set.
463 marks the end of the transliteration rules.
467 definition ends with the string
470 Note that glibc does not support all POSIX-defined options,
471 only the options described below are supported (as of glibc 2.23).
473 The definition starts with the string
477 The following keywords are allowed:
480 followed by the number representing used collation levels.
481 This keyword is recognized but ignored by glibc.
483 .I collating\-element
484 followed by the definition of a collating-element symbol
485 representing a multicharacter collating element.
488 followed by the definition of a collating symbol
489 that can be used in collation order statements.
494 to be evaluated in an
504 followed by a redefinition of a collation rule.
507 marks the end of the redefinition of a collation rule.
509 .I reorde\r-sections\-after
510 followed by a script name to reorder listed scripts after.
512 .I reorder\-sections\-end
513 marks the end of the reordering of sections.
516 followed by a declaration of a script.
518 .I symbol\-equivalence
519 followed by a collating-symbol to be equivalent to another defined
522 The collation rule definition starts with a line:
525 followed by a list of keywords chosen from
530 The order definition consists of lines that describe the collation
531 order and is terminated with the keyword
536 definition ends with the string
537 .IR "END LC_COLLATE" .
538 .SS LC_IDENTIFICATION
539 The definition starts with the string
543 The following keywords are allowed:
546 followed by the title of the locale document
547 (e.g., "Maori language locale for New Zealand").
550 followed by the name of the organization that maintains this document.
553 followed by the address of the organization that maintains this document.
556 followed by the name of the contact person at
557 the organization that maintains this document.
560 followed by the email address of the person or
561 organization that maintains this document.
564 followed by the telephone number (in international format)
565 of the organization that maintains this document.
566 As of glibc 2.24, this keyword is deprecated in favor of
567 other contact methods.
570 followed by the fax number (in international format)
571 of the organization that maintains this document.
572 As of glibc 2.24, this keyword is deprecated in favor of
573 other contact methods.
576 followed by the name of the language to which this document applies.
579 followed by the name of the country/geographic extent
580 to which this document applies.
583 followed by a description of the audience for which this document is
587 followed by a description of any special application
588 for which this document is intended.
591 followed by the short name for provider of the source of this document.
594 followed by the revision number of this document.
597 followed by the revision date of this document.
599 In addition, for each of the categories defined by the document,
600 there should be a line starting with the keyword
604 a string that identifies this locale category definition,
614 definition ends with the string
615 .IR "END LC_IDENTIFICATION" .
617 The definition starts with the string
621 The following keywords are allowed:
624 followed by a regular expression that describes possible
628 followed by a regular expression that describes possible
632 followed by the output string corresponding to "yes".
635 followed by the output string corresponding to "no".
639 definition ends with the string
640 .IR "END LC_MESSAGES" .
642 The definition starts with the string
646 The following keywords are allowed:
649 followed by number identifying the standard used for measurement.
650 The following values are recognized:
657 US customary measurements.
662 definition ends with the string
663 .IR "END LC_MEASUREMENT" .
665 The definition starts with the string
669 The following keywords are allowed:
672 followed by the international currency symbol.
674 4-character string containing the international currency symbol as
675 defined by the ISO 4217 standard (three characters) followed by a
679 followed by the local currency symbol.
682 followed by the single-character string that will be used as the
683 decimal delimiter when formatting monetary quantities.
686 followed by the single-character string that will be used as a group
687 separator when formatting monetary quantities.
690 followed by a sequence of integers separated by semicolons that
691 describe the formatting of monetary quantities.
697 followed by a string that is used to indicate a positive sign for
701 followed by a string that is used to indicate a negative sign for
705 followed by the number of fractional digits that should be used when
707 .IR int_curr_symbol .
710 followed by the number of fractional digits that should be used when
712 .IR currency_symbol .
715 followed by an integer that indicates the placement of
717 for a nonnegative formatted monetary quantity:
721 the symbol succeeds the value.
724 the symbol precedes the value.
728 followed by an integer that indicates the separation of
729 .IR currency_symbol ,
730 the sign string, and the value for a nonnegative formatted monetary quantity.
731 The following values are recognized:
735 No space separates the currency symbol and the value.
738 If the currency symbol and the sign string are adjacent,
739 a space separates them from the value;
740 otherwise a space separates the currency symbol and the value.
743 If the currency symbol and the sign string are adjacent,
744 a space separates them from the value;
745 otherwise a space separates the sign string and the value.
749 followed by an integer that indicates the placement of
751 for a negative formatted monetary quantity.
752 The same values are recognized as for
756 followed by an integer that indicates the separation of
757 .IR currency_symbol ,
758 the sign string, and the value for a negative formatted monetary quantity.
759 The same values are recognized as for
763 followed by an integer that indicates where the
765 should be placed for a nonnegative monetary quantity:
769 Parentheses enclose the quantity and the
772 .IR int_curr_symbol .
775 The sign string precedes the quantity and the
778 .IR int_curr_symbol .
781 The sign string succeeds the quantity and the
784 .IR int_curr_symbol .
787 The sign string precedes the
790 .IR int_curr_symbol .
793 The sign string succeeds the
796 .IR int_curr_symbol .
800 followed by an integer that indicates where the
802 should be placed for a negative monetary quantity.
803 The same values are recognized as for
807 followed by an integer that indicates the placement of
809 for a nonnegative internationally formatted monetary quantity.
810 The same values are recognized as for
814 followed by an integer that indicates the placement of
816 for a negative internationally formatted monetary quantity.
817 The same values are recognized as for
820 .I int_p_sep_by_space
821 followed by an integer that indicates the separation of
822 .IR int_curr_symbol ,
824 and the value for a nonnegative internationally formatted monetary quantity.
825 The same values are recognized as for
828 .I int_n_sep_by_space
829 followed by an integer that indicates the separation of
830 .IR int_curr_symbol ,
832 and the value for a negative internationally formatted monetary quantity.
833 The same values are recognized as for
837 followed by an integer that indicates where the
839 should be placed for a nonnegative
840 internationally formatted monetary quantity.
841 The same values are recognized as for
845 followed by an integer that indicates where the
847 should be placed for a negative
848 internationally formatted monetary quantity.
849 The same values are recognized as for
854 definition ends with the string
855 .IR "END LC_MONETARY" .
857 The definition starts with the string
861 Various keywords are allowed, but only
864 Other keywords are needed only if there is common convention to
865 use the corresponding salutation in this locale.
866 The allowed keywords are as follows:
869 followed by a string containing field descriptors that define
870 the format used for names in the locale.
871 The following field descriptors are recognized:
878 Family names in uppercase.
887 First given name with Latin letters.
893 Additional given name(s).
896 Initials for additional given name(s).
902 Salutation, such as "Doctor".
905 Abbreviated salutation, such as "Mr." or "Dr.".
908 Salutation, using the FDCC-sets conventions.
909 .\" 1 for the name_gen
910 .\" In glibc 2.19, %d1 is used in only:
911 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/bem_ZM
912 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/zh_HK
913 .\" In glibc 2.19, %d[2-5] appear to be not used at all
920 If the preceding field descriptor resulted in an empty string,
921 then the empty string, otherwise a space character.
925 followed by the general salutation for any gender.
928 followed by the salutation for men.
931 followed by the salutation for married women.
934 followed by the salutation for unmarried women.
937 followed by the salutation valid for all women.
941 definition ends with the string
944 The definition starts with the string
948 The following keywords are allowed:
951 followed by the single-character string that will be used as the
952 decimal delimiter when formatting numeric quantities.
955 followed by the single-character string that will be used as a group
956 separator when formatting numeric quantities.
959 followed by a sequence of integers separated by semicolons
960 that describe the formatting of numeric quantities.
962 Each integer specifies the number of digits in a group.
963 The first integer defines the size of the group immediately
964 to the left of the decimal delimiter.
965 Subsequent integers define succeeding groups to the
966 left of the previous group.
967 If the last integer is not \-1, then the size of the previous group
968 (if any) is repeatedly used for the remainder of the digits.
969 If the last integer is \-1, then no further grouping is performed.
973 definition ends with the string
974 .IR "END LC_NUMERIC" .
976 The definition starts with the string
980 The following keywords are allowed:
983 followed by the height, in millimeters, of the standard paper format.
986 followed by the width, in millimeters, of the standard paper format.
990 definition ends with the string
993 The definition starts with the string
997 The following keywords are allowed:
1000 followed by a string that contains field descriptors that identify
1001 the format used to dial international numbers.
1002 The following field descriptors are recognized:
1006 Area code without nationwide prefix (the prefix is often "00").
1009 Area code including nationwide prefix.
1012 Local number (within area code).
1015 Extension (to local number).
1021 Alternate carrier service code used for dialing abroad.
1024 If the preceding field descriptor resulted in an empty string,
1025 then the empty string, otherwise a space character.
1029 followed by a string that contains field descriptors that identify
1030 the format used to dial domestic numbers.
1031 The recognized field descriptors are the same as for
1035 followed by the prefix used to call international phone numbers.
1038 followed by the prefix used from other countries to dial this country.
1042 definition ends with the string
1043 .IR "END LC_TELEPHONE" .
1045 The definition starts with the string
1047 in the first column.
1049 The following keywords are allowed:
1052 followed by a list of abbreviated names of the days of the week.
1053 The list starts with the first day of the week
1056 (Sunday by default).
1060 followed by a list of names of the days of the week.
1061 The list starts with the first day of the week
1064 (Sunday by default).
1068 followed by a list of abbreviated month names.
1071 followed by a list of month names.
1074 followed by the appropriate date and time format
1079 followed by the appropriate date format
1084 followed by the appropriate time format
1089 followed by the appropriate representation of the
1094 This should be left empty for locales not using AM/PM convention.
1097 followed by the appropriate time format
1100 when using 12h clock format.
1101 This should be left empty for locales not using AM/PM convention.
1104 followed by semicolon-separated strings that define how years are
1105 counted and displayed for each era in the locale.
1106 Each string has the following format:
1109 .IR direction ":" offset ":" start_date ":" end_date ":" era_name ":" era_format
1111 The fields are to be defined as follows:
1119 means the years closer to
1121 have lower numbers than years closer to
1127 The number of the year closest to
1129 in the era, corresponding to the
1135 The start of the era in the form of
1137 Years prior AD 1 are represented as negative numbers.
1140 The end of the era in the form of
1142 or one of the two special values of
1147 means the ending date is the beginning of time.
1149 means the ending date is the end of time.
1152 The name of the era corresponding to the
1158 The format of the year in the era corresponding to the
1165 followed by the format of the date in alternative era notation,
1166 corresponding to the
1172 followed by the format of the time in alternative era notation,
1173 corresponding to the
1179 followed by the format of the date and time in alternative era notation,
1180 corresponding to the
1186 followed by the alternative digits used for date and time in the locale.
1189 followed by a list of three values separated by semicolons:
1190 The number of days in a week (by default 7),
1191 a date of beginning of the week (by default corresponds to Sunday),
1192 and the minimal length of the first week in year (by default 4).
1193 Regarding the start of the week,
1195 shall be used for Sunday and
1197 shall be used for Monday.
1200 .IR first_weekday " (since glibc 2.2)"
1201 followed by the number of the day from the
1203 list to be shown as the first day of the week in calendar applications.
1204 The default value of
1206 corresponds to either Sunday or Monday depending
1207 on the value of the second
1212 .IR first_workday " (since glibc 2.2)"
1213 followed by the number of the first working day from the
1216 The default value is
1221 followed by a number value that indicates the direction for the
1222 display of calendar dates, as follows:
1226 Left-right from top.
1232 Right-left from top.
1236 followed by the appropriate date representation for
1243 definition ends with the string
1247 .I /usr/lib/locale/locale\-archive
1248 Usual default locale archive location.
1250 .I /usr/share/i18n/locales
1251 Usual default path for locale definition files.
1255 The collective GNU C library community wisdom regarding
1263 https://sourceware.org/glibc/wiki/Locales
1266 The value of the second
1268 list item specifies the base of the
1275 specifies the offset of the first day-of-week in the
1281 For compatibility reasons, all glibc locales should set the value of the
1286 (Sunday) and base the
1290 lists appropriately, and set
1298 depending on whether the week and work week actually starts on Sunday or
1299 Monday for the locale.
1301 .\" Jochen Hein (Hein@Student.TU-Clausthal.de)