| 1 | /* Determine the current selected locale.
|
|---|
| 2 | Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
|
|---|
| 3 |
|
|---|
| 4 | This program is free software; you can redistribute it and/or modify it
|
|---|
| 5 | under the terms of the GNU Library General Public License as published
|
|---|
| 6 | by the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 7 | any later version.
|
|---|
| 8 |
|
|---|
| 9 | This program is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|---|
| 12 | Library General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU Library General Public
|
|---|
| 15 | License along with this program; if not, write to the Free Software
|
|---|
| 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
|---|
| 17 | USA. */
|
|---|
| 18 |
|
|---|
| 19 | /* Written by Ulrich Drepper <drepper@gnu.org>, 1995. */
|
|---|
| 20 | /* Win32 code written by Tor Lillqvist <tml@iki.fi>. */
|
|---|
| 21 |
|
|---|
| 22 | #ifdef HAVE_CONFIG_H
|
|---|
| 23 | # include <config.h>
|
|---|
| 24 | #endif
|
|---|
| 25 |
|
|---|
| 26 | #include <stdlib.h>
|
|---|
| 27 | #include <locale.h>
|
|---|
| 28 |
|
|---|
| 29 | #if defined _WIN32 || defined __WIN32__
|
|---|
| 30 | # undef WIN32 /* avoid warning on mingw32 */
|
|---|
| 31 | # define WIN32
|
|---|
| 32 | #endif
|
|---|
| 33 |
|
|---|
| 34 | #ifdef WIN32
|
|---|
| 35 | # define WIN32_LEAN_AND_MEAN
|
|---|
| 36 | # include <windows.h>
|
|---|
| 37 | /* Mingw headers don't have latest language and sublanguage codes. */
|
|---|
| 38 | # ifndef LANG_AFRIKAANS
|
|---|
| 39 | # define LANG_AFRIKAANS 0x36
|
|---|
| 40 | # endif
|
|---|
| 41 | # ifndef LANG_ALBANIAN
|
|---|
| 42 | # define LANG_ALBANIAN 0x1c
|
|---|
| 43 | # endif
|
|---|
| 44 | # ifndef LANG_ARABIC
|
|---|
| 45 | # define LANG_ARABIC 0x01
|
|---|
| 46 | # endif
|
|---|
| 47 | # ifndef LANG_ARMENIAN
|
|---|
| 48 | # define LANG_ARMENIAN 0x2b
|
|---|
| 49 | # endif
|
|---|
| 50 | # ifndef LANG_ASSAMESE
|
|---|
| 51 | # define LANG_ASSAMESE 0x4d
|
|---|
| 52 | # endif
|
|---|
| 53 | # ifndef LANG_AZERI
|
|---|
| 54 | # define LANG_AZERI 0x2c
|
|---|
| 55 | # endif
|
|---|
| 56 | # ifndef LANG_BASQUE
|
|---|
| 57 | # define LANG_BASQUE 0x2d
|
|---|
| 58 | # endif
|
|---|
| 59 | # ifndef LANG_BELARUSIAN
|
|---|
| 60 | # define LANG_BELARUSIAN 0x23
|
|---|
| 61 | # endif
|
|---|
| 62 | # ifndef LANG_BENGALI
|
|---|
| 63 | # define LANG_BENGALI 0x45
|
|---|
| 64 | # endif
|
|---|
| 65 | # ifndef LANG_CATALAN
|
|---|
| 66 | # define LANG_CATALAN 0x03
|
|---|
| 67 | # endif
|
|---|
| 68 | # ifndef LANG_DIVEHI
|
|---|
| 69 | # define LANG_DIVEHI 0x65
|
|---|
| 70 | # endif
|
|---|
| 71 | # ifndef LANG_ESTONIAN
|
|---|
| 72 | # define LANG_ESTONIAN 0x25
|
|---|
| 73 | # endif
|
|---|
| 74 | # ifndef LANG_FAEROESE
|
|---|
| 75 | # define LANG_FAEROESE 0x38
|
|---|
| 76 | # endif
|
|---|
| 77 | # ifndef LANG_FARSI
|
|---|
| 78 | # define LANG_FARSI 0x29
|
|---|
| 79 | # endif
|
|---|
| 80 | # ifndef LANG_GALICIAN
|
|---|
| 81 | # define LANG_GALICIAN 0x56
|
|---|
| 82 | # endif
|
|---|
| 83 | # ifndef LANG_GEORGIAN
|
|---|
| 84 | # define LANG_GEORGIAN 0x37
|
|---|
| 85 | # endif
|
|---|
| 86 | # ifndef LANG_GUJARATI
|
|---|
| 87 | # define LANG_GUJARATI 0x47
|
|---|
| 88 | # endif
|
|---|
| 89 | # ifndef LANG_HEBREW
|
|---|
| 90 | # define LANG_HEBREW 0x0d
|
|---|
| 91 | # endif
|
|---|
| 92 | # ifndef LANG_HINDI
|
|---|
| 93 | # define LANG_HINDI 0x39
|
|---|
| 94 | # endif
|
|---|
| 95 | # ifndef LANG_INDONESIAN
|
|---|
| 96 | # define LANG_INDONESIAN 0x21
|
|---|
| 97 | # endif
|
|---|
| 98 | # ifndef LANG_KANNADA
|
|---|
| 99 | # define LANG_KANNADA 0x4b
|
|---|
| 100 | # endif
|
|---|
| 101 | # ifndef LANG_KASHMIRI
|
|---|
| 102 | # define LANG_KASHMIRI 0x60
|
|---|
| 103 | # endif
|
|---|
| 104 | # ifndef LANG_KAZAK
|
|---|
| 105 | # define LANG_KAZAK 0x3f
|
|---|
| 106 | # endif
|
|---|
| 107 | # ifndef LANG_KONKANI
|
|---|
| 108 | # define LANG_KONKANI 0x57
|
|---|
| 109 | # endif
|
|---|
| 110 | # ifndef LANG_KYRGYZ
|
|---|
| 111 | # define LANG_KYRGYZ 0x40
|
|---|
| 112 | # endif
|
|---|
| 113 | # ifndef LANG_LATVIAN
|
|---|
| 114 | # define LANG_LATVIAN 0x26
|
|---|
| 115 | # endif
|
|---|
| 116 | # ifndef LANG_LITHUANIAN
|
|---|
| 117 | # define LANG_LITHUANIAN 0x27
|
|---|
| 118 | # endif
|
|---|
| 119 | # ifndef LANG_MACEDONIAN
|
|---|
| 120 | # define LANG_MACEDONIAN 0x2f
|
|---|
| 121 | # endif
|
|---|
| 122 | # ifndef LANG_MALAY
|
|---|
| 123 | # define LANG_MALAY 0x3e
|
|---|
| 124 | # endif
|
|---|
| 125 | # ifndef LANG_MALAYALAM
|
|---|
| 126 | # define LANG_MALAYALAM 0x4c
|
|---|
| 127 | # endif
|
|---|
| 128 | # ifndef LANG_MANIPURI
|
|---|
| 129 | # define LANG_MANIPURI 0x58
|
|---|
| 130 | # endif
|
|---|
| 131 | # ifndef LANG_MARATHI
|
|---|
| 132 | # define LANG_MARATHI 0x4e
|
|---|
| 133 | # endif
|
|---|
| 134 | # ifndef LANG_MONGOLIAN
|
|---|
| 135 | # define LANG_MONGOLIAN 0x50
|
|---|
| 136 | # endif
|
|---|
| 137 | # ifndef LANG_NEPALI
|
|---|
| 138 | # define LANG_NEPALI 0x61
|
|---|
| 139 | # endif
|
|---|
| 140 | # ifndef LANG_ORIYA
|
|---|
| 141 | # define LANG_ORIYA 0x48
|
|---|
| 142 | # endif
|
|---|
| 143 | # ifndef LANG_PUNJABI
|
|---|
| 144 | # define LANG_PUNJABI 0x46
|
|---|
| 145 | # endif
|
|---|
| 146 | # ifndef LANG_SANSKRIT
|
|---|
| 147 | # define LANG_SANSKRIT 0x4f
|
|---|
| 148 | # endif
|
|---|
| 149 | # ifndef LANG_SERBIAN
|
|---|
| 150 | # define LANG_SERBIAN 0x1a
|
|---|
| 151 | # endif
|
|---|
| 152 | # ifndef LANG_SINDHI
|
|---|
| 153 | # define LANG_SINDHI 0x59
|
|---|
| 154 | # endif
|
|---|
| 155 | # ifndef LANG_SLOVAK
|
|---|
| 156 | # define LANG_SLOVAK 0x1b
|
|---|
| 157 | # endif
|
|---|
| 158 | # ifndef LANG_SORBIAN
|
|---|
| 159 | # define LANG_SORBIAN 0x2e
|
|---|
| 160 | # endif
|
|---|
| 161 | # ifndef LANG_SWAHILI
|
|---|
| 162 | # define LANG_SWAHILI 0x41
|
|---|
| 163 | # endif
|
|---|
| 164 | # ifndef LANG_SYRIAC
|
|---|
| 165 | # define LANG_SYRIAC 0x5a
|
|---|
| 166 | # endif
|
|---|
| 167 | # ifndef LANG_TAMIL
|
|---|
| 168 | # define LANG_TAMIL 0x49
|
|---|
| 169 | # endif
|
|---|
| 170 | # ifndef LANG_TATAR
|
|---|
| 171 | # define LANG_TATAR 0x44
|
|---|
| 172 | # endif
|
|---|
| 173 | # ifndef LANG_TELUGU
|
|---|
| 174 | # define LANG_TELUGU 0x4a
|
|---|
| 175 | # endif
|
|---|
| 176 | # ifndef LANG_THAI
|
|---|
| 177 | # define LANG_THAI 0x1e
|
|---|
| 178 | # endif
|
|---|
| 179 | # ifndef LANG_UKRAINIAN
|
|---|
| 180 | # define LANG_UKRAINIAN 0x22
|
|---|
| 181 | # endif
|
|---|
| 182 | # ifndef LANG_URDU
|
|---|
| 183 | # define LANG_URDU 0x20
|
|---|
| 184 | # endif
|
|---|
| 185 | # ifndef LANG_UZBEK
|
|---|
| 186 | # define LANG_UZBEK 0x43
|
|---|
| 187 | # endif
|
|---|
| 188 | # ifndef LANG_VIETNAMESE
|
|---|
| 189 | # define LANG_VIETNAMESE 0x2a
|
|---|
| 190 | # endif
|
|---|
| 191 | # ifndef SUBLANG_ARABIC_SAUDI_ARABIA
|
|---|
| 192 | # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
|
|---|
| 193 | # endif
|
|---|
| 194 | # ifndef SUBLANG_ARABIC_IRAQ
|
|---|
| 195 | # define SUBLANG_ARABIC_IRAQ 0x02
|
|---|
| 196 | # endif
|
|---|
| 197 | # ifndef SUBLANG_ARABIC_EGYPT
|
|---|
| 198 | # define SUBLANG_ARABIC_EGYPT 0x03
|
|---|
| 199 | # endif
|
|---|
| 200 | # ifndef SUBLANG_ARABIC_LIBYA
|
|---|
| 201 | # define SUBLANG_ARABIC_LIBYA 0x04
|
|---|
| 202 | # endif
|
|---|
| 203 | # ifndef SUBLANG_ARABIC_ALGERIA
|
|---|
| 204 | # define SUBLANG_ARABIC_ALGERIA 0x05
|
|---|
| 205 | # endif
|
|---|
| 206 | # ifndef SUBLANG_ARABIC_MOROCCO
|
|---|
| 207 | # define SUBLANG_ARABIC_MOROCCO 0x06
|
|---|
| 208 | # endif
|
|---|
| 209 | # ifndef SUBLANG_ARABIC_TUNISIA
|
|---|
| 210 | # define SUBLANG_ARABIC_TUNISIA 0x07
|
|---|
| 211 | # endif
|
|---|
| 212 | # ifndef SUBLANG_ARABIC_OMAN
|
|---|
| 213 | # define SUBLANG_ARABIC_OMAN 0x08
|
|---|
| 214 | # endif
|
|---|
| 215 | # ifndef SUBLANG_ARABIC_YEMEN
|
|---|
| 216 | # define SUBLANG_ARABIC_YEMEN 0x09
|
|---|
| 217 | # endif
|
|---|
| 218 | # ifndef SUBLANG_ARABIC_SYRIA
|
|---|
| 219 | # define SUBLANG_ARABIC_SYRIA 0x0a
|
|---|
| 220 | # endif
|
|---|
| 221 | # ifndef SUBLANG_ARABIC_JORDAN
|
|---|
| 222 | # define SUBLANG_ARABIC_JORDAN 0x0b
|
|---|
| 223 | # endif
|
|---|
| 224 | # ifndef SUBLANG_ARABIC_LEBANON
|
|---|
| 225 | # define SUBLANG_ARABIC_LEBANON 0x0c
|
|---|
| 226 | # endif
|
|---|
| 227 | # ifndef SUBLANG_ARABIC_KUWAIT
|
|---|
| 228 | # define SUBLANG_ARABIC_KUWAIT 0x0d
|
|---|
| 229 | # endif
|
|---|
| 230 | # ifndef SUBLANG_ARABIC_UAE
|
|---|
| 231 | # define SUBLANG_ARABIC_UAE 0x0e
|
|---|
| 232 | # endif
|
|---|
| 233 | # ifndef SUBLANG_ARABIC_BAHRAIN
|
|---|
| 234 | # define SUBLANG_ARABIC_BAHRAIN 0x0f
|
|---|
| 235 | # endif
|
|---|
| 236 | # ifndef SUBLANG_ARABIC_QATAR
|
|---|
| 237 | # define SUBLANG_ARABIC_QATAR 0x10
|
|---|
| 238 | # endif
|
|---|
| 239 | # ifndef SUBLANG_AZERI_LATIN
|
|---|
| 240 | # define SUBLANG_AZERI_LATIN 0x01
|
|---|
| 241 | # endif
|
|---|
| 242 | # ifndef SUBLANG_AZERI_CYRILLIC
|
|---|
| 243 | # define SUBLANG_AZERI_CYRILLIC 0x02
|
|---|
| 244 | # endif
|
|---|
| 245 | # ifndef SUBLANG_CHINESE_MACAU
|
|---|
| 246 | # define SUBLANG_CHINESE_MACAU 0x05
|
|---|
| 247 | # endif
|
|---|
| 248 | # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
|
|---|
| 249 | # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
|
|---|
| 250 | # endif
|
|---|
| 251 | # ifndef SUBLANG_ENGLISH_JAMAICA
|
|---|
| 252 | # define SUBLANG_ENGLISH_JAMAICA 0x08
|
|---|
| 253 | # endif
|
|---|
| 254 | # ifndef SUBLANG_ENGLISH_CARIBBEAN
|
|---|
| 255 | # define SUBLANG_ENGLISH_CARIBBEAN 0x09
|
|---|
| 256 | # endif
|
|---|
| 257 | # ifndef SUBLANG_ENGLISH_BELIZE
|
|---|
| 258 | # define SUBLANG_ENGLISH_BELIZE 0x0a
|
|---|
| 259 | # endif
|
|---|
| 260 | # ifndef SUBLANG_ENGLISH_TRINIDAD
|
|---|
| 261 | # define SUBLANG_ENGLISH_TRINIDAD 0x0b
|
|---|
| 262 | # endif
|
|---|
| 263 | # ifndef SUBLANG_ENGLISH_ZIMBABWE
|
|---|
| 264 | # define SUBLANG_ENGLISH_ZIMBABWE 0x0c
|
|---|
| 265 | # endif
|
|---|
| 266 | # ifndef SUBLANG_ENGLISH_PHILIPPINES
|
|---|
| 267 | # define SUBLANG_ENGLISH_PHILIPPINES 0x0d
|
|---|
| 268 | # endif
|
|---|
| 269 | # ifndef SUBLANG_FRENCH_LUXEMBOURG
|
|---|
| 270 | # define SUBLANG_FRENCH_LUXEMBOURG 0x05
|
|---|
| 271 | # endif
|
|---|
| 272 | # ifndef SUBLANG_FRENCH_MONACO
|
|---|
| 273 | # define SUBLANG_FRENCH_MONACO 0x06
|
|---|
| 274 | # endif
|
|---|
| 275 | # ifndef SUBLANG_GERMAN_LUXEMBOURG
|
|---|
| 276 | # define SUBLANG_GERMAN_LUXEMBOURG 0x04
|
|---|
| 277 | # endif
|
|---|
| 278 | # ifndef SUBLANG_GERMAN_LIECHTENSTEIN
|
|---|
| 279 | # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
|
|---|
| 280 | # endif
|
|---|
| 281 | # ifndef SUBLANG_KASHMIRI_INDIA
|
|---|
| 282 | # define SUBLANG_KASHMIRI_INDIA 0x02
|
|---|
| 283 | # endif
|
|---|
| 284 | # ifndef SUBLANG_MALAY_MALAYSIA
|
|---|
| 285 | # define SUBLANG_MALAY_MALAYSIA 0x01
|
|---|
| 286 | # endif
|
|---|
| 287 | # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
|
|---|
| 288 | # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
|
|---|
| 289 | # endif
|
|---|
| 290 | # ifndef SUBLANG_NEPALI_INDIA
|
|---|
| 291 | # define SUBLANG_NEPALI_INDIA 0x02
|
|---|
| 292 | # endif
|
|---|
| 293 | # ifndef SUBLANG_SERBIAN_LATIN
|
|---|
| 294 | # define SUBLANG_SERBIAN_LATIN 0x02
|
|---|
| 295 | # endif
|
|---|
| 296 | # ifndef SUBLANG_SERBIAN_CYRILLIC
|
|---|
| 297 | # define SUBLANG_SERBIAN_CYRILLIC 0x03
|
|---|
| 298 | # endif
|
|---|
| 299 | # ifndef SUBLANG_SPANISH_GUATEMALA
|
|---|
| 300 | # define SUBLANG_SPANISH_GUATEMALA 0x04
|
|---|
| 301 | # endif
|
|---|
| 302 | # ifndef SUBLANG_SPANISH_COSTA_RICA
|
|---|
| 303 | # define SUBLANG_SPANISH_COSTA_RICA 0x05
|
|---|
| 304 | # endif
|
|---|
| 305 | # ifndef SUBLANG_SPANISH_PANAMA
|
|---|
| 306 | # define SUBLANG_SPANISH_PANAMA 0x06
|
|---|
| 307 | # endif
|
|---|
| 308 | # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
|
|---|
| 309 | # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
|
|---|
| 310 | # endif
|
|---|
| 311 | # ifndef SUBLANG_SPANISH_VENEZUELA
|
|---|
| 312 | # define SUBLANG_SPANISH_VENEZUELA 0x08
|
|---|
| 313 | # endif
|
|---|
| 314 | # ifndef SUBLANG_SPANISH_COLOMBIA
|
|---|
| 315 | # define SUBLANG_SPANISH_COLOMBIA 0x09
|
|---|
| 316 | # endif
|
|---|
| 317 | # ifndef SUBLANG_SPANISH_PERU
|
|---|
| 318 | # define SUBLANG_SPANISH_PERU 0x0a
|
|---|
| 319 | # endif
|
|---|
| 320 | # ifndef SUBLANG_SPANISH_ARGENTINA
|
|---|
| 321 | # define SUBLANG_SPANISH_ARGENTINA 0x0b
|
|---|
| 322 | # endif
|
|---|
| 323 | # ifndef SUBLANG_SPANISH_ECUADOR
|
|---|
| 324 | # define SUBLANG_SPANISH_ECUADOR 0x0c
|
|---|
| 325 | # endif
|
|---|
| 326 | # ifndef SUBLANG_SPANISH_CHILE
|
|---|
| 327 | # define SUBLANG_SPANISH_CHILE 0x0d
|
|---|
| 328 | # endif
|
|---|
| 329 | # ifndef SUBLANG_SPANISH_URUGUAY
|
|---|
| 330 | # define SUBLANG_SPANISH_URUGUAY 0x0e
|
|---|
| 331 | # endif
|
|---|
| 332 | # ifndef SUBLANG_SPANISH_PARAGUAY
|
|---|
| 333 | # define SUBLANG_SPANISH_PARAGUAY 0x0f
|
|---|
| 334 | # endif
|
|---|
| 335 | # ifndef SUBLANG_SPANISH_BOLIVIA
|
|---|
| 336 | # define SUBLANG_SPANISH_BOLIVIA 0x10
|
|---|
| 337 | # endif
|
|---|
| 338 | # ifndef SUBLANG_SPANISH_EL_SALVADOR
|
|---|
| 339 | # define SUBLANG_SPANISH_EL_SALVADOR 0x11
|
|---|
| 340 | # endif
|
|---|
| 341 | # ifndef SUBLANG_SPANISH_HONDURAS
|
|---|
| 342 | # define SUBLANG_SPANISH_HONDURAS 0x12
|
|---|
| 343 | # endif
|
|---|
| 344 | # ifndef SUBLANG_SPANISH_NICARAGUA
|
|---|
| 345 | # define SUBLANG_SPANISH_NICARAGUA 0x13
|
|---|
| 346 | # endif
|
|---|
| 347 | # ifndef SUBLANG_SPANISH_PUERTO_RICO
|
|---|
| 348 | # define SUBLANG_SPANISH_PUERTO_RICO 0x14
|
|---|
| 349 | # endif
|
|---|
| 350 | # ifndef SUBLANG_SWEDISH_FINLAND
|
|---|
| 351 | # define SUBLANG_SWEDISH_FINLAND 0x02
|
|---|
| 352 | # endif
|
|---|
| 353 | # ifndef SUBLANG_URDU_PAKISTAN
|
|---|
| 354 | # define SUBLANG_URDU_PAKISTAN 0x01
|
|---|
| 355 | # endif
|
|---|
| 356 | # ifndef SUBLANG_URDU_INDIA
|
|---|
| 357 | # define SUBLANG_URDU_INDIA 0x02
|
|---|
| 358 | # endif
|
|---|
| 359 | # ifndef SUBLANG_UZBEK_LATIN
|
|---|
| 360 | # define SUBLANG_UZBEK_LATIN 0x01
|
|---|
| 361 | # endif
|
|---|
| 362 | # ifndef SUBLANG_UZBEK_CYRILLIC
|
|---|
| 363 | # define SUBLANG_UZBEK_CYRILLIC 0x02
|
|---|
| 364 | # endif
|
|---|
| 365 | #endif
|
|---|
| 366 |
|
|---|
| 367 | /* XPG3 defines the result of 'setlocale (category, NULL)' as:
|
|---|
| 368 | "Directs 'setlocale()' to query 'category' and return the current
|
|---|
| 369 | setting of 'local'."
|
|---|
| 370 | However it does not specify the exact format. Neither do SUSV2 and
|
|---|
| 371 | ISO C 99. So we can use this feature only on selected systems (e.g.
|
|---|
| 372 | those using GNU C Library). */
|
|---|
| 373 | #if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
|
|---|
| 374 | # define HAVE_LOCALE_NULL
|
|---|
| 375 | #endif
|
|---|
| 376 |
|
|---|
| 377 | /* Determine the current locale's name, and canonicalize it into XPG syntax
|
|---|
| 378 | language[_territory[.codeset]][@modifier]
|
|---|
| 379 | The codeset part in the result is not reliable; the locale_charset()
|
|---|
| 380 | should be used for codeset information instead.
|
|---|
| 381 | The result must not be freed; it is statically allocated. */
|
|---|
| 382 |
|
|---|
| 383 | const char *
|
|---|
| 384 | _nl_locale_name (int category, const char *categoryname)
|
|---|
| 385 | {
|
|---|
| 386 | const char *retval;
|
|---|
| 387 |
|
|---|
| 388 | #ifndef WIN32
|
|---|
| 389 |
|
|---|
| 390 | /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
|
|---|
| 391 | On some systems this can be done by the 'setlocale' function itself. */
|
|---|
| 392 | # if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
|
|---|
| 393 | retval = setlocale (category, NULL);
|
|---|
| 394 | # else
|
|---|
| 395 | /* Setting of LC_ALL overwrites all other. */
|
|---|
| 396 | retval = getenv ("LC_ALL");
|
|---|
| 397 | if (retval == NULL || retval[0] == '\0')
|
|---|
| 398 | {
|
|---|
| 399 | /* Next comes the name of the desired category. */
|
|---|
| 400 | retval = getenv (categoryname);
|
|---|
| 401 | if (retval == NULL || retval[0] == '\0')
|
|---|
| 402 | {
|
|---|
| 403 | /* Last possibility is the LANG environment variable. */
|
|---|
| 404 | retval = getenv ("LANG");
|
|---|
| 405 | if (retval == NULL || retval[0] == '\0')
|
|---|
| 406 | /* We use C as the default domain. POSIX says this is
|
|---|
| 407 | implementation defined. */
|
|---|
| 408 | retval = "C";
|
|---|
| 409 | }
|
|---|
| 410 | }
|
|---|
| 411 | # endif
|
|---|
| 412 |
|
|---|
| 413 | return retval;
|
|---|
| 414 |
|
|---|
| 415 | #else /* WIN32 */
|
|---|
| 416 |
|
|---|
| 417 | /* Return an XPG style locale name language[_territory][@modifier].
|
|---|
| 418 | Don't even bother determining the codeset; it's not useful in this
|
|---|
| 419 | context, because message catalogs are not specific to a single
|
|---|
| 420 | codeset. */
|
|---|
| 421 |
|
|---|
| 422 | LCID lcid;
|
|---|
| 423 | LANGID langid;
|
|---|
| 424 | int primary, sub;
|
|---|
| 425 |
|
|---|
| 426 | /* Let the user override the system settings through environment
|
|---|
| 427 | variables, as on POSIX systems. */
|
|---|
| 428 | retval = getenv ("LC_ALL");
|
|---|
| 429 | if (retval != NULL && retval[0] != '\0')
|
|---|
| 430 | return retval;
|
|---|
| 431 | retval = getenv (categoryname);
|
|---|
| 432 | if (retval != NULL && retval[0] != '\0')
|
|---|
| 433 | return retval;
|
|---|
| 434 | retval = getenv ("LANG");
|
|---|
| 435 | if (retval != NULL && retval[0] != '\0')
|
|---|
| 436 | return retval;
|
|---|
| 437 |
|
|---|
| 438 | /* Use native Win32 API locale ID. */
|
|---|
| 439 | lcid = GetThreadLocale ();
|
|---|
| 440 |
|
|---|
| 441 | /* Strip off the sorting rules, keep only the language part. */
|
|---|
| 442 | langid = LANGIDFROMLCID (lcid);
|
|---|
| 443 |
|
|---|
| 444 | /* Split into language and territory part. */
|
|---|
| 445 | primary = PRIMARYLANGID (langid);
|
|---|
| 446 | sub = SUBLANGID (langid);
|
|---|
| 447 |
|
|---|
| 448 | /* Dispatch on language.
|
|---|
| 449 | See also http://www.unicode.org/unicode/onlinedat/languages.html .
|
|---|
| 450 | For details about languages, see http://www.ethnologue.com/ . */
|
|---|
| 451 | switch (primary)
|
|---|
| 452 | {
|
|---|
| 453 | case LANG_AFRIKAANS: return "af_ZA";
|
|---|
| 454 | case LANG_ALBANIAN: return "sq_AL";
|
|---|
| 455 | case 0x5e: /* AMHARIC */ return "am_ET";
|
|---|
| 456 | case LANG_ARABIC:
|
|---|
| 457 | switch (sub)
|
|---|
| 458 | {
|
|---|
| 459 | case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
|
|---|
| 460 | case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
|
|---|
| 461 | case SUBLANG_ARABIC_EGYPT: return "ar_EG";
|
|---|
| 462 | case SUBLANG_ARABIC_LIBYA: return "ar_LY";
|
|---|
| 463 | case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
|
|---|
| 464 | case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
|
|---|
| 465 | case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
|
|---|
| 466 | case SUBLANG_ARABIC_OMAN: return "ar_OM";
|
|---|
| 467 | case SUBLANG_ARABIC_YEMEN: return "ar_YE";
|
|---|
| 468 | case SUBLANG_ARABIC_SYRIA: return "ar_SY";
|
|---|
| 469 | case SUBLANG_ARABIC_JORDAN: return "ar_JO";
|
|---|
| 470 | case SUBLANG_ARABIC_LEBANON: return "ar_LB";
|
|---|
| 471 | case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
|
|---|
| 472 | case SUBLANG_ARABIC_UAE: return "ar_AE";
|
|---|
| 473 | case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
|
|---|
| 474 | case SUBLANG_ARABIC_QATAR: return "ar_QA";
|
|---|
| 475 | }
|
|---|
| 476 | return "ar";
|
|---|
| 477 | case LANG_ARMENIAN: return "hy_AM";
|
|---|
| 478 | case LANG_ASSAMESE: return "as_IN";
|
|---|
| 479 | case LANG_AZERI:
|
|---|
| 480 | switch (sub)
|
|---|
| 481 | {
|
|---|
| 482 | /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */
|
|---|
| 483 | case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
|
|---|
| 484 | case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
|
|---|
| 485 | }
|
|---|
| 486 | return "az";
|
|---|
| 487 | case LANG_BASQUE:
|
|---|
| 488 | return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */
|
|---|
| 489 | case LANG_BELARUSIAN: return "be_BY";
|
|---|
| 490 | case LANG_BENGALI: return "bn_IN";
|
|---|
| 491 | case LANG_BULGARIAN: return "bg_BG";
|
|---|
| 492 | case 0x55: /* BURMESE */ return "my_MM";
|
|---|
| 493 | case 0x53: /* CAMBODIAN */ return "km_KH";
|
|---|
| 494 | case LANG_CATALAN: return "ca_ES";
|
|---|
| 495 | case 0x5c: /* CHEROKEE */ return "chr_US";
|
|---|
| 496 | case LANG_CHINESE:
|
|---|
| 497 | switch (sub)
|
|---|
| 498 | {
|
|---|
| 499 | case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
|
|---|
| 500 | case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
|
|---|
| 501 | case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
|
|---|
| 502 | case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
|
|---|
| 503 | case SUBLANG_CHINESE_MACAU: return "zh_MO";
|
|---|
| 504 | }
|
|---|
| 505 | return "zh";
|
|---|
| 506 | case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN
|
|---|
| 507 | * What used to be called Serbo-Croatian
|
|---|
| 508 | * should really now be two separate
|
|---|
| 509 | * languages because of political reasons.
|
|---|
| 510 | * (Says tml, who knows nothing about Serbian
|
|---|
| 511 | * or Croatian.)
|
|---|
| 512 | * (I can feel those flames coming already.)
|
|---|
| 513 | */
|
|---|
| 514 | switch (sub)
|
|---|
| 515 | {
|
|---|
| 516 | case SUBLANG_DEFAULT: return "hr_HR";
|
|---|
| 517 | case SUBLANG_SERBIAN_LATIN: return "sr_YU";
|
|---|
| 518 | case SUBLANG_SERBIAN_CYRILLIC: return "sr_YU@cyrillic";
|
|---|
| 519 | }
|
|---|
| 520 | return "hr";
|
|---|
| 521 | case LANG_CZECH: return "cs_CZ";
|
|---|
| 522 | case LANG_DANISH: return "da_DK";
|
|---|
| 523 | case LANG_DIVEHI: return "div_MV";
|
|---|
| 524 | case LANG_DUTCH:
|
|---|
| 525 | switch (sub)
|
|---|
| 526 | {
|
|---|
| 527 | case SUBLANG_DUTCH: return "nl_NL";
|
|---|
| 528 | case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
|
|---|
| 529 | }
|
|---|
| 530 | return "nl";
|
|---|
| 531 | case 0x66: /* EDO */ return "bin_NG";
|
|---|
| 532 | case LANG_ENGLISH:
|
|---|
| 533 | switch (sub)
|
|---|
| 534 | {
|
|---|
| 535 | /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
|
|---|
| 536 | * English was the language spoken in England.
|
|---|
| 537 | * Oh well.
|
|---|
| 538 | */
|
|---|
| 539 | case SUBLANG_ENGLISH_US: return "en_US";
|
|---|
| 540 | case SUBLANG_ENGLISH_UK: return "en_GB";
|
|---|
| 541 | case SUBLANG_ENGLISH_AUS: return "en_AU";
|
|---|
| 542 | case SUBLANG_ENGLISH_CAN: return "en_CA";
|
|---|
| 543 | case SUBLANG_ENGLISH_NZ: return "en_NZ";
|
|---|
| 544 | case SUBLANG_ENGLISH_EIRE: return "en_IE";
|
|---|
| 545 | case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
|
|---|
| 546 | case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
|
|---|
| 547 | case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
|
|---|
| 548 | case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
|
|---|
| 549 | case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
|
|---|
| 550 | case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
|
|---|
| 551 | case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
|
|---|
| 552 | }
|
|---|
| 553 | return "en";
|
|---|
| 554 | case LANG_ESTONIAN: return "et_EE";
|
|---|
| 555 | case LANG_FAEROESE: return "fo_FO";
|
|---|
| 556 | case LANG_FARSI: return "fa_IR";
|
|---|
| 557 | case LANG_FINNISH: return "fi_FI";
|
|---|
| 558 | case LANG_FRENCH:
|
|---|
| 559 | switch (sub)
|
|---|
| 560 | {
|
|---|
| 561 | case SUBLANG_FRENCH: return "fr_FR";
|
|---|
| 562 | case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
|
|---|
| 563 | case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
|
|---|
| 564 | case SUBLANG_FRENCH_SWISS: return "fr_CH";
|
|---|
| 565 | case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
|
|---|
| 566 | case SUBLANG_FRENCH_MONACO: return "fr_MC";
|
|---|
| 567 | }
|
|---|
| 568 | return "fr";
|
|---|
| 569 | case 0x62: /* FRISIAN */ return "fy_NL";
|
|---|
| 570 | case 0x67: /* FULFULDE */ return "ful_NG";
|
|---|
| 571 | case 0x3c: /* GAELIC */
|
|---|
| 572 | switch (sub)
|
|---|
| 573 | {
|
|---|
| 574 | case 0x01: /* SCOTTISH */ return "gd_GB";
|
|---|
| 575 | case 0x02: /* IRISH */ return "ga_IE";
|
|---|
| 576 | }
|
|---|
| 577 | return "C";
|
|---|
| 578 | case LANG_GALICIAN: return "gl_ES";
|
|---|
| 579 | case LANG_GEORGIAN: return "ka_GE";
|
|---|
| 580 | case LANG_GERMAN:
|
|---|
| 581 | switch (sub)
|
|---|
| 582 | {
|
|---|
| 583 | case SUBLANG_GERMAN: return "de_DE";
|
|---|
| 584 | case SUBLANG_GERMAN_SWISS: return "de_CH";
|
|---|
| 585 | case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
|
|---|
| 586 | case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
|
|---|
| 587 | case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
|
|---|
| 588 | }
|
|---|
| 589 | return "de";
|
|---|
| 590 | case LANG_GREEK: return "el_GR";
|
|---|
| 591 | case 0x74: /* GUARANI */ return "gn_PY";
|
|---|
| 592 | case LANG_GUJARATI: return "gu_IN";
|
|---|
| 593 | case 0x68: /* HAUSA */ return "ha_NG";
|
|---|
| 594 | case 0x75: /* HAWAIIAN */
|
|---|
| 595 | /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
|
|---|
| 596 | or Hawaii Creole English ("cpe_US", 600000 speakers)? */
|
|---|
| 597 | return "cpe_US";
|
|---|
| 598 | case LANG_HEBREW: return "he_IL";
|
|---|
| 599 | case LANG_HINDI: return "hi_IN";
|
|---|
| 600 | case LANG_HUNGARIAN: return "hu_HU";
|
|---|
| 601 | case 0x69: /* IBIBIO */ return "nic_NG";
|
|---|
| 602 | case LANG_ICELANDIC: return "is_IS";
|
|---|
| 603 | case 0x70: /* IGBO */ return "ibo_NG";
|
|---|
| 604 | case LANG_INDONESIAN: return "id_ID";
|
|---|
| 605 | case 0x5d: /* INUKTITUT */ return "iu_CA";
|
|---|
| 606 | case LANG_ITALIAN:
|
|---|
| 607 | switch (sub)
|
|---|
| 608 | {
|
|---|
| 609 | case SUBLANG_ITALIAN: return "it_IT";
|
|---|
| 610 | case SUBLANG_ITALIAN_SWISS: return "it_CH";
|
|---|
| 611 | }
|
|---|
| 612 | return "it";
|
|---|
| 613 | case LANG_JAPANESE: return "ja_JP";
|
|---|
| 614 | case LANG_KANNADA: return "kn_IN";
|
|---|
| 615 | case 0x71: /* KANURI */ return "kau_NG";
|
|---|
| 616 | case LANG_KASHMIRI:
|
|---|
| 617 | switch (sub)
|
|---|
| 618 | {
|
|---|
| 619 | case SUBLANG_DEFAULT: return "ks_PK";
|
|---|
| 620 | case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
|
|---|
| 621 | }
|
|---|
| 622 | return "ks";
|
|---|
| 623 | case LANG_KAZAK: return "kk_KZ";
|
|---|
| 624 | case LANG_KONKANI:
|
|---|
| 625 | /* FIXME: Adjust this when such locales appear on Unix. */
|
|---|
| 626 | return "kok_IN";
|
|---|
| 627 | case LANG_KOREAN: return "ko_KR";
|
|---|
| 628 | case LANG_KYRGYZ: return "ky_KG";
|
|---|
| 629 | case 0x54: /* LAO */ return "lo_LA";
|
|---|
| 630 | case 0x76: /* LATIN */ return "la_VA";
|
|---|
| 631 | case LANG_LATVIAN: return "lv_LV";
|
|---|
| 632 | case LANG_LITHUANIAN: return "lt_LT";
|
|---|
| 633 | case LANG_MACEDONIAN: return "mk_MK";
|
|---|
| 634 | case LANG_MALAY:
|
|---|
| 635 | switch (sub)
|
|---|
| 636 | {
|
|---|
| 637 | case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
|
|---|
| 638 | case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
|
|---|
| 639 | }
|
|---|
| 640 | return "ms";
|
|---|
| 641 | case LANG_MALAYALAM: return "ml_IN";
|
|---|
| 642 | case 0x3a: /* MALTESE */ return "mt_MT";
|
|---|
| 643 | case LANG_MANIPURI:
|
|---|
| 644 | /* FIXME: Adjust this when such locales appear on Unix. */
|
|---|
| 645 | return "mni_IN";
|
|---|
| 646 | case LANG_MARATHI: return "mr_IN";
|
|---|
| 647 | case LANG_MONGOLIAN:
|
|---|
| 648 | return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */
|
|---|
| 649 | case LANG_NEPALI:
|
|---|
| 650 | switch (sub)
|
|---|
| 651 | {
|
|---|
| 652 | case SUBLANG_DEFAULT: return "ne_NP";
|
|---|
| 653 | case SUBLANG_NEPALI_INDIA: return "ne_IN";
|
|---|
| 654 | }
|
|---|
| 655 | return "ne";
|
|---|
| 656 | case LANG_NORWEGIAN:
|
|---|
| 657 | switch (sub)
|
|---|
| 658 | {
|
|---|
| 659 | case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
|
|---|
| 660 | case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
|
|---|
| 661 | }
|
|---|
| 662 | return "no";
|
|---|
| 663 | case LANG_ORIYA: return "or_IN";
|
|---|
| 664 | case 0x72: /* OROMO */ return "om_ET";
|
|---|
| 665 | case 0x79: /* PAPIAMENTU */ return "pap_AN";
|
|---|
| 666 | case 0x63: /* PASHTO */
|
|---|
| 667 | return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */
|
|---|
| 668 | case LANG_POLISH: return "pl_PL";
|
|---|
| 669 | case LANG_PORTUGUESE:
|
|---|
| 670 | switch (sub)
|
|---|
| 671 | {
|
|---|
| 672 | case SUBLANG_PORTUGUESE: return "pt_PT";
|
|---|
| 673 | /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
|
|---|
| 674 | Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
|
|---|
| 675 | case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
|
|---|
| 676 | }
|
|---|
| 677 | return "pt";
|
|---|
| 678 | case LANG_PUNJABI: return "pa_IN";
|
|---|
| 679 | case 0x17: /* RHAETO-ROMANCE */ return "rm_CH";
|
|---|
| 680 | case LANG_ROMANIAN: return "ro_RO";
|
|---|
| 681 | case LANG_RUSSIAN:
|
|---|
| 682 | return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA". */
|
|---|
| 683 | case 0x3b: /* SAMI */ return "se_NO";
|
|---|
| 684 | case LANG_SANSKRIT: return "sa_IN";
|
|---|
| 685 | case LANG_SINDHI: return "sd";
|
|---|
| 686 | case 0x5b: /* SINHALESE */ return "si_LK";
|
|---|
| 687 | case LANG_SLOVAK: return "sk_SK";
|
|---|
| 688 | case LANG_SLOVENIAN: return "sl_SI";
|
|---|
| 689 | case 0x77: /* SOMALI */ return "so_SO";
|
|---|
| 690 | case LANG_SORBIAN:
|
|---|
| 691 | /* FIXME: Adjust this when such locales appear on Unix. */
|
|---|
| 692 | return "wen_DE";
|
|---|
| 693 | case LANG_SPANISH:
|
|---|
| 694 | switch (sub)
|
|---|
| 695 | {
|
|---|
| 696 | case SUBLANG_SPANISH: return "es_ES";
|
|---|
| 697 | case SUBLANG_SPANISH_MEXICAN: return "es_MX";
|
|---|
| 698 | case SUBLANG_SPANISH_MODERN:
|
|---|
| 699 | return "es_ES@modern"; /* not seen on Unix */
|
|---|
| 700 | case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
|
|---|
| 701 | case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
|
|---|
| 702 | case SUBLANG_SPANISH_PANAMA: return "es_PA";
|
|---|
| 703 | case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
|
|---|
| 704 | case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
|
|---|
| 705 | case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
|
|---|
| 706 | case SUBLANG_SPANISH_PERU: return "es_PE";
|
|---|
| 707 | case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
|
|---|
| 708 | case SUBLANG_SPANISH_ECUADOR: return "es_EC";
|
|---|
| 709 | case SUBLANG_SPANISH_CHILE: return "es_CL";
|
|---|
| 710 | case SUBLANG_SPANISH_URUGUAY: return "es_UY";
|
|---|
| 711 | case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
|
|---|
| 712 | case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
|
|---|
| 713 | case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
|
|---|
| 714 | case SUBLANG_SPANISH_HONDURAS: return "es_HN";
|
|---|
| 715 | case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
|
|---|
| 716 | case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
|
|---|
| 717 | }
|
|---|
| 718 | return "es";
|
|---|
| 719 | case 0x30: /* SUTU */ return "bnt_TZ";
|
|---|
| 720 | case LANG_SWAHILI: return "sw_KE";
|
|---|
| 721 | case LANG_SWEDISH:
|
|---|
| 722 | switch (sub)
|
|---|
| 723 | {
|
|---|
| 724 | case SUBLANG_DEFAULT: return "sv_SE";
|
|---|
| 725 | case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
|
|---|
| 726 | }
|
|---|
| 727 | return "sv";
|
|---|
| 728 | case LANG_SYRIAC: return "syr_TR"; /* An extinct language. */
|
|---|
| 729 | case 0x64: /* TAGALOG */ return "tl_PH";
|
|---|
| 730 | case 0x28: /* TAJIK */ return "tg_TJ";
|
|---|
| 731 | case 0x5f: /* TAMAZIGHT */ return "ber_MA";
|
|---|
| 732 | case LANG_TAMIL:
|
|---|
| 733 | return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */
|
|---|
| 734 | case LANG_TATAR: return "tt_RU";
|
|---|
| 735 | case LANG_TELUGU: return "te_IN";
|
|---|
| 736 | case LANG_THAI: return "th_TH";
|
|---|
| 737 | case 0x51: /* TIBETAN */ return "bo_CN";
|
|---|
| 738 | case 0x73: /* TIGRINYA */ return "ti_ET";
|
|---|
| 739 | case 0x31: /* TSONGA */ return "ts_ZA";
|
|---|
| 740 | case LANG_TURKISH: return "tr_TR";
|
|---|
| 741 | case 0x42: /* TURKMEN */ return "tk_TM";
|
|---|
| 742 | case LANG_UKRAINIAN: return "uk_UA";
|
|---|
| 743 | case LANG_URDU:
|
|---|
| 744 | switch (sub)
|
|---|
| 745 | {
|
|---|
| 746 | case SUBLANG_URDU_PAKISTAN: return "ur_PK";
|
|---|
| 747 | case SUBLANG_URDU_INDIA: return "ur_IN";
|
|---|
| 748 | }
|
|---|
| 749 | return "ur";
|
|---|
| 750 | case LANG_UZBEK:
|
|---|
| 751 | switch (sub)
|
|---|
| 752 | {
|
|---|
| 753 | /* FIXME: Adjust this when Uzbek locales appear on Unix. */
|
|---|
| 754 | case SUBLANG_UZBEK_LATIN: return "uz_UZ@latin";
|
|---|
| 755 | case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
|
|---|
| 756 | }
|
|---|
| 757 | return "uz";
|
|---|
| 758 | case 0x33: /* VENDA */ return "ven_ZA";
|
|---|
| 759 | case LANG_VIETNAMESE: return "vi_VN";
|
|---|
| 760 | case 0x52: /* WELSH */ return "cy_GB";
|
|---|
| 761 | case 0x34: /* XHOSA */ return "xh_ZA";
|
|---|
| 762 | case 0x78: /* YI */ return "sit_CN";
|
|---|
| 763 | case 0x3d: /* YIDDISH */ return "yi_IL";
|
|---|
| 764 | case 0x6a: /* YORUBA */ return "yo_NG";
|
|---|
| 765 | case 0x35: /* ZULU */ return "zu_ZA";
|
|---|
| 766 | default: return "C";
|
|---|
| 767 | }
|
|---|
| 768 |
|
|---|
| 769 | #endif
|
|---|
| 770 | }
|
|---|