]> pere.pagekite.me Git - homepage.git/blob - linux/glibc/howto.html
Info on locale naming.
[homepage.git] / linux / glibc / howto.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html lang="en">
3 <head>
4 <title>How to write a GNU libc locale</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <meta http-equiv="Content-Language" content="en">
7 <link rel="stylesheet" type="text/css" href="http://i18n.skolelinux.no/stilsett.css" id="nn1">
8 <link rel="stylesheet" type="text/css" href="http://i18n.skolelinux.no/utskrift.css" media="print" id="nn2">
9
10 </head>
11
12 <body>
13 <div class="topp">
14 <h1>How to write a GNU libc locale</h1>
15 </div>
16
17 <div class="meny">
18 <a href="./">Back</a>
19 </div>
20
21 <div class="hovuddel">
22
23 <p>This is a draft document explaining how to write locale files
24 for GNU libc. It will not go into details, but reference
25 specifications. It will on the other hand mention some of the
26 pitfalls, and try to document the current practice.</p>
27
28 <h2>How to choose the locale file name</h2>
29
30 <p>Locale names consist of three parts. The language code, the
31 country/region code, and the optional modifier. The format is
32 language_REGION@modifier. The language code is a code from
33 ISO 639. The two-letter code is prefered, but a three letter
34 code is accepted if no two-letter code is available. The
35 country/region code is a code from ISO 3166. If the language
36 or region in question is missing in the ISO standard, one need
37 to get the ISO standard updated before the locale will be
38 included in glibc.</p>
39
40 <p>Little is known about the requirements for the naming of
41 modifiers. The following modifiers are currently used:
42 abegede, cyrillic, euro and saaho. This might indicate that
43 lower case letters are prefered in modifier names.</p>
44
45
46 <ul>
47 <li><a href="http://www.unicode.org/onlinedat/countries.html">ISO 3166</a></li>
48 <li><a href="http://www.loc.gov/standards/iso639-2/">ISO 639</a>
49 </ul>
50
51 <h2>Category order</h2>
52
53 <p>To make it easier to compare locales with each other, I
54 recommend using the same order for the categories in all
55 locales. Any order will do, so I picked the order used in most
56 locales, and decided to recommend this order:</p>
57
58 <ol>
59 <li>LC_IDENTIFICATION
60 <li>LC_CTYPE
61 <li>LC_COLLATE
62 <li>LC_MONETARY
63 <li>LC_NUMERIC
64 <li>LC_TIME
65 <li>LC_MESSAGES
66 <li>LC_PAPER
67 <li>LC_NAME
68 <li>LC_ADDRESS
69 <li>LC_TELEPHONE
70 <li>LC_MEASUREMENT
71 </ol>
72
73 <h2>Reuse when possible</h2>
74
75 - "copy" from existing locales if the content should be identical
76
77 <h2>LD_INDENTIFICATION</h2>
78
79 - standard refs in the LD_INDENTIFICATION
80
81 <h2>LC_MESSAGES</h2>
82
83 - yes/no expr should have the form ^[yYnN<extra>], without 0 and 1
84
85 <h2>Standard documents and specifications</h2>
86
87 </div>
88
89 <hr>
90 <address><a href="mailto:pere@hungry.com">Petter Reinholdtsen</a></address>
91 <!-- Created: Sun Mar 21 18:14:42 CET 2004 -->
92 <!-- hhmts start -->
93 Last modified: Sat Jul 24 15:19:14 CEST 2004
94 <!-- hhmts end -->
95 </body>
96 </html>