1*29619d2aSchristos /* $NetBSD: localename.c,v 1.1.1.1 2016/01/14 00:11:28 christos Exp $ */
2*29619d2aSchristos
3*29619d2aSchristos /* Determine the current selected locale.
4*29619d2aSchristos Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
5*29619d2aSchristos
6*29619d2aSchristos This program is free software; you can redistribute it and/or modify it
7*29619d2aSchristos under the terms of the GNU Library General Public License as published
8*29619d2aSchristos by the Free Software Foundation; either version 2, or (at your option)
9*29619d2aSchristos any later version.
10*29619d2aSchristos
11*29619d2aSchristos This program is distributed in the hope that it will be useful,
12*29619d2aSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of
13*29619d2aSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14*29619d2aSchristos Library General Public License for more details.
15*29619d2aSchristos
16*29619d2aSchristos You should have received a copy of the GNU Library General Public
17*29619d2aSchristos License along with this program; if not, write to the Free Software
18*29619d2aSchristos Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19*29619d2aSchristos USA. */
20*29619d2aSchristos
21*29619d2aSchristos /* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
22*29619d2aSchristos /* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
23*29619d2aSchristos
24*29619d2aSchristos #ifdef HAVE_CONFIG_H
25*29619d2aSchristos # include <config.h>
26*29619d2aSchristos #endif
27*29619d2aSchristos
28*29619d2aSchristos #include <stdlib.h>
29*29619d2aSchristos #include <locale.h>
30*29619d2aSchristos
31*29619d2aSchristos #if defined _WIN32 || defined __WIN32__
32*29619d2aSchristos # undef WIN32 /* avoid warning on mingw32 */
33*29619d2aSchristos # define WIN32
34*29619d2aSchristos #endif
35*29619d2aSchristos
36*29619d2aSchristos #ifdef WIN32
37*29619d2aSchristos # define WIN32_LEAN_AND_MEAN
38*29619d2aSchristos # include <windows.h>
39*29619d2aSchristos /* List of language codes, sorted by value:
40*29619d2aSchristos 0x01 LANG_ARABIC
41*29619d2aSchristos 0x02 LANG_BULGARIAN
42*29619d2aSchristos 0x03 LANG_CATALAN
43*29619d2aSchristos 0x04 LANG_CHINESE
44*29619d2aSchristos 0x05 LANG_CZECH
45*29619d2aSchristos 0x06 LANG_DANISH
46*29619d2aSchristos 0x07 LANG_GERMAN
47*29619d2aSchristos 0x08 LANG_GREEK
48*29619d2aSchristos 0x09 LANG_ENGLISH
49*29619d2aSchristos 0x0a LANG_SPANISH
50*29619d2aSchristos 0x0b LANG_FINNISH
51*29619d2aSchristos 0x0c LANG_FRENCH
52*29619d2aSchristos 0x0d LANG_HEBREW
53*29619d2aSchristos 0x0e LANG_HUNGARIAN
54*29619d2aSchristos 0x0f LANG_ICELANDIC
55*29619d2aSchristos 0x10 LANG_ITALIAN
56*29619d2aSchristos 0x11 LANG_JAPANESE
57*29619d2aSchristos 0x12 LANG_KOREAN
58*29619d2aSchristos 0x13 LANG_DUTCH
59*29619d2aSchristos 0x14 LANG_NORWEGIAN
60*29619d2aSchristos 0x15 LANG_POLISH
61*29619d2aSchristos 0x16 LANG_PORTUGUESE
62*29619d2aSchristos 0x17 LANG_RHAETO_ROMANCE
63*29619d2aSchristos 0x18 LANG_ROMANIAN
64*29619d2aSchristos 0x19 LANG_RUSSIAN
65*29619d2aSchristos 0x1a LANG_CROATIAN == LANG_SERBIAN
66*29619d2aSchristos 0x1b LANG_SLOVAK
67*29619d2aSchristos 0x1c LANG_ALBANIAN
68*29619d2aSchristos 0x1d LANG_SWEDISH
69*29619d2aSchristos 0x1e LANG_THAI
70*29619d2aSchristos 0x1f LANG_TURKISH
71*29619d2aSchristos 0x20 LANG_URDU
72*29619d2aSchristos 0x21 LANG_INDONESIAN
73*29619d2aSchristos 0x22 LANG_UKRAINIAN
74*29619d2aSchristos 0x23 LANG_BELARUSIAN
75*29619d2aSchristos 0x24 LANG_SLOVENIAN
76*29619d2aSchristos 0x25 LANG_ESTONIAN
77*29619d2aSchristos 0x26 LANG_LATVIAN
78*29619d2aSchristos 0x27 LANG_LITHUANIAN
79*29619d2aSchristos 0x28 LANG_TAJIK
80*29619d2aSchristos 0x29 LANG_FARSI
81*29619d2aSchristos 0x2a LANG_VIETNAMESE
82*29619d2aSchristos 0x2b LANG_ARMENIAN
83*29619d2aSchristos 0x2c LANG_AZERI
84*29619d2aSchristos 0x2d LANG_BASQUE
85*29619d2aSchristos 0x2e LANG_SORBIAN
86*29619d2aSchristos 0x2f LANG_MACEDONIAN
87*29619d2aSchristos 0x30 LANG_SUTU
88*29619d2aSchristos 0x31 LANG_TSONGA
89*29619d2aSchristos 0x32 LANG_TSWANA
90*29619d2aSchristos 0x33 LANG_VENDA
91*29619d2aSchristos 0x34 LANG_XHOSA
92*29619d2aSchristos 0x35 LANG_ZULU
93*29619d2aSchristos 0x36 LANG_AFRIKAANS
94*29619d2aSchristos 0x37 LANG_GEORGIAN
95*29619d2aSchristos 0x38 LANG_FAEROESE
96*29619d2aSchristos 0x39 LANG_HINDI
97*29619d2aSchristos 0x3a LANG_MALTESE
98*29619d2aSchristos 0x3b LANG_SAAMI
99*29619d2aSchristos 0x3c LANG_GAELIC
100*29619d2aSchristos 0x3d LANG_YIDDISH
101*29619d2aSchristos 0x3e LANG_MALAY
102*29619d2aSchristos 0x3f LANG_KAZAK
103*29619d2aSchristos 0x40 LANG_KYRGYZ
104*29619d2aSchristos 0x41 LANG_SWAHILI
105*29619d2aSchristos 0x42 LANG_TURKMEN
106*29619d2aSchristos 0x43 LANG_UZBEK
107*29619d2aSchristos 0x44 LANG_TATAR
108*29619d2aSchristos 0x45 LANG_BENGALI
109*29619d2aSchristos 0x46 LANG_PUNJABI
110*29619d2aSchristos 0x47 LANG_GUJARATI
111*29619d2aSchristos 0x48 LANG_ORIYA
112*29619d2aSchristos 0x49 LANG_TAMIL
113*29619d2aSchristos 0x4a LANG_TELUGU
114*29619d2aSchristos 0x4b LANG_KANNADA
115*29619d2aSchristos 0x4c LANG_MALAYALAM
116*29619d2aSchristos 0x4d LANG_ASSAMESE
117*29619d2aSchristos 0x4e LANG_MARATHI
118*29619d2aSchristos 0x4f LANG_SANSKRIT
119*29619d2aSchristos 0x50 LANG_MONGOLIAN
120*29619d2aSchristos 0x51 LANG_TIBETAN
121*29619d2aSchristos 0x52 LANG_WELSH
122*29619d2aSchristos 0x53 LANG_CAMBODIAN
123*29619d2aSchristos 0x54 LANG_LAO
124*29619d2aSchristos 0x55 LANG_BURMESE
125*29619d2aSchristos 0x56 LANG_GALICIAN
126*29619d2aSchristos 0x57 LANG_KONKANI
127*29619d2aSchristos 0x58 LANG_MANIPURI
128*29619d2aSchristos 0x59 LANG_SINDHI
129*29619d2aSchristos 0x5a LANG_SYRIAC
130*29619d2aSchristos 0x5b LANG_SINHALESE
131*29619d2aSchristos 0x5c LANG_CHEROKEE
132*29619d2aSchristos 0x5d LANG_INUKTITUT
133*29619d2aSchristos 0x5e LANG_AMHARIC
134*29619d2aSchristos 0x5f LANG_TAMAZIGHT
135*29619d2aSchristos 0x60 LANG_KASHMIRI
136*29619d2aSchristos 0x61 LANG_NEPALI
137*29619d2aSchristos 0x62 LANG_FRISIAN
138*29619d2aSchristos 0x63 LANG_PASHTO
139*29619d2aSchristos 0x64 LANG_TAGALOG
140*29619d2aSchristos 0x65 LANG_DIVEHI
141*29619d2aSchristos 0x66 LANG_EDO
142*29619d2aSchristos 0x67 LANG_FULFULDE
143*29619d2aSchristos 0x68 LANG_HAUSA
144*29619d2aSchristos 0x69 LANG_IBIBIO
145*29619d2aSchristos 0x6a LANG_YORUBA
146*29619d2aSchristos 0x70 LANG_IGBO
147*29619d2aSchristos 0x71 LANG_KANURI
148*29619d2aSchristos 0x72 LANG_OROMO
149*29619d2aSchristos 0x73 LANG_TIGRINYA
150*29619d2aSchristos 0x74 LANG_GUARANI
151*29619d2aSchristos 0x75 LANG_HAWAIIAN
152*29619d2aSchristos 0x76 LANG_LATIN
153*29619d2aSchristos 0x77 LANG_SOMALI
154*29619d2aSchristos 0x78 LANG_YI
155*29619d2aSchristos 0x79 LANG_PAPIAMENTU
156*29619d2aSchristos */
157*29619d2aSchristos /* Mingw headers don't have latest language and sublanguage codes. */
158*29619d2aSchristos # ifndef LANG_AFRIKAANS
159*29619d2aSchristos # define LANG_AFRIKAANS 0x36
160*29619d2aSchristos # endif
161*29619d2aSchristos # ifndef LANG_ALBANIAN
162*29619d2aSchristos # define LANG_ALBANIAN 0x1c
163*29619d2aSchristos # endif
164*29619d2aSchristos # ifndef LANG_AMHARIC
165*29619d2aSchristos # define LANG_AMHARIC 0x5e
166*29619d2aSchristos # endif
167*29619d2aSchristos # ifndef LANG_ARABIC
168*29619d2aSchristos # define LANG_ARABIC 0x01
169*29619d2aSchristos # endif
170*29619d2aSchristos # ifndef LANG_ARMENIAN
171*29619d2aSchristos # define LANG_ARMENIAN 0x2b
172*29619d2aSchristos # endif
173*29619d2aSchristos # ifndef LANG_ASSAMESE
174*29619d2aSchristos # define LANG_ASSAMESE 0x4d
175*29619d2aSchristos # endif
176*29619d2aSchristos # ifndef LANG_AZERI
177*29619d2aSchristos # define LANG_AZERI 0x2c
178*29619d2aSchristos # endif
179*29619d2aSchristos # ifndef LANG_BASQUE
180*29619d2aSchristos # define LANG_BASQUE 0x2d
181*29619d2aSchristos # endif
182*29619d2aSchristos # ifndef LANG_BELARUSIAN
183*29619d2aSchristos # define LANG_BELARUSIAN 0x23
184*29619d2aSchristos # endif
185*29619d2aSchristos # ifndef LANG_BENGALI
186*29619d2aSchristos # define LANG_BENGALI 0x45
187*29619d2aSchristos # endif
188*29619d2aSchristos # ifndef LANG_BURMESE
189*29619d2aSchristos # define LANG_BURMESE 0x55
190*29619d2aSchristos # endif
191*29619d2aSchristos # ifndef LANG_CAMBODIAN
192*29619d2aSchristos # define LANG_CAMBODIAN 0x53
193*29619d2aSchristos # endif
194*29619d2aSchristos # ifndef LANG_CATALAN
195*29619d2aSchristos # define LANG_CATALAN 0x03
196*29619d2aSchristos # endif
197*29619d2aSchristos # ifndef LANG_CHEROKEE
198*29619d2aSchristos # define LANG_CHEROKEE 0x5c
199*29619d2aSchristos # endif
200*29619d2aSchristos # ifndef LANG_DIVEHI
201*29619d2aSchristos # define LANG_DIVEHI 0x65
202*29619d2aSchristos # endif
203*29619d2aSchristos # ifndef LANG_EDO
204*29619d2aSchristos # define LANG_EDO 0x66
205*29619d2aSchristos # endif
206*29619d2aSchristos # ifndef LANG_ESTONIAN
207*29619d2aSchristos # define LANG_ESTONIAN 0x25
208*29619d2aSchristos # endif
209*29619d2aSchristos # ifndef LANG_FAEROESE
210*29619d2aSchristos # define LANG_FAEROESE 0x38
211*29619d2aSchristos # endif
212*29619d2aSchristos # ifndef LANG_FARSI
213*29619d2aSchristos # define LANG_FARSI 0x29
214*29619d2aSchristos # endif
215*29619d2aSchristos # ifndef LANG_FRISIAN
216*29619d2aSchristos # define LANG_FRISIAN 0x62
217*29619d2aSchristos # endif
218*29619d2aSchristos # ifndef LANG_FULFULDE
219*29619d2aSchristos # define LANG_FULFULDE 0x67
220*29619d2aSchristos # endif
221*29619d2aSchristos # ifndef LANG_GAELIC
222*29619d2aSchristos # define LANG_GAELIC 0x3c
223*29619d2aSchristos # endif
224*29619d2aSchristos # ifndef LANG_GALICIAN
225*29619d2aSchristos # define LANG_GALICIAN 0x56
226*29619d2aSchristos # endif
227*29619d2aSchristos # ifndef LANG_GEORGIAN
228*29619d2aSchristos # define LANG_GEORGIAN 0x37
229*29619d2aSchristos # endif
230*29619d2aSchristos # ifndef LANG_GUARANI
231*29619d2aSchristos # define LANG_GUARANI 0x74
232*29619d2aSchristos # endif
233*29619d2aSchristos # ifndef LANG_GUJARATI
234*29619d2aSchristos # define LANG_GUJARATI 0x47
235*29619d2aSchristos # endif
236*29619d2aSchristos # ifndef LANG_HAUSA
237*29619d2aSchristos # define LANG_HAUSA 0x68
238*29619d2aSchristos # endif
239*29619d2aSchristos # ifndef LANG_HAWAIIAN
240*29619d2aSchristos # define LANG_HAWAIIAN 0x75
241*29619d2aSchristos # endif
242*29619d2aSchristos # ifndef LANG_HEBREW
243*29619d2aSchristos # define LANG_HEBREW 0x0d
244*29619d2aSchristos # endif
245*29619d2aSchristos # ifndef LANG_HINDI
246*29619d2aSchristos # define LANG_HINDI 0x39
247*29619d2aSchristos # endif
248*29619d2aSchristos # ifndef LANG_IBIBIO
249*29619d2aSchristos # define LANG_IBIBIO 0x69
250*29619d2aSchristos # endif
251*29619d2aSchristos # ifndef LANG_IGBO
252*29619d2aSchristos # define LANG_IGBO 0x70
253*29619d2aSchristos # endif
254*29619d2aSchristos # ifndef LANG_INDONESIAN
255*29619d2aSchristos # define LANG_INDONESIAN 0x21
256*29619d2aSchristos # endif
257*29619d2aSchristos # ifndef LANG_INUKTITUT
258*29619d2aSchristos # define LANG_INUKTITUT 0x5d
259*29619d2aSchristos # endif
260*29619d2aSchristos # ifndef LANG_KANNADA
261*29619d2aSchristos # define LANG_KANNADA 0x4b
262*29619d2aSchristos # endif
263*29619d2aSchristos # ifndef LANG_KANURI
264*29619d2aSchristos # define LANG_KANURI 0x71
265*29619d2aSchristos # endif
266*29619d2aSchristos # ifndef LANG_KASHMIRI
267*29619d2aSchristos # define LANG_KASHMIRI 0x60
268*29619d2aSchristos # endif
269*29619d2aSchristos # ifndef LANG_KAZAK
270*29619d2aSchristos # define LANG_KAZAK 0x3f
271*29619d2aSchristos # endif
272*29619d2aSchristos # ifndef LANG_KONKANI
273*29619d2aSchristos # define LANG_KONKANI 0x57
274*29619d2aSchristos # endif
275*29619d2aSchristos # ifndef LANG_KYRGYZ
276*29619d2aSchristos # define LANG_KYRGYZ 0x40
277*29619d2aSchristos # endif
278*29619d2aSchristos # ifndef LANG_LAO
279*29619d2aSchristos # define LANG_LAO 0x54
280*29619d2aSchristos # endif
281*29619d2aSchristos # ifndef LANG_LATIN
282*29619d2aSchristos # define LANG_LATIN 0x76
283*29619d2aSchristos # endif
284*29619d2aSchristos # ifndef LANG_LATVIAN
285*29619d2aSchristos # define LANG_LATVIAN 0x26
286*29619d2aSchristos # endif
287*29619d2aSchristos # ifndef LANG_LITHUANIAN
288*29619d2aSchristos # define LANG_LITHUANIAN 0x27
289*29619d2aSchristos # endif
290*29619d2aSchristos # ifndef LANG_MACEDONIAN
291*29619d2aSchristos # define LANG_MACEDONIAN 0x2f
292*29619d2aSchristos # endif
293*29619d2aSchristos # ifndef LANG_MALAY
294*29619d2aSchristos # define LANG_MALAY 0x3e
295*29619d2aSchristos # endif
296*29619d2aSchristos # ifndef LANG_MALAYALAM
297*29619d2aSchristos # define LANG_MALAYALAM 0x4c
298*29619d2aSchristos # endif
299*29619d2aSchristos # ifndef LANG_MALTESE
300*29619d2aSchristos # define LANG_MALTESE 0x3a
301*29619d2aSchristos # endif
302*29619d2aSchristos # ifndef LANG_MANIPURI
303*29619d2aSchristos # define LANG_MANIPURI 0x58
304*29619d2aSchristos # endif
305*29619d2aSchristos # ifndef LANG_MARATHI
306*29619d2aSchristos # define LANG_MARATHI 0x4e
307*29619d2aSchristos # endif
308*29619d2aSchristos # ifndef LANG_MONGOLIAN
309*29619d2aSchristos # define LANG_MONGOLIAN 0x50
310*29619d2aSchristos # endif
311*29619d2aSchristos # ifndef LANG_NEPALI
312*29619d2aSchristos # define LANG_NEPALI 0x61
313*29619d2aSchristos # endif
314*29619d2aSchristos # ifndef LANG_ORIYA
315*29619d2aSchristos # define LANG_ORIYA 0x48
316*29619d2aSchristos # endif
317*29619d2aSchristos # ifndef LANG_OROMO
318*29619d2aSchristos # define LANG_OROMO 0x72
319*29619d2aSchristos # endif
320*29619d2aSchristos # ifndef LANG_PAPIAMENTU
321*29619d2aSchristos # define LANG_PAPIAMENTU 0x79
322*29619d2aSchristos # endif
323*29619d2aSchristos # ifndef LANG_PASHTO
324*29619d2aSchristos # define LANG_PASHTO 0x63
325*29619d2aSchristos # endif
326*29619d2aSchristos # ifndef LANG_PUNJABI
327*29619d2aSchristos # define LANG_PUNJABI 0x46
328*29619d2aSchristos # endif
329*29619d2aSchristos # ifndef LANG_RHAETO_ROMANCE
330*29619d2aSchristos # define LANG_RHAETO_ROMANCE 0x17
331*29619d2aSchristos # endif
332*29619d2aSchristos # ifndef LANG_SAAMI
333*29619d2aSchristos # define LANG_SAAMI 0x3b
334*29619d2aSchristos # endif
335*29619d2aSchristos # ifndef LANG_SANSKRIT
336*29619d2aSchristos # define LANG_SANSKRIT 0x4f
337*29619d2aSchristos # endif
338*29619d2aSchristos # ifndef LANG_SERBIAN
339*29619d2aSchristos # define LANG_SERBIAN 0x1a
340*29619d2aSchristos # endif
341*29619d2aSchristos # ifndef LANG_SINDHI
342*29619d2aSchristos # define LANG_SINDHI 0x59
343*29619d2aSchristos # endif
344*29619d2aSchristos # ifndef LANG_SINHALESE
345*29619d2aSchristos # define LANG_SINHALESE 0x5b
346*29619d2aSchristos # endif
347*29619d2aSchristos # ifndef LANG_SLOVAK
348*29619d2aSchristos # define LANG_SLOVAK 0x1b
349*29619d2aSchristos # endif
350*29619d2aSchristos # ifndef LANG_SOMALI
351*29619d2aSchristos # define LANG_SOMALI 0x77
352*29619d2aSchristos # endif
353*29619d2aSchristos # ifndef LANG_SORBIAN
354*29619d2aSchristos # define LANG_SORBIAN 0x2e
355*29619d2aSchristos # endif
356*29619d2aSchristos # ifndef LANG_SUTU
357*29619d2aSchristos # define LANG_SUTU 0x30
358*29619d2aSchristos # endif
359*29619d2aSchristos # ifndef LANG_SWAHILI
360*29619d2aSchristos # define LANG_SWAHILI 0x41
361*29619d2aSchristos # endif
362*29619d2aSchristos # ifndef LANG_SYRIAC
363*29619d2aSchristos # define LANG_SYRIAC 0x5a
364*29619d2aSchristos # endif
365*29619d2aSchristos # ifndef LANG_TAGALOG
366*29619d2aSchristos # define LANG_TAGALOG 0x64
367*29619d2aSchristos # endif
368*29619d2aSchristos # ifndef LANG_TAJIK
369*29619d2aSchristos # define LANG_TAJIK 0x28
370*29619d2aSchristos # endif
371*29619d2aSchristos # ifndef LANG_TAMAZIGHT
372*29619d2aSchristos # define LANG_TAMAZIGHT 0x5f
373*29619d2aSchristos # endif
374*29619d2aSchristos # ifndef LANG_TAMIL
375*29619d2aSchristos # define LANG_TAMIL 0x49
376*29619d2aSchristos # endif
377*29619d2aSchristos # ifndef LANG_TATAR
378*29619d2aSchristos # define LANG_TATAR 0x44
379*29619d2aSchristos # endif
380*29619d2aSchristos # ifndef LANG_TELUGU
381*29619d2aSchristos # define LANG_TELUGU 0x4a
382*29619d2aSchristos # endif
383*29619d2aSchristos # ifndef LANG_THAI
384*29619d2aSchristos # define LANG_THAI 0x1e
385*29619d2aSchristos # endif
386*29619d2aSchristos # ifndef LANG_TIBETAN
387*29619d2aSchristos # define LANG_TIBETAN 0x51
388*29619d2aSchristos # endif
389*29619d2aSchristos # ifndef LANG_TIGRINYA
390*29619d2aSchristos # define LANG_TIGRINYA 0x73
391*29619d2aSchristos # endif
392*29619d2aSchristos # ifndef LANG_TSONGA
393*29619d2aSchristos # define LANG_TSONGA 0x31
394*29619d2aSchristos # endif
395*29619d2aSchristos # ifndef LANG_TSWANA
396*29619d2aSchristos # define LANG_TSWANA 0x32
397*29619d2aSchristos # endif
398*29619d2aSchristos # ifndef LANG_TURKMEN
399*29619d2aSchristos # define LANG_TURKMEN 0x42
400*29619d2aSchristos # endif
401*29619d2aSchristos # ifndef LANG_UKRAINIAN
402*29619d2aSchristos # define LANG_UKRAINIAN 0x22
403*29619d2aSchristos # endif
404*29619d2aSchristos # ifndef LANG_URDU
405*29619d2aSchristos # define LANG_URDU 0x20
406*29619d2aSchristos # endif
407*29619d2aSchristos # ifndef LANG_UZBEK
408*29619d2aSchristos # define LANG_UZBEK 0x43
409*29619d2aSchristos # endif
410*29619d2aSchristos # ifndef LANG_VENDA
411*29619d2aSchristos # define LANG_VENDA 0x33
412*29619d2aSchristos # endif
413*29619d2aSchristos # ifndef LANG_VIETNAMESE
414*29619d2aSchristos # define LANG_VIETNAMESE 0x2a
415*29619d2aSchristos # endif
416*29619d2aSchristos # ifndef LANG_WELSH
417*29619d2aSchristos # define LANG_WELSH 0x52
418*29619d2aSchristos # endif
419*29619d2aSchristos # ifndef LANG_XHOSA
420*29619d2aSchristos # define LANG_XHOSA 0x34
421*29619d2aSchristos # endif
422*29619d2aSchristos # ifndef LANG_YI
423*29619d2aSchristos # define LANG_YI 0x78
424*29619d2aSchristos # endif
425*29619d2aSchristos # ifndef LANG_YIDDISH
426*29619d2aSchristos # define LANG_YIDDISH 0x3d
427*29619d2aSchristos # endif
428*29619d2aSchristos # ifndef LANG_YORUBA
429*29619d2aSchristos # define LANG_YORUBA 0x6a
430*29619d2aSchristos # endif
431*29619d2aSchristos # ifndef LANG_ZULU
432*29619d2aSchristos # define LANG_ZULU 0x35
433*29619d2aSchristos # endif
434*29619d2aSchristos # ifndef SUBLANG_ARABIC_SAUDI_ARABIA
435*29619d2aSchristos # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
436*29619d2aSchristos # endif
437*29619d2aSchristos # ifndef SUBLANG_ARABIC_IRAQ
438*29619d2aSchristos # define SUBLANG_ARABIC_IRAQ 0x02
439*29619d2aSchristos # endif
440*29619d2aSchristos # ifndef SUBLANG_ARABIC_EGYPT
441*29619d2aSchristos # define SUBLANG_ARABIC_EGYPT 0x03
442*29619d2aSchristos # endif
443*29619d2aSchristos # ifndef SUBLANG_ARABIC_LIBYA
444*29619d2aSchristos # define SUBLANG_ARABIC_LIBYA 0x04
445*29619d2aSchristos # endif
446*29619d2aSchristos # ifndef SUBLANG_ARABIC_ALGERIA
447*29619d2aSchristos # define SUBLANG_ARABIC_ALGERIA 0x05
448*29619d2aSchristos # endif
449*29619d2aSchristos # ifndef SUBLANG_ARABIC_MOROCCO
450*29619d2aSchristos # define SUBLANG_ARABIC_MOROCCO 0x06
451*29619d2aSchristos # endif
452*29619d2aSchristos # ifndef SUBLANG_ARABIC_TUNISIA
453*29619d2aSchristos # define SUBLANG_ARABIC_TUNISIA 0x07
454*29619d2aSchristos # endif
455*29619d2aSchristos # ifndef SUBLANG_ARABIC_OMAN
456*29619d2aSchristos # define SUBLANG_ARABIC_OMAN 0x08
457*29619d2aSchristos # endif
458*29619d2aSchristos # ifndef SUBLANG_ARABIC_YEMEN
459*29619d2aSchristos # define SUBLANG_ARABIC_YEMEN 0x09
460*29619d2aSchristos # endif
461*29619d2aSchristos # ifndef SUBLANG_ARABIC_SYRIA
462*29619d2aSchristos # define SUBLANG_ARABIC_SYRIA 0x0a
463*29619d2aSchristos # endif
464*29619d2aSchristos # ifndef SUBLANG_ARABIC_JORDAN
465*29619d2aSchristos # define SUBLANG_ARABIC_JORDAN 0x0b
466*29619d2aSchristos # endif
467*29619d2aSchristos # ifndef SUBLANG_ARABIC_LEBANON
468*29619d2aSchristos # define SUBLANG_ARABIC_LEBANON 0x0c
469*29619d2aSchristos # endif
470*29619d2aSchristos # ifndef SUBLANG_ARABIC_KUWAIT
471*29619d2aSchristos # define SUBLANG_ARABIC_KUWAIT 0x0d
472*29619d2aSchristos # endif
473*29619d2aSchristos # ifndef SUBLANG_ARABIC_UAE
474*29619d2aSchristos # define SUBLANG_ARABIC_UAE 0x0e
475*29619d2aSchristos # endif
476*29619d2aSchristos # ifndef SUBLANG_ARABIC_BAHRAIN
477*29619d2aSchristos # define SUBLANG_ARABIC_BAHRAIN 0x0f
478*29619d2aSchristos # endif
479*29619d2aSchristos # ifndef SUBLANG_ARABIC_QATAR
480*29619d2aSchristos # define SUBLANG_ARABIC_QATAR 0x10
481*29619d2aSchristos # endif
482*29619d2aSchristos # ifndef SUBLANG_AZERI_LATIN
483*29619d2aSchristos # define SUBLANG_AZERI_LATIN 0x01
484*29619d2aSchristos # endif
485*29619d2aSchristos # ifndef SUBLANG_AZERI_CYRILLIC
486*29619d2aSchristos # define SUBLANG_AZERI_CYRILLIC 0x02
487*29619d2aSchristos # endif
488*29619d2aSchristos # ifndef SUBLANG_BENGALI_INDIA
489*29619d2aSchristos # define SUBLANG_BENGALI_INDIA 0x00
490*29619d2aSchristos # endif
491*29619d2aSchristos # ifndef SUBLANG_BENGALI_BANGLADESH
492*29619d2aSchristos # define SUBLANG_BENGALI_BANGLADESH 0x01
493*29619d2aSchristos # endif
494*29619d2aSchristos # ifndef SUBLANG_CHINESE_MACAU
495*29619d2aSchristos # define SUBLANG_CHINESE_MACAU 0x05
496*29619d2aSchristos # endif
497*29619d2aSchristos # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
498*29619d2aSchristos # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
499*29619d2aSchristos # endif
500*29619d2aSchristos # ifndef SUBLANG_ENGLISH_JAMAICA
501*29619d2aSchristos # define SUBLANG_ENGLISH_JAMAICA 0x08
502*29619d2aSchristos # endif
503*29619d2aSchristos # ifndef SUBLANG_ENGLISH_CARIBBEAN
504*29619d2aSchristos # define SUBLANG_ENGLISH_CARIBBEAN 0x09
505*29619d2aSchristos # endif
506*29619d2aSchristos # ifndef SUBLANG_ENGLISH_BELIZE
507*29619d2aSchristos # define SUBLANG_ENGLISH_BELIZE 0x0a
508*29619d2aSchristos # endif
509*29619d2aSchristos # ifndef SUBLANG_ENGLISH_TRINIDAD
510*29619d2aSchristos # define SUBLANG_ENGLISH_TRINIDAD 0x0b
511*29619d2aSchristos # endif
512*29619d2aSchristos # ifndef SUBLANG_ENGLISH_ZIMBABWE
513*29619d2aSchristos # define SUBLANG_ENGLISH_ZIMBABWE 0x0c
514*29619d2aSchristos # endif
515*29619d2aSchristos # ifndef SUBLANG_ENGLISH_PHILIPPINES
516*29619d2aSchristos # define SUBLANG_ENGLISH_PHILIPPINES 0x0d
517*29619d2aSchristos # endif
518*29619d2aSchristos # ifndef SUBLANG_ENGLISH_INDONESIA
519*29619d2aSchristos # define SUBLANG_ENGLISH_INDONESIA 0x0e
520*29619d2aSchristos # endif
521*29619d2aSchristos # ifndef SUBLANG_ENGLISH_HONGKONG
522*29619d2aSchristos # define SUBLANG_ENGLISH_HONGKONG 0x0f
523*29619d2aSchristos # endif
524*29619d2aSchristos # ifndef SUBLANG_ENGLISH_INDIA
525*29619d2aSchristos # define SUBLANG_ENGLISH_INDIA 0x10
526*29619d2aSchristos # endif
527*29619d2aSchristos # ifndef SUBLANG_ENGLISH_MALAYSIA
528*29619d2aSchristos # define SUBLANG_ENGLISH_MALAYSIA 0x11
529*29619d2aSchristos # endif
530*29619d2aSchristos # ifndef SUBLANG_ENGLISH_SINGAPORE
531*29619d2aSchristos # define SUBLANG_ENGLISH_SINGAPORE 0x12
532*29619d2aSchristos # endif
533*29619d2aSchristos # ifndef SUBLANG_FRENCH_LUXEMBOURG
534*29619d2aSchristos # define SUBLANG_FRENCH_LUXEMBOURG 0x05
535*29619d2aSchristos # endif
536*29619d2aSchristos # ifndef SUBLANG_FRENCH_MONACO
537*29619d2aSchristos # define SUBLANG_FRENCH_MONACO 0x06
538*29619d2aSchristos # endif
539*29619d2aSchristos # ifndef SUBLANG_FRENCH_WESTINDIES
540*29619d2aSchristos # define SUBLANG_FRENCH_WESTINDIES 0x07
541*29619d2aSchristos # endif
542*29619d2aSchristos # ifndef SUBLANG_FRENCH_REUNION
543*29619d2aSchristos # define SUBLANG_FRENCH_REUNION 0x08
544*29619d2aSchristos # endif
545*29619d2aSchristos # ifndef SUBLANG_FRENCH_CONGO
546*29619d2aSchristos # define SUBLANG_FRENCH_CONGO 0x09
547*29619d2aSchristos # endif
548*29619d2aSchristos # ifndef SUBLANG_FRENCH_SENEGAL
549*29619d2aSchristos # define SUBLANG_FRENCH_SENEGAL 0x0a
550*29619d2aSchristos # endif
551*29619d2aSchristos # ifndef SUBLANG_FRENCH_CAMEROON
552*29619d2aSchristos # define SUBLANG_FRENCH_CAMEROON 0x0b
553*29619d2aSchristos # endif
554*29619d2aSchristos # ifndef SUBLANG_FRENCH_COTEDIVOIRE
555*29619d2aSchristos # define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
556*29619d2aSchristos # endif
557*29619d2aSchristos # ifndef SUBLANG_FRENCH_MALI
558*29619d2aSchristos # define SUBLANG_FRENCH_MALI 0x0d
559*29619d2aSchristos # endif
560*29619d2aSchristos # ifndef SUBLANG_FRENCH_MOROCCO
561*29619d2aSchristos # define SUBLANG_FRENCH_MOROCCO 0x0e
562*29619d2aSchristos # endif
563*29619d2aSchristos # ifndef SUBLANG_FRENCH_HAITI
564*29619d2aSchristos # define SUBLANG_FRENCH_HAITI 0x0f
565*29619d2aSchristos # endif
566*29619d2aSchristos # ifndef SUBLANG_GERMAN_LUXEMBOURG
567*29619d2aSchristos # define SUBLANG_GERMAN_LUXEMBOURG 0x04
568*29619d2aSchristos # endif
569*29619d2aSchristos # ifndef SUBLANG_GERMAN_LIECHTENSTEIN
570*29619d2aSchristos # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
571*29619d2aSchristos # endif
572*29619d2aSchristos # ifndef SUBLANG_KASHMIRI_INDIA
573*29619d2aSchristos # define SUBLANG_KASHMIRI_INDIA 0x02
574*29619d2aSchristos # endif
575*29619d2aSchristos # ifndef SUBLANG_MALAY_MALAYSIA
576*29619d2aSchristos # define SUBLANG_MALAY_MALAYSIA 0x01
577*29619d2aSchristos # endif
578*29619d2aSchristos # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
579*29619d2aSchristos # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
580*29619d2aSchristos # endif
581*29619d2aSchristos # ifndef SUBLANG_NEPALI_INDIA
582*29619d2aSchristos # define SUBLANG_NEPALI_INDIA 0x02
583*29619d2aSchristos # endif
584*29619d2aSchristos # ifndef SUBLANG_PUNJABI_INDIA
585*29619d2aSchristos # define SUBLANG_PUNJABI_INDIA 0x00
586*29619d2aSchristos # endif
587*29619d2aSchristos # ifndef SUBLANG_PUNJABI_PAKISTAN
588*29619d2aSchristos # define SUBLANG_PUNJABI_PAKISTAN 0x01
589*29619d2aSchristos # endif
590*29619d2aSchristos # ifndef SUBLANG_ROMANIAN_ROMANIA
591*29619d2aSchristos # define SUBLANG_ROMANIAN_ROMANIA 0x00
592*29619d2aSchristos # endif
593*29619d2aSchristos # ifndef SUBLANG_ROMANIAN_MOLDOVA
594*29619d2aSchristos # define SUBLANG_ROMANIAN_MOLDOVA 0x01
595*29619d2aSchristos # endif
596*29619d2aSchristos # ifndef SUBLANG_SERBIAN_LATIN
597*29619d2aSchristos # define SUBLANG_SERBIAN_LATIN 0x02
598*29619d2aSchristos # endif
599*29619d2aSchristos # ifndef SUBLANG_SERBIAN_CYRILLIC
600*29619d2aSchristos # define SUBLANG_SERBIAN_CYRILLIC 0x03
601*29619d2aSchristos # endif
602*29619d2aSchristos # ifndef SUBLANG_SINDHI_INDIA
603*29619d2aSchristos # define SUBLANG_SINDHI_INDIA 0x00
604*29619d2aSchristos # endif
605*29619d2aSchristos # ifndef SUBLANG_SINDHI_PAKISTAN
606*29619d2aSchristos # define SUBLANG_SINDHI_PAKISTAN 0x01
607*29619d2aSchristos # endif
608*29619d2aSchristos # ifndef SUBLANG_SPANISH_GUATEMALA
609*29619d2aSchristos # define SUBLANG_SPANISH_GUATEMALA 0x04
610*29619d2aSchristos # endif
611*29619d2aSchristos # ifndef SUBLANG_SPANISH_COSTA_RICA
612*29619d2aSchristos # define SUBLANG_SPANISH_COSTA_RICA 0x05
613*29619d2aSchristos # endif
614*29619d2aSchristos # ifndef SUBLANG_SPANISH_PANAMA
615*29619d2aSchristos # define SUBLANG_SPANISH_PANAMA 0x06
616*29619d2aSchristos # endif
617*29619d2aSchristos # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
618*29619d2aSchristos # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
619*29619d2aSchristos # endif
620*29619d2aSchristos # ifndef SUBLANG_SPANISH_VENEZUELA
621*29619d2aSchristos # define SUBLANG_SPANISH_VENEZUELA 0x08
622*29619d2aSchristos # endif
623*29619d2aSchristos # ifndef SUBLANG_SPANISH_COLOMBIA
624*29619d2aSchristos # define SUBLANG_SPANISH_COLOMBIA 0x09
625*29619d2aSchristos # endif
626*29619d2aSchristos # ifndef SUBLANG_SPANISH_PERU
627*29619d2aSchristos # define SUBLANG_SPANISH_PERU 0x0a
628*29619d2aSchristos # endif
629*29619d2aSchristos # ifndef SUBLANG_SPANISH_ARGENTINA
630*29619d2aSchristos # define SUBLANG_SPANISH_ARGENTINA 0x0b
631*29619d2aSchristos # endif
632*29619d2aSchristos # ifndef SUBLANG_SPANISH_ECUADOR
633*29619d2aSchristos # define SUBLANG_SPANISH_ECUADOR 0x0c
634*29619d2aSchristos # endif
635*29619d2aSchristos # ifndef SUBLANG_SPANISH_CHILE
636*29619d2aSchristos # define SUBLANG_SPANISH_CHILE 0x0d
637*29619d2aSchristos # endif
638*29619d2aSchristos # ifndef SUBLANG_SPANISH_URUGUAY
639*29619d2aSchristos # define SUBLANG_SPANISH_URUGUAY 0x0e
640*29619d2aSchristos # endif
641*29619d2aSchristos # ifndef SUBLANG_SPANISH_PARAGUAY
642*29619d2aSchristos # define SUBLANG_SPANISH_PARAGUAY 0x0f
643*29619d2aSchristos # endif
644*29619d2aSchristos # ifndef SUBLANG_SPANISH_BOLIVIA
645*29619d2aSchristos # define SUBLANG_SPANISH_BOLIVIA 0x10
646*29619d2aSchristos # endif
647*29619d2aSchristos # ifndef SUBLANG_SPANISH_EL_SALVADOR
648*29619d2aSchristos # define SUBLANG_SPANISH_EL_SALVADOR 0x11
649*29619d2aSchristos # endif
650*29619d2aSchristos # ifndef SUBLANG_SPANISH_HONDURAS
651*29619d2aSchristos # define SUBLANG_SPANISH_HONDURAS 0x12
652*29619d2aSchristos # endif
653*29619d2aSchristos # ifndef SUBLANG_SPANISH_NICARAGUA
654*29619d2aSchristos # define SUBLANG_SPANISH_NICARAGUA 0x13
655*29619d2aSchristos # endif
656*29619d2aSchristos # ifndef SUBLANG_SPANISH_PUERTO_RICO
657*29619d2aSchristos # define SUBLANG_SPANISH_PUERTO_RICO 0x14
658*29619d2aSchristos # endif
659*29619d2aSchristos # ifndef SUBLANG_SWEDISH_FINLAND
660*29619d2aSchristos # define SUBLANG_SWEDISH_FINLAND 0x02
661*29619d2aSchristos # endif
662*29619d2aSchristos # ifndef SUBLANG_TAMAZIGHT_ARABIC
663*29619d2aSchristos # define SUBLANG_TAMAZIGHT_ARABIC 0x01
664*29619d2aSchristos # endif
665*29619d2aSchristos # ifndef SUBLANG_TAMAZIGHT_LATIN
666*29619d2aSchristos # define SUBLANG_TAMAZIGHT_LATIN 0x02
667*29619d2aSchristos # endif
668*29619d2aSchristos # ifndef SUBLANG_TIGRINYA_ETHIOPIA
669*29619d2aSchristos # define SUBLANG_TIGRINYA_ETHIOPIA 0x00
670*29619d2aSchristos # endif
671*29619d2aSchristos # ifndef SUBLANG_TIGRINYA_ERITREA
672*29619d2aSchristos # define SUBLANG_TIGRINYA_ERITREA 0x01
673*29619d2aSchristos # endif
674*29619d2aSchristos # ifndef SUBLANG_URDU_PAKISTAN
675*29619d2aSchristos # define SUBLANG_URDU_PAKISTAN 0x01
676*29619d2aSchristos # endif
677*29619d2aSchristos # ifndef SUBLANG_URDU_INDIA
678*29619d2aSchristos # define SUBLANG_URDU_INDIA 0x02
679*29619d2aSchristos # endif
680*29619d2aSchristos # ifndef SUBLANG_UZBEK_LATIN
681*29619d2aSchristos # define SUBLANG_UZBEK_LATIN 0x01
682*29619d2aSchristos # endif
683*29619d2aSchristos # ifndef SUBLANG_UZBEK_CYRILLIC
684*29619d2aSchristos # define SUBLANG_UZBEK_CYRILLIC 0x02
685*29619d2aSchristos # endif
686*29619d2aSchristos #endif
687*29619d2aSchristos
688*29619d2aSchristos /* XPG3 defines the result of 'setlocale (category, NULL)' as:
689*29619d2aSchristos "Directs 'setlocale()' to query 'category' and return the current
690*29619d2aSchristos setting of 'local'."
691*29619d2aSchristos However it does not specify the exact format. Neither do SUSV2 and
692*29619d2aSchristos ISO C 99. So we can use this feature only on selected systems (e.g.
693*29619d2aSchristos those using GNU C Library). */
694*29619d2aSchristos #if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
695*29619d2aSchristos # define HAVE_LOCALE_NULL
696*29619d2aSchristos #endif
697*29619d2aSchristos
698*29619d2aSchristos /* Determine the current locale's name, and canonicalize it into XPG syntax
699*29619d2aSchristos language[_territory[.codeset]][@modifier]
700*29619d2aSchristos The codeset part in the result is not reliable; the locale_charset()
701*29619d2aSchristos should be used for codeset information instead.
702*29619d2aSchristos The result must not be freed; it is statically allocated. */
703*29619d2aSchristos
704*29619d2aSchristos const char *
_nl_locale_name(int category,const char * categoryname)705*29619d2aSchristos _nl_locale_name (int category, const char *categoryname)
706*29619d2aSchristos {
707*29619d2aSchristos const char *retval;
708*29619d2aSchristos
709*29619d2aSchristos #ifndef WIN32
710*29619d2aSchristos
711*29619d2aSchristos /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
712*29619d2aSchristos On some systems this can be done by the 'setlocale' function itself. */
713*29619d2aSchristos # if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
714*29619d2aSchristos retval = setlocale (category, NULL);
715*29619d2aSchristos # else
716*29619d2aSchristos /* Setting of LC_ALL overwrites all other. */
717*29619d2aSchristos retval = getenv ("LC_ALL");
718*29619d2aSchristos if (retval == NULL || retval[0] == '\0')
719*29619d2aSchristos {
720*29619d2aSchristos /* Next comes the name of the desired category. */
721*29619d2aSchristos retval = getenv (categoryname);
722*29619d2aSchristos if (retval == NULL || retval[0] == '\0')
723*29619d2aSchristos {
724*29619d2aSchristos /* Last possibility is the LANG environment variable. */
725*29619d2aSchristos retval = getenv ("LANG");
726*29619d2aSchristos if (retval == NULL || retval[0] == '\0')
727*29619d2aSchristos /* We use C as the default domain. POSIX says this is
728*29619d2aSchristos implementation defined. */
729*29619d2aSchristos retval = "C";
730*29619d2aSchristos }
731*29619d2aSchristos }
732*29619d2aSchristos # endif
733*29619d2aSchristos
734*29619d2aSchristos return retval;
735*29619d2aSchristos
736*29619d2aSchristos #else /* WIN32 */
737*29619d2aSchristos
738*29619d2aSchristos /* Return an XPG style locale name language[_territory][@modifier].
739*29619d2aSchristos Don't even bother determining the codeset; it's not useful in this
740*29619d2aSchristos context, because message catalogs are not specific to a single
741*29619d2aSchristos codeset. */
742*29619d2aSchristos
743*29619d2aSchristos LCID lcid;
744*29619d2aSchristos LANGID langid;
745*29619d2aSchristos int primary, sub;
746*29619d2aSchristos
747*29619d2aSchristos /* Let the user override the system settings through environment
748*29619d2aSchristos variables, as on POSIX systems. */
749*29619d2aSchristos retval = getenv ("LC_ALL");
750*29619d2aSchristos if (retval != NULL && retval[0] != '\0')
751*29619d2aSchristos return retval;
752*29619d2aSchristos retval = getenv (categoryname);
753*29619d2aSchristos if (retval != NULL && retval[0] != '\0')
754*29619d2aSchristos return retval;
755*29619d2aSchristos retval = getenv ("LANG");
756*29619d2aSchristos if (retval != NULL && retval[0] != '\0')
757*29619d2aSchristos return retval;
758*29619d2aSchristos
759*29619d2aSchristos /* Use native Win32 API locale ID. */
760*29619d2aSchristos lcid = GetThreadLocale ();
761*29619d2aSchristos
762*29619d2aSchristos /* Strip off the sorting rules, keep only the language part. */
763*29619d2aSchristos langid = LANGIDFROMLCID (lcid);
764*29619d2aSchristos
765*29619d2aSchristos /* Split into language and territory part. */
766*29619d2aSchristos primary = PRIMARYLANGID (langid);
767*29619d2aSchristos sub = SUBLANGID (langid);
768*29619d2aSchristos
769*29619d2aSchristos /* Dispatch on language.
770*29619d2aSchristos See also http://www.unicode.org/unicode/onlinedat/languages.html .
771*29619d2aSchristos For details about languages, see http://www.ethnologue.com/ . */
772*29619d2aSchristos switch (primary)
773*29619d2aSchristos {
774*29619d2aSchristos case LANG_AFRIKAANS: return "af_ZA";
775*29619d2aSchristos case LANG_ALBANIAN: return "sq_AL";
776*29619d2aSchristos case LANG_AMHARIC: return "am_ET";
777*29619d2aSchristos case LANG_ARABIC:
778*29619d2aSchristos switch (sub)
779*29619d2aSchristos {
780*29619d2aSchristos case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
781*29619d2aSchristos case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
782*29619d2aSchristos case SUBLANG_ARABIC_EGYPT: return "ar_EG";
783*29619d2aSchristos case SUBLANG_ARABIC_LIBYA: return "ar_LY";
784*29619d2aSchristos case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
785*29619d2aSchristos case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
786*29619d2aSchristos case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
787*29619d2aSchristos case SUBLANG_ARABIC_OMAN: return "ar_OM";
788*29619d2aSchristos case SUBLANG_ARABIC_YEMEN: return "ar_YE";
789*29619d2aSchristos case SUBLANG_ARABIC_SYRIA: return "ar_SY";
790*29619d2aSchristos case SUBLANG_ARABIC_JORDAN: return "ar_JO";
791*29619d2aSchristos case SUBLANG_ARABIC_LEBANON: return "ar_LB";
792*29619d2aSchristos case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
793*29619d2aSchristos case SUBLANG_ARABIC_UAE: return "ar_AE";
794*29619d2aSchristos case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
795*29619d2aSchristos case SUBLANG_ARABIC_QATAR: return "ar_QA";
796*29619d2aSchristos }
797*29619d2aSchristos return "ar";
798*29619d2aSchristos case LANG_ARMENIAN: return "hy_AM";
799*29619d2aSchristos case LANG_ASSAMESE: return "as_IN";
800*29619d2aSchristos case LANG_AZERI:
801*29619d2aSchristos switch (sub)
802*29619d2aSchristos {
803*29619d2aSchristos /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
804*29619d2aSchristos case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
805*29619d2aSchristos case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
806*29619d2aSchristos }
807*29619d2aSchristos return "az";
808*29619d2aSchristos case LANG_BASQUE:
809*29619d2aSchristos return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
810*29619d2aSchristos case LANG_BELARUSIAN: return "be_BY";
811*29619d2aSchristos case LANG_BENGALI:
812*29619d2aSchristos switch (sub)
813*29619d2aSchristos {
814*29619d2aSchristos case SUBLANG_BENGALI_INDIA: return "bn_IN";
815*29619d2aSchristos case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
816*29619d2aSchristos }
817*29619d2aSchristos return "bn";
818*29619d2aSchristos case LANG_BULGARIAN: return "bg_BG";
819*29619d2aSchristos case LANG_BURMESE: return "my_MM";
820*29619d2aSchristos case LANG_CAMBODIAN: return "km_KH";
821*29619d2aSchristos case LANG_CATALAN: return "ca_ES";
822*29619d2aSchristos case LANG_CHEROKEE: return "chr_US";
823*29619d2aSchristos case LANG_CHINESE:
824*29619d2aSchristos switch (sub)
825*29619d2aSchristos {
826*29619d2aSchristos case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
827*29619d2aSchristos case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
828*29619d2aSchristos case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
829*29619d2aSchristos case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
830*29619d2aSchristos case SUBLANG_CHINESE_MACAU: return "zh_MO";
831*29619d2aSchristos }
832*29619d2aSchristos return "zh";
833*29619d2aSchristos case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
834*29619d2aSchristos * What used to be called Serbo-Croatian
835*29619d2aSchristos * should really now be two separate
836*29619d2aSchristos * languages because of political reasons.
837*29619d2aSchristos * (Says tml, who knows nothing about Serbian
838*29619d2aSchristos * or Croatian.)
839*29619d2aSchristos * (I can feel those flames coming already.)
840*29619d2aSchristos */
841*29619d2aSchristos switch (sub)
842*29619d2aSchristos {
843*29619d2aSchristos case SUBLANG_DEFAULT: return "hr_HR";
844*29619d2aSchristos case SUBLANG_SERBIAN_LATIN: return "sr_CS";
845*29619d2aSchristos case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
846*29619d2aSchristos }
847*29619d2aSchristos return "hr";
848*29619d2aSchristos case LANG_CZECH: return "cs_CZ";
849*29619d2aSchristos case LANG_DANISH: return "da_DK";
850*29619d2aSchristos case LANG_DIVEHI: return "dv_MV";
851*29619d2aSchristos case LANG_DUTCH:
852*29619d2aSchristos switch (sub)
853*29619d2aSchristos {
854*29619d2aSchristos case SUBLANG_DUTCH: return "nl_NL";
855*29619d2aSchristos case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
856*29619d2aSchristos }
857*29619d2aSchristos return "nl";
858*29619d2aSchristos case LANG_EDO: return "bin_NG";
859*29619d2aSchristos case LANG_ENGLISH:
860*29619d2aSchristos switch (sub)
861*29619d2aSchristos {
862*29619d2aSchristos /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
863*29619d2aSchristos * English was the language spoken in England.
864*29619d2aSchristos * Oh well.
865*29619d2aSchristos */
866*29619d2aSchristos case SUBLANG_ENGLISH_US: return "en_US";
867*29619d2aSchristos case SUBLANG_ENGLISH_UK: return "en_GB";
868*29619d2aSchristos case SUBLANG_ENGLISH_AUS: return "en_AU";
869*29619d2aSchristos case SUBLANG_ENGLISH_CAN: return "en_CA";
870*29619d2aSchristos case SUBLANG_ENGLISH_NZ: return "en_NZ";
871*29619d2aSchristos case SUBLANG_ENGLISH_EIRE: return "en_IE";
872*29619d2aSchristos case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
873*29619d2aSchristos case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
874*29619d2aSchristos case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
875*29619d2aSchristos case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
876*29619d2aSchristos case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
877*29619d2aSchristos case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
878*29619d2aSchristos case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
879*29619d2aSchristos case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
880*29619d2aSchristos case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
881*29619d2aSchristos case SUBLANG_ENGLISH_INDIA: return "en_IN";
882*29619d2aSchristos case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
883*29619d2aSchristos case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
884*29619d2aSchristos }
885*29619d2aSchristos return "en";
886*29619d2aSchristos case LANG_ESTONIAN: return "et_EE";
887*29619d2aSchristos case LANG_FAEROESE: return "fo_FO";
888*29619d2aSchristos case LANG_FARSI: return "fa_IR";
889*29619d2aSchristos case LANG_FINNISH: return "fi_FI";
890*29619d2aSchristos case LANG_FRENCH:
891*29619d2aSchristos switch (sub)
892*29619d2aSchristos {
893*29619d2aSchristos case SUBLANG_FRENCH: return "fr_FR";
894*29619d2aSchristos case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
895*29619d2aSchristos case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
896*29619d2aSchristos case SUBLANG_FRENCH_SWISS: return "fr_CH";
897*29619d2aSchristos case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
898*29619d2aSchristos case SUBLANG_FRENCH_MONACO: return "fr_MC";
899*29619d2aSchristos case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
900*29619d2aSchristos case SUBLANG_FRENCH_REUNION: return "fr_RE";
901*29619d2aSchristos case SUBLANG_FRENCH_CONGO: return "fr_CG";
902*29619d2aSchristos case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
903*29619d2aSchristos case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
904*29619d2aSchristos case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
905*29619d2aSchristos case SUBLANG_FRENCH_MALI: return "fr_ML";
906*29619d2aSchristos case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
907*29619d2aSchristos case SUBLANG_FRENCH_HAITI: return "fr_HT";
908*29619d2aSchristos }
909*29619d2aSchristos return "fr";
910*29619d2aSchristos case LANG_FRISIAN: return "fy_NL";
911*29619d2aSchristos case LANG_FULFULDE:
912*29619d2aSchristos /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
913*29619d2aSchristos return "ff_NG";
914*29619d2aSchristos case LANG_GAELIC:
915*29619d2aSchristos switch (sub)
916*29619d2aSchristos {
917*29619d2aSchristos case 0x01: /* SCOTTISH */ return "gd_GB";
918*29619d2aSchristos case 0x02: /* IRISH */ return "ga_IE";
919*29619d2aSchristos }
920*29619d2aSchristos return "C";
921*29619d2aSchristos case LANG_GALICIAN: return "gl_ES";
922*29619d2aSchristos case LANG_GEORGIAN: return "ka_GE";
923*29619d2aSchristos case LANG_GERMAN:
924*29619d2aSchristos switch (sub)
925*29619d2aSchristos {
926*29619d2aSchristos case SUBLANG_GERMAN: return "de_DE";
927*29619d2aSchristos case SUBLANG_GERMAN_SWISS: return "de_CH";
928*29619d2aSchristos case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
929*29619d2aSchristos case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
930*29619d2aSchristos case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
931*29619d2aSchristos }
932*29619d2aSchristos return "de";
933*29619d2aSchristos case LANG_GREEK: return "el_GR";
934*29619d2aSchristos case LANG_GUARANI: return "gn_PY";
935*29619d2aSchristos case LANG_GUJARATI: return "gu_IN";
936*29619d2aSchristos case LANG_HAUSA: return "ha_NG";
937*29619d2aSchristos case LANG_HAWAIIAN:
938*29619d2aSchristos /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
939*29619d2aSchristos or Hawaii Creole English ("cpe_US", 600000 speakers)? */
940*29619d2aSchristos return "cpe_US";
941*29619d2aSchristos case LANG_HEBREW: return "he_IL";
942*29619d2aSchristos case LANG_HINDI: return "hi_IN";
943*29619d2aSchristos case LANG_HUNGARIAN: return "hu_HU";
944*29619d2aSchristos case LANG_IBIBIO: return "nic_NG";
945*29619d2aSchristos case LANG_ICELANDIC: return "is_IS";
946*29619d2aSchristos case LANG_IGBO: return "ig_NG";
947*29619d2aSchristos case LANG_INDONESIAN: return "id_ID";
948*29619d2aSchristos case LANG_INUKTITUT: return "iu_CA";
949*29619d2aSchristos case LANG_ITALIAN:
950*29619d2aSchristos switch (sub)
951*29619d2aSchristos {
952*29619d2aSchristos case SUBLANG_ITALIAN: return "it_IT";
953*29619d2aSchristos case SUBLANG_ITALIAN_SWISS: return "it_CH";
954*29619d2aSchristos }
955*29619d2aSchristos return "it";
956*29619d2aSchristos case LANG_JAPANESE: return "ja_JP";
957*29619d2aSchristos case LANG_KANNADA: return "kn_IN";
958*29619d2aSchristos case LANG_KANURI: return "kr_NG";
959*29619d2aSchristos case LANG_KASHMIRI:
960*29619d2aSchristos switch (sub)
961*29619d2aSchristos {
962*29619d2aSchristos case SUBLANG_DEFAULT: return "ks_PK";
963*29619d2aSchristos case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
964*29619d2aSchristos }
965*29619d2aSchristos return "ks";
966*29619d2aSchristos case LANG_KAZAK: return "kk_KZ";
967*29619d2aSchristos case LANG_KONKANI:
968*29619d2aSchristos /* FIXME: Adjust this when such locales appear on Unix. */
969*29619d2aSchristos return "kok_IN";
970*29619d2aSchristos case LANG_KOREAN: return "ko_KR";
971*29619d2aSchristos case LANG_KYRGYZ: return "ky_KG";
972*29619d2aSchristos case LANG_LAO: return "lo_LA";
973*29619d2aSchristos case LANG_LATIN: return "la_VA";
974*29619d2aSchristos case LANG_LATVIAN: return "lv_LV";
975*29619d2aSchristos case LANG_LITHUANIAN: return "lt_LT";
976*29619d2aSchristos case LANG_MACEDONIAN: return "mk_MK";
977*29619d2aSchristos case LANG_MALAY:
978*29619d2aSchristos switch (sub)
979*29619d2aSchristos {
980*29619d2aSchristos case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
981*29619d2aSchristos case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
982*29619d2aSchristos }
983*29619d2aSchristos return "ms";
984*29619d2aSchristos case LANG_MALAYALAM: return "ml_IN";
985*29619d2aSchristos case LANG_MALTESE: return "mt_MT";
986*29619d2aSchristos case LANG_MANIPURI:
987*29619d2aSchristos /* FIXME: Adjust this when such locales appear on Unix. */
988*29619d2aSchristos return "mni_IN";
989*29619d2aSchristos case LANG_MARATHI: return "mr_IN";
990*29619d2aSchristos case LANG_MONGOLIAN:
991*29619d2aSchristos return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
992*29619d2aSchristos case LANG_NEPALI:
993*29619d2aSchristos switch (sub)
994*29619d2aSchristos {
995*29619d2aSchristos case SUBLANG_DEFAULT: return "ne_NP";
996*29619d2aSchristos case SUBLANG_NEPALI_INDIA: return "ne_IN";
997*29619d2aSchristos }
998*29619d2aSchristos return "ne";
999*29619d2aSchristos case LANG_NORWEGIAN:
1000*29619d2aSchristos switch (sub)
1001*29619d2aSchristos {
1002*29619d2aSchristos case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
1003*29619d2aSchristos case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
1004*29619d2aSchristos }
1005*29619d2aSchristos return "no";
1006*29619d2aSchristos case LANG_ORIYA: return "or_IN";
1007*29619d2aSchristos case LANG_OROMO: return "om_ET";
1008*29619d2aSchristos case LANG_PAPIAMENTU: return "pap_AN";
1009*29619d2aSchristos case LANG_PASHTO:
1010*29619d2aSchristos return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
1011*29619d2aSchristos case LANG_POLISH: return "pl_PL";
1012*29619d2aSchristos case LANG_PORTUGUESE:
1013*29619d2aSchristos switch (sub)
1014*29619d2aSchristos {
1015*29619d2aSchristos case SUBLANG_PORTUGUESE: return "pt_PT";
1016*29619d2aSchristos /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
1017*29619d2aSchristos Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
1018*29619d2aSchristos case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
1019*29619d2aSchristos }
1020*29619d2aSchristos return "pt";
1021*29619d2aSchristos case LANG_PUNJABI:
1022*29619d2aSchristos switch (sub)
1023*29619d2aSchristos {
1024*29619d2aSchristos case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
1025*29619d2aSchristos case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
1026*29619d2aSchristos }
1027*29619d2aSchristos return "pa";
1028*29619d2aSchristos case LANG_RHAETO_ROMANCE: return "rm_CH";
1029*29619d2aSchristos case LANG_ROMANIAN:
1030*29619d2aSchristos switch (sub)
1031*29619d2aSchristos {
1032*29619d2aSchristos case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
1033*29619d2aSchristos case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
1034*29619d2aSchristos }
1035*29619d2aSchristos return "ro";
1036*29619d2aSchristos case LANG_RUSSIAN:
1037*29619d2aSchristos return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */
1038*29619d2aSchristos case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
1039*29619d2aSchristos case LANG_SANSKRIT: return "sa_IN";
1040*29619d2aSchristos case LANG_SINDHI:
1041*29619d2aSchristos switch (sub)
1042*29619d2aSchristos {
1043*29619d2aSchristos case SUBLANG_SINDHI_INDIA: return "sd_IN";
1044*29619d2aSchristos case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
1045*29619d2aSchristos }
1046*29619d2aSchristos return "sd";
1047*29619d2aSchristos case LANG_SINHALESE: return "si_LK";
1048*29619d2aSchristos case LANG_SLOVAK: return "sk_SK";
1049*29619d2aSchristos case LANG_SLOVENIAN: return "sl_SI";
1050*29619d2aSchristos case LANG_SOMALI: return "so_SO";
1051*29619d2aSchristos case LANG_SORBIAN:
1052*29619d2aSchristos /* FIXME: Adjust this when such locales appear on Unix. */
1053*29619d2aSchristos return "wen_DE";
1054*29619d2aSchristos case LANG_SPANISH:
1055*29619d2aSchristos switch (sub)
1056*29619d2aSchristos {
1057*29619d2aSchristos case SUBLANG_SPANISH: return "es_ES";
1058*29619d2aSchristos case SUBLANG_SPANISH_MEXICAN: return "es_MX";
1059*29619d2aSchristos case SUBLANG_SPANISH_MODERN:
1060*29619d2aSchristos return "es_ES@modern"; /* not seen on Unix */
1061*29619d2aSchristos case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
1062*29619d2aSchristos case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
1063*29619d2aSchristos case SUBLANG_SPANISH_PANAMA: return "es_PA";
1064*29619d2aSchristos case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
1065*29619d2aSchristos case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
1066*29619d2aSchristos case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
1067*29619d2aSchristos case SUBLANG_SPANISH_PERU: return "es_PE";
1068*29619d2aSchristos case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
1069*29619d2aSchristos case SUBLANG_SPANISH_ECUADOR: return "es_EC";
1070*29619d2aSchristos case SUBLANG_SPANISH_CHILE: return "es_CL";
1071*29619d2aSchristos case SUBLANG_SPANISH_URUGUAY: return "es_UY";
1072*29619d2aSchristos case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
1073*29619d2aSchristos case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
1074*29619d2aSchristos case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
1075*29619d2aSchristos case SUBLANG_SPANISH_HONDURAS: return "es_HN";
1076*29619d2aSchristos case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
1077*29619d2aSchristos case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
1078*29619d2aSchristos }
1079*29619d2aSchristos return "es";
1080*29619d2aSchristos case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
1081*29619d2aSchristos case LANG_SWAHILI: return "sw_KE";
1082*29619d2aSchristos case LANG_SWEDISH:
1083*29619d2aSchristos switch (sub)
1084*29619d2aSchristos {
1085*29619d2aSchristos case SUBLANG_DEFAULT: return "sv_SE";
1086*29619d2aSchristos case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
1087*29619d2aSchristos }
1088*29619d2aSchristos return "sv";
1089*29619d2aSchristos case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
1090*29619d2aSchristos case LANG_TAGALOG: return "tl_PH";
1091*29619d2aSchristos case LANG_TAJIK: return "tg_TJ";
1092*29619d2aSchristos case LANG_TAMAZIGHT:
1093*29619d2aSchristos switch (sub)
1094*29619d2aSchristos {
1095*29619d2aSchristos /* FIXME: Adjust this when Tamazight locales appear on Unix. */
1096*29619d2aSchristos case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
1097*29619d2aSchristos case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
1098*29619d2aSchristos }
1099*29619d2aSchristos return "ber_MA";
1100*29619d2aSchristos case LANG_TAMIL:
1101*29619d2aSchristos return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
1102*29619d2aSchristos case LANG_TATAR: return "tt_RU";
1103*29619d2aSchristos case LANG_TELUGU: return "te_IN";
1104*29619d2aSchristos case LANG_THAI: return "th_TH";
1105*29619d2aSchristos case LANG_TIBETAN: return "bo_CN";
1106*29619d2aSchristos case LANG_TIGRINYA:
1107*29619d2aSchristos switch (sub)
1108*29619d2aSchristos {
1109*29619d2aSchristos case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
1110*29619d2aSchristos case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
1111*29619d2aSchristos }
1112*29619d2aSchristos return "ti";
1113*29619d2aSchristos case LANG_TSONGA: return "ts_ZA";
1114*29619d2aSchristos case LANG_TSWANA: return "tn_BW";
1115*29619d2aSchristos case LANG_TURKISH: return "tr_TR";
1116*29619d2aSchristos case LANG_TURKMEN: return "tk_TM";
1117*29619d2aSchristos case LANG_UKRAINIAN: return "uk_UA";
1118*29619d2aSchristos case LANG_URDU:
1119*29619d2aSchristos switch (sub)
1120*29619d2aSchristos {
1121*29619d2aSchristos case SUBLANG_URDU_PAKISTAN: return "ur_PK";
1122*29619d2aSchristos case SUBLANG_URDU_INDIA: return "ur_IN";
1123*29619d2aSchristos }
1124*29619d2aSchristos return "ur";
1125*29619d2aSchristos case LANG_UZBEK:
1126*29619d2aSchristos switch (sub)
1127*29619d2aSchristos {
1128*29619d2aSchristos case SUBLANG_UZBEK_LATIN: return "uz_UZ";
1129*29619d2aSchristos case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
1130*29619d2aSchristos }
1131*29619d2aSchristos return "uz";
1132*29619d2aSchristos case LANG_VENDA: return "ve_ZA";
1133*29619d2aSchristos case LANG_VIETNAMESE: return "vi_VN";
1134*29619d2aSchristos case LANG_WELSH: return "cy_GB";
1135*29619d2aSchristos case LANG_XHOSA: return "xh_ZA";
1136*29619d2aSchristos case LANG_YI: return "sit_CN";
1137*29619d2aSchristos case LANG_YIDDISH: return "yi_IL";
1138*29619d2aSchristos case LANG_YORUBA: return "yo_NG";
1139*29619d2aSchristos case LANG_ZULU: return "zu_ZA";
1140*29619d2aSchristos default: return "C";
1141*29619d2aSchristos }
1142*29619d2aSchristos
1143*29619d2aSchristos #endif
1144*29619d2aSchristos }
1145