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 .\" %%%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.
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.
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/>.
21 .\" 2008-06-17 Petr Baudis <pasky@suse.cz>
22 .\" LC_TIME: Describe first_weekday and first_workday
24 .TH LOCALE 5 2021-03-22 "Linux" "Linux User Manual"
26 locale \- describes a locale definition file
30 definition file contains all the information that the
32 command needs to convert it into the binary locale database.
34 The definition files consist of sections which each describe a
35 locale category in detail.
38 for additional details for these categories.
40 The locale definition file starts with a header that may consist
41 of the following keywords:
44 is followed by a character that should be used as the
45 escape-character for the rest of the file to mark characters that
46 should be interpreted in a special way.
47 It defaults to the backslash (\e).
50 is followed by a character that will be used as the
51 comment-character for the rest of the file.
52 It defaults to the number sign (#).
54 The locale definition has one part for each locale category.
55 Each part can be copied from another existing locale or
56 can be defined from scratch.
57 If the category should be copied,
58 the only valid keyword in the definition is
60 followed by the name of the locale in double quotes which should be
62 The exceptions for this rule are
68 statement can be followed by locale-specific rules and selected overrides.
70 When defining a locale or a category from scratch, an existing system-
71 provided locale definition file should be used as a reference to follow
72 common glibc conventions.
73 .SS Locale category sections
74 The following category sections are defined by POSIX:
88 In addition, since version 2.2,
89 the GNU C library supports the following nonstandard categories:
105 for a more detailed description of each category.
107 The definition starts with the string
111 The following keywords are allowed:
114 followed by a string containing field descriptors that define
115 the format used for postal addresses in the locale.
116 The following field descriptors are recognized:
120 Person's name, possibly constructed with the
123 keyword (since glibc 2.24).
126 Care of person, or organization.
138 Street or block (e.g., Japanese) name.
141 House number or designation.
144 Insert an end-of-line if the previous descriptor's value was not an empty
145 string; otherwise ignore.
148 Insert a space if the previous descriptor's value was not an empty string;
152 Room number, door designation.
158 Country designation, from the
163 Local township within town or city (since glibc 2.24).
166 Zip number, postal code.
172 State, province, or prefecture.
175 Country, as taken from data record.
177 Each field descriptor may have an \(aqR\(aq after
178 the \(aq%\(aq to specify that the
179 information is taken from a Romanized version string of the
184 followed by the country name in the language of the current document
185 (e.g., "Deutschland" for the
190 followed by the abbreviation of the country (see CERT_MAILCODES).
193 followed by the two-letter abbreviation of the country (ISO 3166).
196 followed by the three-letter abbreviation of the country (ISO 3166).
199 followed by the numeric country code (ISO 3166).
202 followed by the international license plate country code.
205 followed by the ISBN code (for books).
208 followed by the language name in the language of the current document.
211 followed by the two-letter abbreviation of the language (ISO 639).
214 followed by the three-letter abbreviation of the language (ISO 639-2/T).
217 followed by the three-letter abbreviation of the language for library
219 Applications should in general prefer
226 definition ends with the string
227 .IR "END LC_ADDRESS" .
229 The definition starts with the string
233 The following keywords are allowed:
236 followed by a list of uppercase letters.
241 are included automatically.
242 Characters also specified as
251 followed by a list of lowercase letters.
256 are included automatically.
257 Characters also specified as
266 followed by a list of letters.
267 All character specified as either
271 are automatically included.
272 Characters also specified as
281 followed by the characters classified as numeric digits.
288 They are included by default in this class.
291 followed by a list of characters defined as white-space
293 Characters also specified as
306 .BR <carriage-return> ,
310 are automatically included.
313 followed by a list of control characters.
314 Characters also specified as
327 followed by a list of punctuation characters.
338 character are not allowed.
341 followed by a list of printable characters, not including the
344 The characters defined as
352 are automatically included.
353 Characters also specified as
358 followed by a list of printable characters, including the
361 The characters defined as
370 character are automatically included.
371 Characters also specified as
376 followed by a list of characters classified as hexadecimal
378 The decimal digits must be included followed by one or
379 more set of six characters in ascending order.
381 characters are included by default:
393 followed by a list of characters classified as
399 are automatically included.
402 followed by a list of locale-specific character class names
403 which are then to be defined in the locale.
406 followed by a list of mappings from lowercase to uppercase
408 Each mapping is a pair of a lowercase and an uppercase letter
411 and enclosed in parentheses.
414 followed by a list of mappings from uppercase to lowercase
416 If the keyword tolower is not present, the reverse of the
417 toupper list is used.
420 followed by a list of mapping pairs of
421 characters and letters
422 to be used in titles (headings).
425 followed by a locale-specific character class definition,
426 starting with the class name followed by the characters
427 belonging to the class.
430 followed by a list of locale-specific character mapping names
431 which are then to be defined in the locale.
434 followed by a list of alternate output digits for the locale.
437 followed by a list of mapping pairs of
438 alternate digits and separators
439 for input digits for the locale.
442 followed by a list of mapping pairs of
444 for output for the locale.
447 marks the start of the transliteration rules section.
448 The section can contain the
450 keyword in the beginning followed by
451 locale-specific rules and overrides.
452 Any rule specified in the locale file
453 will override any rule
454 copied or included from other files.
455 In case of duplicate rule definitions in the locale file,
456 only the first rule is used.
458 A transliteration rule consist of a character to be transliterated
459 followed by a list of transliteration targets separated by semicolons.
460 The first target which can be presented in the target character set
461 is used, if none of them can be used the
463 character will be used instead.
466 in the transliteration rules section includes
467 a transliteration rule file
468 (and optionally a repertoire map file).
471 in the transliteration rules section
472 defines the default character to be used for
473 transliteration where none of the targets cannot be presented
474 in the target character set.
477 marks the end of the transliteration rules.
481 definition ends with the string
484 Note that glibc does not support all POSIX-defined options,
485 only the options described below are supported (as of glibc 2.23).
487 The definition starts with the string
491 The following keywords are allowed:
494 followed by the number representing used collation levels.
495 This keyword is recognized but ignored by glibc.
497 .I collating\-element
498 followed by the definition of a collating-element symbol
499 representing a multicharacter collating element.
502 followed by the definition of a collating symbol
503 that can be used in collation order statements.
508 to be evaluated in an
518 followed by a redefinition of a collation rule.
521 marks the end of the redefinition of a collation rule.
523 .I reorde\r-sections\-after
524 followed by a script name to reorder listed scripts after.
526 .I reorder\-sections\-end
527 marks the end of the reordering of sections.
530 followed by a declaration of a script.
532 .I symbol\-equivalence
533 followed by a collating-symbol to be equivalent to another defined
536 The collation rule definition starts with a line:
539 followed by a list of keywords chosen from
544 The order definition consists of lines that describe the collation
545 order and is terminated with the keyword
550 definition ends with the string
551 .IR "END LC_COLLATE" .
552 .SS LC_IDENTIFICATION
553 The definition starts with the string
557 The following keywords are allowed:
560 followed by the title of the locale document
561 (e.g., "Maori language locale for New Zealand").
564 followed by the name of the organization that maintains this document.
567 followed by the address of the organization that maintains this document.
570 followed by the name of the contact person at
571 the organization that maintains this document.
574 followed by the email address of the person or
575 organization that maintains this document.
578 followed by the telephone number (in international format)
579 of the organization that maintains this document.
580 As of glibc 2.24, this keyword is deprecated in favor of
581 other contact methods.
584 followed by the fax number (in international format)
585 of the organization that maintains this document.
586 As of glibc 2.24, this keyword is deprecated in favor of
587 other contact methods.
590 followed by the name of the language to which this document applies.
593 followed by the name of the country/geographic extent
594 to which this document applies.
597 followed by a description of the audience for which this document is
601 followed by a description of any special application
602 for which this document is intended.
605 followed by the short name for provider of the source of this document.
608 followed by the revision number of this document.
611 followed by the revision date of this document.
613 In addition, for each of the categories defined by the document,
614 there should be a line starting with the keyword
618 a string that identifies this locale category definition,
628 definition ends with the string
629 .IR "END LC_IDENTIFICATION" .
631 The definition starts with the string
635 The following keywords are allowed:
638 followed by a regular expression that describes possible
642 followed by a regular expression that describes possible
646 followed by the output string corresponding to "yes".
649 followed by the output string corresponding to "no".
653 definition ends with the string
654 .IR "END LC_MESSAGES" .
656 The definition starts with the string
660 The following keywords are allowed:
663 followed by number identifying the standard used for measurement.
664 The following values are recognized:
671 US customary measurements.
676 definition ends with the string
677 .IR "END LC_MEASUREMENT" .
679 The definition starts with the string
683 The following keywords are allowed:
686 followed by the international currency symbol.
688 4-character string containing the international currency symbol as
689 defined by the ISO 4217 standard (three characters) followed by a
693 followed by the local currency symbol.
696 followed by the single-character string that will be used as the
697 decimal delimiter when formatting monetary quantities.
700 followed by the single-character string that will be used as a group
701 separator when formatting monetary quantities.
704 followed by a sequence of integers separated by semicolons that
705 describe the formatting of monetary quantities.
711 followed by a string that is used to indicate a positive sign for
715 followed by a string that is used to indicate a negative sign for
719 followed by the number of fractional digits that should be used when
721 .IR int_curr_symbol .
724 followed by the number of fractional digits that should be used when
726 .IR currency_symbol .
729 followed by an integer that indicates the placement of
731 for a nonnegative formatted monetary quantity:
735 the symbol succeeds the value.
738 the symbol precedes the value.
742 followed by an integer that indicates the separation of
743 .IR currency_symbol ,
744 the sign string, and the value for a nonnegative formatted monetary quantity.
745 The following values are recognized:
749 No space separates the currency symbol and the value.
752 If the currency symbol and the sign string are adjacent,
753 a space separates them from the value;
754 otherwise a space separates the currency symbol and the value.
757 If the currency symbol and the sign string are adjacent,
758 a space separates them from the value;
759 otherwise a space separates the sign string and the value.
763 followed by an integer that indicates the placement of
765 for a negative formatted monetary quantity.
766 The same values are recognized as for
770 followed by an integer that indicates the separation of
771 .IR currency_symbol ,
772 the sign string, and the value for a negative formatted monetary quantity.
773 The same values are recognized as for
777 followed by an integer that indicates where the
779 should be placed for a nonnegative monetary quantity:
783 Parentheses enclose the quantity and the
786 .IR int_curr_symbol .
789 The sign string precedes the quantity and the
792 .IR int_curr_symbol .
795 The sign string succeeds the quantity and the
798 .IR int_curr_symbol .
801 The sign string precedes the
804 .IR int_curr_symbol .
807 The sign string succeeds the
810 .IR int_curr_symbol .
814 followed by an integer that indicates where the
816 should be placed for a negative monetary quantity.
817 The same values are recognized as for
821 followed by an integer that indicates the placement of
823 for a nonnegative internationally formatted monetary quantity.
824 The same values are recognized as for
828 followed by an integer that indicates the placement of
830 for a negative internationally formatted monetary quantity.
831 The same values are recognized as for
834 .I int_p_sep_by_space
835 followed by an integer that indicates the separation of
836 .IR int_curr_symbol ,
838 and the value for a nonnegative internationally formatted monetary quantity.
839 The same values are recognized as for
842 .I int_n_sep_by_space
843 followed by an integer that indicates the separation of
844 .IR int_curr_symbol ,
846 and the value for a negative internationally formatted monetary quantity.
847 The same values are recognized as for
851 followed by an integer that indicates where the
853 should be placed for a nonnegative
854 internationally formatted monetary quantity.
855 The same values are recognized as for
859 followed by an integer that indicates where the
861 should be placed for a negative
862 internationally formatted monetary quantity.
863 The same values are recognized as for
868 definition ends with the string
869 .IR "END LC_MONETARY" .
871 The definition starts with the string
875 Various keywords are allowed, but only
878 Other keywords are needed only if there is common convention to
879 use the corresponding salutation in this locale.
880 The allowed keywords are as follows:
883 followed by a string containing field descriptors that define
884 the format used for names in the locale.
885 The following field descriptors are recognized:
892 Family names in uppercase.
901 First given name with Latin letters.
907 Additional given name(s).
910 Initials for additional given name(s).
916 Salutation, such as "Doctor".
919 Abbreviated salutation, such as "Mr." or "Dr.".
922 Salutation, using the FDCC-sets conventions.
923 .\" 1 for the name_gen
924 .\" In glibc 2.19, %d1 is used in only:
925 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/bem_ZM
926 .\" /home/mtk/ARCHIVE/GLIBC/glibc-2.19/localedata/locales/zh_HK
927 .\" In glibc 2.19, %d[2-5] appear to be not used at all
934 If the preceding field descriptor resulted in an empty string,
935 then the empty string, otherwise a space character.
939 followed by the general salutation for any gender.
942 followed by the salutation for men.
945 followed by the salutation for married women.
948 followed by the salutation for unmarried women.
951 followed by the salutation valid for all women.
955 definition ends with the string
958 The definition starts with the string
962 The following keywords are allowed:
965 followed by the single-character string that will be used as the
966 decimal delimiter when formatting numeric quantities.
969 followed by the single-character string that will be used as a group
970 separator when formatting numeric quantities.
973 followed by a sequence of integers separated by semicolons
974 that describe the formatting of numeric quantities.
976 Each integer specifies the number of digits in a group.
977 The first integer defines the size of the group immediately
978 to the left of the decimal delimiter.
979 Subsequent integers define succeeding groups to the
980 left of the previous group.
981 If the last integer is not \-1, then the size of the previous group
982 (if any) is repeatedly used for the remainder of the digits.
983 If the last integer is \-1, then no further grouping is performed.
987 definition ends with the string
988 .IR "END LC_NUMERIC" .
990 The definition starts with the string
994 The following keywords are allowed:
997 followed by the height, in millimeters, of the standard paper format.
1000 followed by the width, in millimeters, of the standard paper format.
1004 definition ends with the string
1005 .IR "END LC_PAPER" .
1007 The definition starts with the string
1009 in the first column.
1011 The following keywords are allowed:
1014 followed by a string that contains field descriptors that identify
1015 the format used to dial international numbers.
1016 The following field descriptors are recognized:
1020 Area code without nationwide prefix (the prefix is often "00").
1023 Area code including nationwide prefix.
1026 Local number (within area code).
1029 Extension (to local number).
1035 Alternate carrier service code used for dialing abroad.
1038 If the preceding field descriptor resulted in an empty string,
1039 then the empty string, otherwise a space character.
1043 followed by a string that contains field descriptors that identify
1044 the format used to dial domestic numbers.
1045 The recognized field descriptors are the same as for
1049 followed by the prefix used to call international phone numbers.
1052 followed by the prefix used from other countries to dial this country.
1056 definition ends with the string
1057 .IR "END LC_TELEPHONE" .
1059 The definition starts with the string
1061 in the first column.
1063 The following keywords are allowed:
1066 followed by a list of abbreviated names of the days of the week.
1067 The list starts with the first day of the week
1070 (Sunday by default).
1074 followed by a list of names of the days of the week.
1075 The list starts with the first day of the week
1078 (Sunday by default).
1082 followed by a list of abbreviated month names.
1085 followed by a list of month names.
1088 followed by the appropriate date and time format
1093 followed by the appropriate date format
1098 followed by the appropriate time format
1103 followed by the appropriate representation of the
1108 This should be left empty for locales not using AM/PM convention.
1111 followed by the appropriate time format
1114 when using 12h clock format.
1115 This should be left empty for locales not using AM/PM convention.
1118 followed by semicolon-separated strings that define how years are
1119 counted and displayed for each era in the locale.
1120 Each string has the following format:
1123 .IR direction ":" offset ":" start_date ":" end_date ":" era_name ":" era_format
1125 The fields are to be defined as follows:
1133 means the years closer to
1135 have lower numbers than years closer to
1141 The number of the year closest to
1143 in the era, corresponding to the
1149 The start of the era in the form of
1151 Years prior AD 1 are represented as negative numbers.
1154 The end of the era in the form of
1156 or one of the two special values of
1161 means the ending date is the beginning of time.
1163 means the ending date is the end of time.
1166 The name of the era corresponding to the
1172 The format of the year in the era corresponding to the
1179 followed by the format of the date in alternative era notation,
1180 corresponding to the
1186 followed by the format of the time in alternative era notation,
1187 corresponding to the
1193 followed by the format of the date and time in alternative era notation,
1194 corresponding to the
1200 followed by the alternative digits used for date and time in the locale.
1203 followed by a list of three values separated by semicolons:
1204 The number of days in a week (by default 7),
1205 a date of beginning of the week (by default corresponds to Sunday),
1206 and the minimal length of the first week in year (by default 4).
1207 Regarding the start of the week,
1209 shall be used for Sunday and
1211 shall be used for Monday.
1214 .IR first_weekday " (since glibc 2.2)"
1215 followed by the number of the day from the
1217 list to be shown as the first day of the week in calendar applications.
1218 The default value of
1220 corresponds to either Sunday or Monday depending
1221 on the value of the second
1226 .IR first_workday " (since glibc 2.2)"
1227 followed by the number of the first working day from the
1230 The default value is
1235 followed by a number value that indicates the direction for the
1236 display of calendar dates, as follows:
1240 Left-right from top.
1246 Right-left from top.
1250 followed by the appropriate date representation for
1257 definition ends with the string
1261 .I /usr/lib/locale/locale\-archive
1262 Usual default locale archive location.
1264 .I /usr/share/i18n/locales
1265 Usual default path for locale definition files.
1269 The collective GNU C library community wisdom regarding
1277 https://sourceware.org/glibc/wiki/Locales
1280 The value of the second
1282 list item specifies the base of the
1289 specifies the offset of the first day-of-week in the
1295 For compatibility reasons, all glibc locales should set the value of the
1300 (Sunday) and base the
1304 lists appropriately, and set
1312 depending on whether the week and work week actually starts on Sunday or
1313 Monday for the locale.
1315 .\" Jochen Hein (Hein@Student.TU-Clausthal.de)