Blame intl/localename.c

Packit Service a721b1
/* Determine name of the currently selected locale.
Packit Service a721b1
   Copyright (C) 1995-1999, 2000-2007 Free Software Foundation, Inc.
Packit Service a721b1
Packit Service a721b1
   This program is free software; you can redistribute it and/or modify it
Packit Service a721b1
   under the terms of the GNU Library General Public License as published
Packit Service a721b1
   by the Free Software Foundation; either version 2, or (at your option)
Packit Service a721b1
   any later version.
Packit Service a721b1
Packit Service a721b1
   This program is distributed in the hope that it will be useful,
Packit Service a721b1
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a721b1
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service a721b1
   Library General Public License for more details.
Packit Service a721b1
Packit Service a721b1
   You should have received a copy of the GNU Library General Public
Packit Service a721b1
   License along with this program; if not, write to the Free Software
Packit Service a721b1
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
Packit Service a721b1
   USA.  */
Packit Service a721b1
Packit Service a721b1
/* Written by Ulrich Drepper <drepper@gnu.org>, 1995.  */
Packit Service a721b1
/* Win32 code written by Tor Lillqvist <tml@iki.fi>.  */
Packit Service a721b1
/* MacOS X code written by Bruno Haible <bruno@clisp.org>.  */
Packit Service a721b1
Packit Service a721b1
#include <config.h>
Packit Service a721b1
Packit Service a721b1
/* Specification.  */
Packit Service a721b1
#ifdef IN_LIBINTL
Packit Service a721b1
# include "gettextP.h"
Packit Service a721b1
#else
Packit Service a721b1
# include "localename.h"
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
#include <stdlib.h>
Packit Service a721b1
#include <locale.h>
Packit Service a721b1
Packit Service a721b1
#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
Packit Service a721b1
# include <string.h>
Packit Service a721b1
# include <CoreFoundation/CFString.h>
Packit Service a721b1
# if HAVE_CFLOCALECOPYCURRENT
Packit Service a721b1
#  include <CoreFoundation/CFLocale.h>
Packit Service a721b1
# elif HAVE_CFPREFERENCESCOPYAPPVALUE
Packit Service a721b1
#  include <CoreFoundation/CFPreferences.h>
Packit Service a721b1
# endif
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
#if defined _WIN32 || defined __WIN32__
Packit Service a721b1
# define WIN32_NATIVE
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
#ifdef WIN32_NATIVE
Packit Service a721b1
# define WIN32_LEAN_AND_MEAN
Packit Service a721b1
# include <windows.h>
Packit Service a721b1
/* List of language codes, sorted by value:
Packit Service a721b1
   0x01 LANG_ARABIC
Packit Service a721b1
   0x02 LANG_BULGARIAN
Packit Service a721b1
   0x03 LANG_CATALAN
Packit Service a721b1
   0x04 LANG_CHINESE
Packit Service a721b1
   0x05 LANG_CZECH
Packit Service a721b1
   0x06 LANG_DANISH
Packit Service a721b1
   0x07 LANG_GERMAN
Packit Service a721b1
   0x08 LANG_GREEK
Packit Service a721b1
   0x09 LANG_ENGLISH
Packit Service a721b1
   0x0a LANG_SPANISH
Packit Service a721b1
   0x0b LANG_FINNISH
Packit Service a721b1
   0x0c LANG_FRENCH
Packit Service a721b1
   0x0d LANG_HEBREW
Packit Service a721b1
   0x0e LANG_HUNGARIAN
Packit Service a721b1
   0x0f LANG_ICELANDIC
Packit Service a721b1
   0x10 LANG_ITALIAN
Packit Service a721b1
   0x11 LANG_JAPANESE
Packit Service a721b1
   0x12 LANG_KOREAN
Packit Service a721b1
   0x13 LANG_DUTCH
Packit Service a721b1
   0x14 LANG_NORWEGIAN
Packit Service a721b1
   0x15 LANG_POLISH
Packit Service a721b1
   0x16 LANG_PORTUGUESE
Packit Service a721b1
   0x17 LANG_RHAETO_ROMANCE
Packit Service a721b1
   0x18 LANG_ROMANIAN
Packit Service a721b1
   0x19 LANG_RUSSIAN
Packit Service a721b1
   0x1a LANG_CROATIAN == LANG_SERBIAN
Packit Service a721b1
   0x1b LANG_SLOVAK
Packit Service a721b1
   0x1c LANG_ALBANIAN
Packit Service a721b1
   0x1d LANG_SWEDISH
Packit Service a721b1
   0x1e LANG_THAI
Packit Service a721b1
   0x1f LANG_TURKISH
Packit Service a721b1
   0x20 LANG_URDU
Packit Service a721b1
   0x21 LANG_INDONESIAN
Packit Service a721b1
   0x22 LANG_UKRAINIAN
Packit Service a721b1
   0x23 LANG_BELARUSIAN
Packit Service a721b1
   0x24 LANG_SLOVENIAN
Packit Service a721b1
   0x25 LANG_ESTONIAN
Packit Service a721b1
   0x26 LANG_LATVIAN
Packit Service a721b1
   0x27 LANG_LITHUANIAN
Packit Service a721b1
   0x28 LANG_TAJIK
Packit Service a721b1
   0x29 LANG_FARSI
Packit Service a721b1
   0x2a LANG_VIETNAMESE
Packit Service a721b1
   0x2b LANG_ARMENIAN
Packit Service a721b1
   0x2c LANG_AZERI
Packit Service a721b1
   0x2d LANG_BASQUE
Packit Service a721b1
   0x2e LANG_SORBIAN
Packit Service a721b1
   0x2f LANG_MACEDONIAN
Packit Service a721b1
   0x30 LANG_SUTU
Packit Service a721b1
   0x31 LANG_TSONGA
Packit Service a721b1
   0x32 LANG_TSWANA
Packit Service a721b1
   0x33 LANG_VENDA
Packit Service a721b1
   0x34 LANG_XHOSA
Packit Service a721b1
   0x35 LANG_ZULU
Packit Service a721b1
   0x36 LANG_AFRIKAANS
Packit Service a721b1
   0x37 LANG_GEORGIAN
Packit Service a721b1
   0x38 LANG_FAEROESE
Packit Service a721b1
   0x39 LANG_HINDI
Packit Service a721b1
   0x3a LANG_MALTESE
Packit Service a721b1
   0x3b LANG_SAAMI
Packit Service a721b1
   0x3c LANG_GAELIC
Packit Service a721b1
   0x3d LANG_YIDDISH
Packit Service a721b1
   0x3e LANG_MALAY
Packit Service a721b1
   0x3f LANG_KAZAK
Packit Service a721b1
   0x40 LANG_KYRGYZ
Packit Service a721b1
   0x41 LANG_SWAHILI
Packit Service a721b1
   0x42 LANG_TURKMEN
Packit Service a721b1
   0x43 LANG_UZBEK
Packit Service a721b1
   0x44 LANG_TATAR
Packit Service a721b1
   0x45 LANG_BENGALI
Packit Service a721b1
   0x46 LANG_PUNJABI
Packit Service a721b1
   0x47 LANG_GUJARATI
Packit Service a721b1
   0x48 LANG_ORIYA
Packit Service a721b1
   0x49 LANG_TAMIL
Packit Service a721b1
   0x4a LANG_TELUGU
Packit Service a721b1
   0x4b LANG_KANNADA
Packit Service a721b1
   0x4c LANG_MALAYALAM
Packit Service a721b1
   0x4d LANG_ASSAMESE
Packit Service a721b1
   0x4e LANG_MARATHI
Packit Service a721b1
   0x4f LANG_SANSKRIT
Packit Service a721b1
   0x50 LANG_MONGOLIAN
Packit Service a721b1
   0x51 LANG_TIBETAN
Packit Service a721b1
   0x52 LANG_WELSH
Packit Service a721b1
   0x53 LANG_CAMBODIAN
Packit Service a721b1
   0x54 LANG_LAO
Packit Service a721b1
   0x55 LANG_BURMESE
Packit Service a721b1
   0x56 LANG_GALICIAN
Packit Service a721b1
   0x57 LANG_KONKANI
Packit Service a721b1
   0x58 LANG_MANIPURI
Packit Service a721b1
   0x59 LANG_SINDHI
Packit Service a721b1
   0x5a LANG_SYRIAC
Packit Service a721b1
   0x5b LANG_SINHALESE
Packit Service a721b1
   0x5c LANG_CHEROKEE
Packit Service a721b1
   0x5d LANG_INUKTITUT
Packit Service a721b1
   0x5e LANG_AMHARIC
Packit Service a721b1
   0x5f LANG_TAMAZIGHT
Packit Service a721b1
   0x60 LANG_KASHMIRI
Packit Service a721b1
   0x61 LANG_NEPALI
Packit Service a721b1
   0x62 LANG_FRISIAN
Packit Service a721b1
   0x63 LANG_PASHTO
Packit Service a721b1
   0x64 LANG_TAGALOG
Packit Service a721b1
   0x65 LANG_DIVEHI
Packit Service a721b1
   0x66 LANG_EDO
Packit Service a721b1
   0x67 LANG_FULFULDE
Packit Service a721b1
   0x68 LANG_HAUSA
Packit Service a721b1
   0x69 LANG_IBIBIO
Packit Service a721b1
   0x6a LANG_YORUBA
Packit Service a721b1
   0x70 LANG_IGBO
Packit Service a721b1
   0x71 LANG_KANURI
Packit Service a721b1
   0x72 LANG_OROMO
Packit Service a721b1
   0x73 LANG_TIGRINYA
Packit Service a721b1
   0x74 LANG_GUARANI
Packit Service a721b1
   0x75 LANG_HAWAIIAN
Packit Service a721b1
   0x76 LANG_LATIN
Packit Service a721b1
   0x77 LANG_SOMALI
Packit Service a721b1
   0x78 LANG_YI
Packit Service a721b1
   0x79 LANG_PAPIAMENTU
Packit Service a721b1
*/
Packit Service a721b1
/* Mingw headers don't have latest language and sublanguage codes.  */
Packit Service a721b1
# ifndef LANG_AFRIKAANS
Packit Service a721b1
# define LANG_AFRIKAANS 0x36
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ALBANIAN
Packit Service a721b1
# define LANG_ALBANIAN 0x1c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_AMHARIC
Packit Service a721b1
# define LANG_AMHARIC 0x5e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ARABIC
Packit Service a721b1
# define LANG_ARABIC 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ARMENIAN
Packit Service a721b1
# define LANG_ARMENIAN 0x2b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ASSAMESE
Packit Service a721b1
# define LANG_ASSAMESE 0x4d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_AZERI
Packit Service a721b1
# define LANG_AZERI 0x2c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_BASQUE
Packit Service a721b1
# define LANG_BASQUE 0x2d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_BELARUSIAN
Packit Service a721b1
# define LANG_BELARUSIAN 0x23
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_BENGALI
Packit Service a721b1
# define LANG_BENGALI 0x45
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_BURMESE
Packit Service a721b1
# define LANG_BURMESE 0x55
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_CAMBODIAN
Packit Service a721b1
# define LANG_CAMBODIAN 0x53
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_CATALAN
Packit Service a721b1
# define LANG_CATALAN 0x03
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_CHEROKEE
Packit Service a721b1
# define LANG_CHEROKEE 0x5c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_DIVEHI
Packit Service a721b1
# define LANG_DIVEHI 0x65
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_EDO
Packit Service a721b1
# define LANG_EDO 0x66
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ESTONIAN
Packit Service a721b1
# define LANG_ESTONIAN 0x25
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_FAEROESE
Packit Service a721b1
# define LANG_FAEROESE 0x38
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_FARSI
Packit Service a721b1
# define LANG_FARSI 0x29
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_FRISIAN
Packit Service a721b1
# define LANG_FRISIAN 0x62
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_FULFULDE
Packit Service a721b1
# define LANG_FULFULDE 0x67
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_GAELIC
Packit Service a721b1
# define LANG_GAELIC 0x3c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_GALICIAN
Packit Service a721b1
# define LANG_GALICIAN 0x56
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_GEORGIAN
Packit Service a721b1
# define LANG_GEORGIAN 0x37
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_GUARANI
Packit Service a721b1
# define LANG_GUARANI 0x74
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_GUJARATI
Packit Service a721b1
# define LANG_GUJARATI 0x47
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_HAUSA
Packit Service a721b1
# define LANG_HAUSA 0x68
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_HAWAIIAN
Packit Service a721b1
# define LANG_HAWAIIAN 0x75
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_HEBREW
Packit Service a721b1
# define LANG_HEBREW 0x0d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_HINDI
Packit Service a721b1
# define LANG_HINDI 0x39
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_IBIBIO
Packit Service a721b1
# define LANG_IBIBIO 0x69
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_IGBO
Packit Service a721b1
# define LANG_IGBO 0x70
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_INDONESIAN
Packit Service a721b1
# define LANG_INDONESIAN 0x21
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_INUKTITUT
Packit Service a721b1
# define LANG_INUKTITUT 0x5d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KANNADA
Packit Service a721b1
# define LANG_KANNADA 0x4b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KANURI
Packit Service a721b1
# define LANG_KANURI 0x71
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KASHMIRI
Packit Service a721b1
# define LANG_KASHMIRI 0x60
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KAZAK
Packit Service a721b1
# define LANG_KAZAK 0x3f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KONKANI
Packit Service a721b1
# define LANG_KONKANI 0x57
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_KYRGYZ
Packit Service a721b1
# define LANG_KYRGYZ 0x40
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_LAO
Packit Service a721b1
# define LANG_LAO 0x54
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_LATIN
Packit Service a721b1
# define LANG_LATIN 0x76
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_LATVIAN
Packit Service a721b1
# define LANG_LATVIAN 0x26
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_LITHUANIAN
Packit Service a721b1
# define LANG_LITHUANIAN 0x27
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MACEDONIAN
Packit Service a721b1
# define LANG_MACEDONIAN 0x2f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MALAY
Packit Service a721b1
# define LANG_MALAY 0x3e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MALAYALAM
Packit Service a721b1
# define LANG_MALAYALAM 0x4c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MALTESE
Packit Service a721b1
# define LANG_MALTESE 0x3a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MANIPURI
Packit Service a721b1
# define LANG_MANIPURI 0x58
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MARATHI
Packit Service a721b1
# define LANG_MARATHI 0x4e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_MONGOLIAN
Packit Service a721b1
# define LANG_MONGOLIAN 0x50
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_NEPALI
Packit Service a721b1
# define LANG_NEPALI 0x61
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ORIYA
Packit Service a721b1
# define LANG_ORIYA 0x48
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_OROMO
Packit Service a721b1
# define LANG_OROMO 0x72
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_PAPIAMENTU
Packit Service a721b1
# define LANG_PAPIAMENTU 0x79
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_PASHTO
Packit Service a721b1
# define LANG_PASHTO 0x63
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_PUNJABI
Packit Service a721b1
# define LANG_PUNJABI 0x46
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_RHAETO_ROMANCE
Packit Service a721b1
# define LANG_RHAETO_ROMANCE 0x17
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SAAMI
Packit Service a721b1
# define LANG_SAAMI 0x3b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SANSKRIT
Packit Service a721b1
# define LANG_SANSKRIT 0x4f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SERBIAN
Packit Service a721b1
# define LANG_SERBIAN 0x1a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SINDHI
Packit Service a721b1
# define LANG_SINDHI 0x59
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SINHALESE
Packit Service a721b1
# define LANG_SINHALESE 0x5b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SLOVAK
Packit Service a721b1
# define LANG_SLOVAK 0x1b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SOMALI
Packit Service a721b1
# define LANG_SOMALI 0x77
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SORBIAN
Packit Service a721b1
# define LANG_SORBIAN 0x2e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SUTU
Packit Service a721b1
# define LANG_SUTU 0x30
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SWAHILI
Packit Service a721b1
# define LANG_SWAHILI 0x41
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_SYRIAC
Packit Service a721b1
# define LANG_SYRIAC 0x5a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TAGALOG
Packit Service a721b1
# define LANG_TAGALOG 0x64
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TAJIK
Packit Service a721b1
# define LANG_TAJIK 0x28
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TAMAZIGHT
Packit Service a721b1
# define LANG_TAMAZIGHT 0x5f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TAMIL
Packit Service a721b1
# define LANG_TAMIL 0x49
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TATAR
Packit Service a721b1
# define LANG_TATAR 0x44
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TELUGU
Packit Service a721b1
# define LANG_TELUGU 0x4a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_THAI
Packit Service a721b1
# define LANG_THAI 0x1e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TIBETAN
Packit Service a721b1
# define LANG_TIBETAN 0x51
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TIGRINYA
Packit Service a721b1
# define LANG_TIGRINYA 0x73
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TSONGA
Packit Service a721b1
# define LANG_TSONGA 0x31
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TSWANA
Packit Service a721b1
# define LANG_TSWANA 0x32
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_TURKMEN
Packit Service a721b1
# define LANG_TURKMEN 0x42
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_UKRAINIAN
Packit Service a721b1
# define LANG_UKRAINIAN 0x22
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_URDU
Packit Service a721b1
# define LANG_URDU 0x20
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_UZBEK
Packit Service a721b1
# define LANG_UZBEK 0x43
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_VENDA
Packit Service a721b1
# define LANG_VENDA 0x33
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_VIETNAMESE
Packit Service a721b1
# define LANG_VIETNAMESE 0x2a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_WELSH
Packit Service a721b1
# define LANG_WELSH 0x52
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_XHOSA
Packit Service a721b1
# define LANG_XHOSA 0x34
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_YI
Packit Service a721b1
# define LANG_YI 0x78
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_YIDDISH
Packit Service a721b1
# define LANG_YIDDISH 0x3d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_YORUBA
Packit Service a721b1
# define LANG_YORUBA 0x6a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef LANG_ZULU
Packit Service a721b1
# define LANG_ZULU 0x35
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
Packit Service a721b1
# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_IRAQ
Packit Service a721b1
# define SUBLANG_ARABIC_IRAQ 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_EGYPT
Packit Service a721b1
# define SUBLANG_ARABIC_EGYPT 0x03
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_LIBYA
Packit Service a721b1
# define SUBLANG_ARABIC_LIBYA 0x04
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_ALGERIA
Packit Service a721b1
# define SUBLANG_ARABIC_ALGERIA 0x05
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_MOROCCO
Packit Service a721b1
# define SUBLANG_ARABIC_MOROCCO 0x06
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_TUNISIA
Packit Service a721b1
# define SUBLANG_ARABIC_TUNISIA 0x07
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_OMAN
Packit Service a721b1
# define SUBLANG_ARABIC_OMAN 0x08
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_YEMEN
Packit Service a721b1
# define SUBLANG_ARABIC_YEMEN 0x09
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_SYRIA
Packit Service a721b1
# define SUBLANG_ARABIC_SYRIA 0x0a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_JORDAN
Packit Service a721b1
# define SUBLANG_ARABIC_JORDAN 0x0b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_LEBANON
Packit Service a721b1
# define SUBLANG_ARABIC_LEBANON 0x0c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_KUWAIT
Packit Service a721b1
# define SUBLANG_ARABIC_KUWAIT 0x0d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_UAE
Packit Service a721b1
# define SUBLANG_ARABIC_UAE 0x0e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_BAHRAIN
Packit Service a721b1
# define SUBLANG_ARABIC_BAHRAIN 0x0f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ARABIC_QATAR
Packit Service a721b1
# define SUBLANG_ARABIC_QATAR 0x10
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_AZERI_LATIN
Packit Service a721b1
# define SUBLANG_AZERI_LATIN 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_AZERI_CYRILLIC
Packit Service a721b1
# define SUBLANG_AZERI_CYRILLIC 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_BENGALI_INDIA
Packit Service a721b1
# define SUBLANG_BENGALI_INDIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_BENGALI_BANGLADESH
Packit Service a721b1
# define SUBLANG_BENGALI_BANGLADESH 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_CHINESE_MACAU
Packit Service a721b1
# define SUBLANG_CHINESE_MACAU 0x05
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
Packit Service a721b1
# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_JAMAICA
Packit Service a721b1
# define SUBLANG_ENGLISH_JAMAICA 0x08
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_CARIBBEAN
Packit Service a721b1
# define SUBLANG_ENGLISH_CARIBBEAN 0x09
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_BELIZE
Packit Service a721b1
# define SUBLANG_ENGLISH_BELIZE 0x0a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_TRINIDAD
Packit Service a721b1
# define SUBLANG_ENGLISH_TRINIDAD 0x0b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_ZIMBABWE
Packit Service a721b1
# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_PHILIPPINES
Packit Service a721b1
# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_INDONESIA
Packit Service a721b1
# define SUBLANG_ENGLISH_INDONESIA 0x0e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_HONGKONG
Packit Service a721b1
# define SUBLANG_ENGLISH_HONGKONG 0x0f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_INDIA
Packit Service a721b1
# define SUBLANG_ENGLISH_INDIA 0x10
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_MALAYSIA
Packit Service a721b1
# define SUBLANG_ENGLISH_MALAYSIA 0x11
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ENGLISH_SINGAPORE
Packit Service a721b1
# define SUBLANG_ENGLISH_SINGAPORE 0x12
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_LUXEMBOURG
Packit Service a721b1
# define SUBLANG_FRENCH_LUXEMBOURG 0x05
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_MONACO
Packit Service a721b1
# define SUBLANG_FRENCH_MONACO 0x06
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_WESTINDIES
Packit Service a721b1
# define SUBLANG_FRENCH_WESTINDIES 0x07
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_REUNION
Packit Service a721b1
# define SUBLANG_FRENCH_REUNION 0x08
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_CONGO
Packit Service a721b1
# define SUBLANG_FRENCH_CONGO 0x09
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_SENEGAL
Packit Service a721b1
# define SUBLANG_FRENCH_SENEGAL 0x0a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_CAMEROON
Packit Service a721b1
# define SUBLANG_FRENCH_CAMEROON 0x0b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_COTEDIVOIRE
Packit Service a721b1
# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_MALI
Packit Service a721b1
# define SUBLANG_FRENCH_MALI 0x0d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_MOROCCO
Packit Service a721b1
# define SUBLANG_FRENCH_MOROCCO 0x0e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_FRENCH_HAITI
Packit Service a721b1
# define SUBLANG_FRENCH_HAITI 0x0f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_GERMAN_LUXEMBOURG
Packit Service a721b1
# define SUBLANG_GERMAN_LUXEMBOURG 0x04
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
Packit Service a721b1
# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_KASHMIRI_INDIA
Packit Service a721b1
# define SUBLANG_KASHMIRI_INDIA 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_MALAY_MALAYSIA
Packit Service a721b1
# define SUBLANG_MALAY_MALAYSIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
Packit Service a721b1
# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_NEPALI_INDIA
Packit Service a721b1
# define SUBLANG_NEPALI_INDIA 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_PUNJABI_INDIA
Packit Service a721b1
# define SUBLANG_PUNJABI_INDIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_PUNJABI_PAKISTAN
Packit Service a721b1
# define SUBLANG_PUNJABI_PAKISTAN 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ROMANIAN_ROMANIA
Packit Service a721b1
# define SUBLANG_ROMANIAN_ROMANIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_ROMANIAN_MOLDOVA
Packit Service a721b1
# define SUBLANG_ROMANIAN_MOLDOVA 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SERBIAN_LATIN
Packit Service a721b1
# define SUBLANG_SERBIAN_LATIN 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SERBIAN_CYRILLIC
Packit Service a721b1
# define SUBLANG_SERBIAN_CYRILLIC 0x03
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SINDHI_PAKISTAN
Packit Service a721b1
# define SUBLANG_SINDHI_PAKISTAN 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SINDHI_AFGHANISTAN
Packit Service a721b1
# define SUBLANG_SINDHI_AFGHANISTAN 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_GUATEMALA
Packit Service a721b1
# define SUBLANG_SPANISH_GUATEMALA 0x04
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_COSTA_RICA
Packit Service a721b1
# define SUBLANG_SPANISH_COSTA_RICA 0x05
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_PANAMA
Packit Service a721b1
# define SUBLANG_SPANISH_PANAMA 0x06
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
Packit Service a721b1
# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_VENEZUELA
Packit Service a721b1
# define SUBLANG_SPANISH_VENEZUELA 0x08
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_COLOMBIA
Packit Service a721b1
# define SUBLANG_SPANISH_COLOMBIA 0x09
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_PERU
Packit Service a721b1
# define SUBLANG_SPANISH_PERU 0x0a
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_ARGENTINA
Packit Service a721b1
# define SUBLANG_SPANISH_ARGENTINA 0x0b
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_ECUADOR
Packit Service a721b1
# define SUBLANG_SPANISH_ECUADOR 0x0c
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_CHILE
Packit Service a721b1
# define SUBLANG_SPANISH_CHILE 0x0d
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_URUGUAY
Packit Service a721b1
# define SUBLANG_SPANISH_URUGUAY 0x0e
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_PARAGUAY
Packit Service a721b1
# define SUBLANG_SPANISH_PARAGUAY 0x0f
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_BOLIVIA
Packit Service a721b1
# define SUBLANG_SPANISH_BOLIVIA 0x10
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_EL_SALVADOR
Packit Service a721b1
# define SUBLANG_SPANISH_EL_SALVADOR 0x11
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_HONDURAS
Packit Service a721b1
# define SUBLANG_SPANISH_HONDURAS 0x12
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_NICARAGUA
Packit Service a721b1
# define SUBLANG_SPANISH_NICARAGUA 0x13
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SPANISH_PUERTO_RICO
Packit Service a721b1
# define SUBLANG_SPANISH_PUERTO_RICO 0x14
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_SWEDISH_FINLAND
Packit Service a721b1
# define SUBLANG_SWEDISH_FINLAND 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_TAMAZIGHT_ARABIC
Packit Service a721b1
# define SUBLANG_TAMAZIGHT_ARABIC 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_TAMAZIGHT_ALGERIA_LATIN
Packit Service a721b1
# define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_TIGRINYA_ETHIOPIA
Packit Service a721b1
# define SUBLANG_TIGRINYA_ETHIOPIA 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_TIGRINYA_ERITREA
Packit Service a721b1
# define SUBLANG_TIGRINYA_ERITREA 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_URDU_PAKISTAN
Packit Service a721b1
# define SUBLANG_URDU_PAKISTAN 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_URDU_INDIA
Packit Service a721b1
# define SUBLANG_URDU_INDIA 0x02
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_UZBEK_LATIN
Packit Service a721b1
# define SUBLANG_UZBEK_LATIN 0x01
Packit Service a721b1
# endif
Packit Service a721b1
# ifndef SUBLANG_UZBEK_CYRILLIC
Packit Service a721b1
# define SUBLANG_UZBEK_CYRILLIC 0x02
Packit Service a721b1
# endif
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
Packit Service a721b1
/* MacOS X 10.2 or newer */
Packit Service a721b1
Packit Service a721b1
/* Canonicalize a MacOS X locale name to a Unix locale name.
Packit Service a721b1
   NAME is a sufficiently large buffer.
Packit Service a721b1
   On input, it contains the MacOS X locale name.
Packit Service a721b1
   On output, it contains the Unix locale name.  */
Packit Service a721b1
#  if !defined IN_LIBINTL
Packit Service a721b1
static
Packit Service a721b1
#  endif
Packit Service a721b1
void
Packit Service a721b1
gl_locale_name_canonicalize (char *name)
Packit Service a721b1
{
Packit Service a721b1
  /* This conversion is based on a posting by
Packit Service a721b1
     Deborah GoldSmith <goldsmit@apple.com> on 2005-03-08,
Packit Service a721b1
     http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */
Packit Service a721b1
Packit Service a721b1
  /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and
Packit Service a721b1
     ISO 3166) names.  Prior to MacOS X 10.3, there is no API for doing this.
Packit Service a721b1
     Therefore we do it ourselves, using a table based on the results of the
Packit Service a721b1
     MacOS X 10.3.8 function
Packit Service a721b1
     CFLocaleCreateCanonicalLocaleIdentifierFromString().  */
Packit Service a721b1
  typedef struct { const char legacy[21+1]; const char unixy[5+1]; }
Packit Service a721b1
	  legacy_entry;
Packit Service a721b1
  static const legacy_entry legacy_table[] = {
Packit Service a721b1
    { "Afrikaans",             "af" },
Packit Service a721b1
    { "Albanian",              "sq" },
Packit Service a721b1
    { "Amharic",               "am" },
Packit Service a721b1
    { "Arabic",                "ar" },
Packit Service a721b1
    { "Armenian",              "hy" },
Packit Service a721b1
    { "Assamese",              "as" },
Packit Service a721b1
    { "Aymara",                "ay" },
Packit Service a721b1
    { "Azerbaijani",           "az" },
Packit Service a721b1
    { "Basque",                "eu" },
Packit Service a721b1
    { "Belarusian",            "be" },
Packit Service a721b1
    { "Belorussian",           "be" },
Packit Service a721b1
    { "Bengali",               "bn" },
Packit Service a721b1
    { "Brazilian Portugese",   "pt_BR" },
Packit Service a721b1
    { "Brazilian Portuguese",  "pt_BR" },
Packit Service a721b1
    { "Breton",                "br" },
Packit Service a721b1
    { "Bulgarian",             "bg" },
Packit Service a721b1
    { "Burmese",               "my" },
Packit Service a721b1
    { "Byelorussian",          "be" },
Packit Service a721b1
    { "Catalan",               "ca" },
Packit Service a721b1
    { "Chewa",                 "ny" },
Packit Service a721b1
    { "Chichewa",              "ny" },
Packit Service a721b1
    { "Chinese",               "zh" },
Packit Service a721b1
    { "Chinese, Simplified",   "zh_CN" },
Packit Service a721b1
    { "Chinese, Traditional",  "zh_TW" },
Packit Service a721b1
    { "Chinese, Tradtional",   "zh_TW" },
Packit Service a721b1
    { "Croatian",              "hr" },
Packit Service a721b1
    { "Czech",                 "cs" },
Packit Service a721b1
    { "Danish",                "da" },
Packit Service a721b1
    { "Dutch",                 "nl" },
Packit Service a721b1
    { "Dzongkha",              "dz" },
Packit Service a721b1
    { "English",               "en" },
Packit Service a721b1
    { "Esperanto",             "eo" },
Packit Service a721b1
    { "Estonian",              "et" },
Packit Service a721b1
    { "Faroese",               "fo" },
Packit Service a721b1
    { "Farsi",                 "fa" },
Packit Service a721b1
    { "Finnish",               "fi" },
Packit Service a721b1
    { "Flemish",               "nl_BE" },
Packit Service a721b1
    { "French",                "fr" },
Packit Service a721b1
    { "Galician",              "gl" },
Packit Service a721b1
    { "Gallegan",              "gl" },
Packit Service a721b1
    { "Georgian",              "ka" },
Packit Service a721b1
    { "German",                "de" },
Packit Service a721b1
    { "Greek",                 "el" },
Packit Service a721b1
    { "Greenlandic",           "kl" },
Packit Service a721b1
    { "Guarani",               "gn" },
Packit Service a721b1
    { "Gujarati",              "gu" },
Packit Service a721b1
    { "Hawaiian",              "haw" }, /* Yes, "haw", not "cpe".  */
Packit Service a721b1
    { "Hebrew",                "he" },
Packit Service a721b1
    { "Hindi",                 "hi" },
Packit Service a721b1
    { "Hungarian",             "hu" },
Packit Service a721b1
    { "Icelandic",             "is" },
Packit Service a721b1
    { "Indonesian",            "id" },
Packit Service a721b1
    { "Inuktitut",             "iu" },
Packit Service a721b1
    { "Irish",                 "ga" },
Packit Service a721b1
    { "Italian",               "it" },
Packit Service a721b1
    { "Japanese",              "ja" },
Packit Service a721b1
    { "Javanese",              "jv" },
Packit Service a721b1
    { "Kalaallisut",           "kl" },
Packit Service a721b1
    { "Kannada",               "kn" },
Packit Service a721b1
    { "Kashmiri",              "ks" },
Packit Service a721b1
    { "Kazakh",                "kk" },
Packit Service a721b1
    { "Khmer",                 "km" },
Packit Service a721b1
    { "Kinyarwanda",           "rw" },
Packit Service a721b1
    { "Kirghiz",               "ky" },
Packit Service a721b1
    { "Korean",                "ko" },
Packit Service a721b1
    { "Kurdish",               "ku" },
Packit Service a721b1
    { "Latin",                 "la" },
Packit Service a721b1
    { "Latvian",               "lv" },
Packit Service a721b1
    { "Lithuanian",            "lt" },
Packit Service a721b1
    { "Macedonian",            "mk" },
Packit Service a721b1
    { "Malagasy",              "mg" },
Packit Service a721b1
    { "Malay",                 "ms" },
Packit Service a721b1
    { "Malayalam",             "ml" },
Packit Service a721b1
    { "Maltese",               "mt" },
Packit Service a721b1
    { "Manx",                  "gv" },
Packit Service a721b1
    { "Marathi",               "mr" },
Packit Service a721b1
    { "Moldavian",             "mo" },
Packit Service a721b1
    { "Mongolian",             "mn" },
Packit Service a721b1
    { "Nepali",                "ne" },
Packit Service a721b1
    { "Norwegian",             "nb" }, /* Yes, "nb", not the obsolete "no".  */
Packit Service a721b1
    { "Nyanja",                "ny" },
Packit Service a721b1
    { "Nynorsk",               "nn" },
Packit Service a721b1
    { "Oriya",                 "or" },
Packit Service a721b1
    { "Oromo",                 "om" },
Packit Service a721b1
    { "Panjabi",               "pa" },
Packit Service a721b1
    { "Pashto",                "ps" },
Packit Service a721b1
    { "Persian",               "fa" },
Packit Service a721b1
    { "Polish",                "pl" },
Packit Service a721b1
    { "Portuguese",            "pt" },
Packit Service a721b1
    { "Portuguese, Brazilian", "pt_BR" },
Packit Service a721b1
    { "Punjabi",               "pa" },
Packit Service a721b1
    { "Pushto",                "ps" },
Packit Service a721b1
    { "Quechua",               "qu" },
Packit Service a721b1
    { "Romanian",              "ro" },
Packit Service a721b1
    { "Ruanda",                "rw" },
Packit Service a721b1
    { "Rundi",                 "rn" },
Packit Service a721b1
    { "Russian",               "ru" },
Packit Service a721b1
    { "Sami",                  "se_NO" }, /* Not just "se".  */
Packit Service a721b1
    { "Sanskrit",              "sa" },
Packit Service a721b1
    { "Scottish",              "gd" },
Packit Service a721b1
    { "Serbian",               "sr" },
Packit Service a721b1
    { "Simplified Chinese",    "zh_CN" },
Packit Service a721b1
    { "Sindhi",                "sd" },
Packit Service a721b1
    { "Sinhalese",             "si" },
Packit Service a721b1
    { "Slovak",                "sk" },
Packit Service a721b1
    { "Slovenian",             "sl" },
Packit Service a721b1
    { "Somali",                "so" },
Packit Service a721b1
    { "Spanish",               "es" },
Packit Service a721b1
    { "Sundanese",             "su" },
Packit Service a721b1
    { "Swahili",               "sw" },
Packit Service a721b1
    { "Swedish",               "sv" },
Packit Service a721b1
    { "Tagalog",               "tl" },
Packit Service a721b1
    { "Tajik",                 "tg" },
Packit Service a721b1
    { "Tajiki",                "tg" },
Packit Service a721b1
    { "Tamil",                 "ta" },
Packit Service a721b1
    { "Tatar",                 "tt" },
Packit Service a721b1
    { "Telugu",                "te" },
Packit Service a721b1
    { "Thai",                  "th" },
Packit Service a721b1
    { "Tibetan",               "bo" },
Packit Service a721b1
    { "Tigrinya",              "ti" },
Packit Service a721b1
    { "Tongan",                "to" },
Packit Service a721b1
    { "Traditional Chinese",   "zh_TW" },
Packit Service a721b1
    { "Turkish",               "tr" },
Packit Service a721b1
    { "Turkmen",               "tk" },
Packit Service a721b1
    { "Uighur",                "ug" },
Packit Service a721b1
    { "Ukrainian",             "uk" },
Packit Service a721b1
    { "Urdu",                  "ur" },
Packit Service a721b1
    { "Uzbek",                 "uz" },
Packit Service a721b1
    { "Vietnamese",            "vi" },
Packit Service a721b1
    { "Welsh",                 "cy" },
Packit Service a721b1
    { "Yiddish",               "yi" }
Packit Service a721b1
  };
Packit Service a721b1
Packit Service a721b1
  /* Convert new-style locale names with language tags (ISO 639 and ISO 15924)
Packit Service a721b1
     to Unix (ISO 639 and ISO 3166) names.  */
Packit Service a721b1
  typedef struct { const char langtag[7+1]; const char unixy[12+1]; }
Packit Service a721b1
	  langtag_entry;
Packit Service a721b1
  static const langtag_entry langtag_table[] = {
Packit Service a721b1
    /* MacOS X has "az-Arab", "az-Cyrl", "az-Latn".
Packit Service a721b1
       The default script for az on Unix is Latin.  */
Packit Service a721b1
    { "az-Latn", "az" },
Packit Service a721b1
    /* MacOS X has "ga-dots".  Does not yet exist on Unix.  */
Packit Service a721b1
    { "ga-dots", "ga" },
Packit Service a721b1
    /* MacOS X has "kk-Cyrl".  Does not yet exist on Unix.  */
Packit Service a721b1
    /* MacOS X has "mn-Cyrl", "mn-Mong".
Packit Service a721b1
       The default script for mn on Unix is Cyrillic.  */
Packit Service a721b1
    { "mn-Cyrl", "mn" },
Packit Service a721b1
    /* MacOS X has "ms-Arab", "ms-Latn".
Packit Service a721b1
       The default script for ms on Unix is Latin.  */
Packit Service a721b1
    { "ms-Latn", "ms" },
Packit Service a721b1
    /* MacOS X has "tg-Cyrl".
Packit Service a721b1
       The default script for tg on Unix is Cyrillic.  */
Packit Service a721b1
    { "tg-Cyrl", "tg" },
Packit Service a721b1
    /* MacOS X has "tk-Cyrl".  Does not yet exist on Unix.  */
Packit Service a721b1
    /* MacOS X has "tt-Cyrl".
Packit Service a721b1
       The default script for tt on Unix is Cyrillic.  */
Packit Service a721b1
    { "tt-Cyrl", "tt" },
Packit Service a721b1
    /* MacOS X has "zh-Hans", "zh-Hant".
Packit Service a721b1
       Country codes are used to distinguish these on Unix.  */
Packit Service a721b1
    { "zh-Hans", "zh_CN" },
Packit Service a721b1
    { "zh-Hant", "zh_TW" }
Packit Service a721b1
  };
Packit Service a721b1
Packit Service a721b1
  /* Convert script names (ISO 15924) to Unix conventions.
Packit Service a721b1
     See http://www.unicode.org/iso15924/iso15924-codes.html  */
Packit Service a721b1
  typedef struct { const char script[4+1]; const char unixy[9+1]; }
Packit Service a721b1
	  script_entry;
Packit Service a721b1
  static const script_entry script_table[] = {
Packit Service a721b1
    { "Arab", "arabic" },
Packit Service a721b1
    { "Cyrl", "cyrillic" },
Packit Service a721b1
    { "Mong", "mongolian" }
Packit Service a721b1
  };
Packit Service a721b1
Packit Service a721b1
  /* Step 1: Convert using legacy_table.  */
Packit Service a721b1
  if (name[0] >= 'A' && name[0] <= 'Z')
Packit Service a721b1
    {
Packit Service a721b1
      unsigned int i1, i2;
Packit Service a721b1
      i1 = 0;
Packit Service a721b1
      i2 = sizeof (legacy_table) / sizeof (legacy_entry);
Packit Service a721b1
      while (i2 - i1 > 1)
Packit Service a721b1
	{
Packit Service a721b1
	  /* At this point we know that if name occurs in legacy_table,
Packit Service a721b1
	     its index must be >= i1 and < i2.  */
Packit Service a721b1
	  unsigned int i = (i1 + i2) >> 1;
Packit Service a721b1
	  const legacy_entry *p = &legacy_table[i];
Packit Service a721b1
	  if (strcmp (name, p->legacy) < 0)
Packit Service a721b1
	    i2 = i;
Packit Service a721b1
	  else
Packit Service a721b1
	    i1 = i;
Packit Service a721b1
	}
Packit Service a721b1
      if (strcmp (name, legacy_table[i1].legacy) == 0)
Packit Service a721b1
	{
Packit Service a721b1
	  strcpy (name, legacy_table[i1].unixy);
Packit Service a721b1
	  return;
Packit Service a721b1
	}
Packit Service a721b1
    }
Packit Service a721b1
Packit Service a721b1
  /* Step 2: Convert using langtag_table and script_table.  */
Packit Service a721b1
  if (strlen (name) == 7 && name[2] == '-')
Packit Service a721b1
    {
Packit Service a721b1
      unsigned int i1, i2;
Packit Service a721b1
      i1 = 0;
Packit Service a721b1
      i2 = sizeof (langtag_table) / sizeof (langtag_entry);
Packit Service a721b1
      while (i2 - i1 > 1)
Packit Service a721b1
	{
Packit Service a721b1
	  /* At this point we know that if name occurs in langtag_table,
Packit Service a721b1
	     its index must be >= i1 and < i2.  */
Packit Service a721b1
	  unsigned int i = (i1 + i2) >> 1;
Packit Service a721b1
	  const langtag_entry *p = &langtag_table[i];
Packit Service a721b1
	  if (strcmp (name, p->langtag) < 0)
Packit Service a721b1
	    i2 = i;
Packit Service a721b1
	  else
Packit Service a721b1
	    i1 = i;
Packit Service a721b1
	}
Packit Service a721b1
      if (strcmp (name, langtag_table[i1].langtag) == 0)
Packit Service a721b1
	{
Packit Service a721b1
	  strcpy (name, langtag_table[i1].unixy);
Packit Service a721b1
	  return;
Packit Service a721b1
	}
Packit Service a721b1
Packit Service a721b1
      i1 = 0;
Packit Service a721b1
      i2 = sizeof (script_table) / sizeof (script_entry);
Packit Service a721b1
      while (i2 - i1 > 1)
Packit Service a721b1
	{
Packit Service a721b1
	  /* At this point we know that if (name + 3) occurs in script_table,
Packit Service a721b1
	     its index must be >= i1 and < i2.  */
Packit Service a721b1
	  unsigned int i = (i1 + i2) >> 1;
Packit Service a721b1
	  const script_entry *p = &script_table[i];
Packit Service a721b1
	  if (strcmp (name + 3, p->script) < 0)
Packit Service a721b1
	    i2 = i;
Packit Service a721b1
	  else
Packit Service a721b1
	    i1 = i;
Packit Service a721b1
	}
Packit Service a721b1
      if (strcmp (name + 3, script_table[i1].script) == 0)
Packit Service a721b1
	{
Packit Service a721b1
	  name[2] = '@';
Packit Service a721b1
	  strcpy (name + 3, script_table[i1].unixy);
Packit Service a721b1
	  return;
Packit Service a721b1
	}
Packit Service a721b1
    }
Packit Service a721b1
Packit Service a721b1
  /* Step 3: Convert new-style dash to Unix underscore. */
Packit Service a721b1
  {
Packit Service a721b1
    char *p;
Packit Service a721b1
    for (p = name; *p != '\0'; p++)
Packit Service a721b1
      if (*p == '-')
Packit Service a721b1
	*p = '_';
Packit Service a721b1
  }
Packit Service a721b1
}
Packit Service a721b1
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
/* XPG3 defines the result of 'setlocale (category, NULL)' as:
Packit Service a721b1
   "Directs 'setlocale()' to query 'category' and return the current
Packit Service a721b1
    setting of 'local'."
Packit Service a721b1
   However it does not specify the exact format.  Neither do SUSV2 and
Packit Service a721b1
   ISO C 99.  So we can use this feature only on selected systems (e.g.
Packit Service a721b1
   those using GNU C Library).  */
Packit Service a721b1
#if defined _LIBC || (defined __GLIBC__ && __GLIBC__ >= 2)
Packit Service a721b1
# define HAVE_LOCALE_NULL
Packit Service a721b1
#endif
Packit Service a721b1
Packit Service a721b1
/* Determine the current locale's name, and canonicalize it into XPG syntax
Packit Service a721b1
     language[_territory][.codeset][@modifier]
Packit Service a721b1
   The codeset part in the result is not reliable; the locale_charset()
Packit Service a721b1
   should be used for codeset information instead.
Packit Service a721b1
   The result must not be freed; it is statically allocated.  */
Packit Service a721b1
Packit Service a721b1
const char *
Packit Service a721b1
gl_locale_name_posix (int category, const char *categoryname)
Packit Service a721b1
{
Packit Service a721b1
  /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
Packit Service a721b1
     On some systems this can be done by the 'setlocale' function itself.  */
Packit Service a721b1
#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
Packit Service a721b1
  return setlocale (category, NULL);
Packit Service a721b1
#else
Packit Service a721b1
  const char *retval;
Packit Service a721b1
Packit Service a721b1
  /* Setting of LC_ALL overrides all other.  */
Packit Service a721b1
  retval = getenv ("LC_ALL");
Packit Service a721b1
  if (retval != NULL && retval[0] != '\0')
Packit Service a721b1
    return retval;
Packit Service a721b1
  /* Next comes the name of the desired category.  */
Packit Service a721b1
  retval = getenv (categoryname);
Packit Service a721b1
  if (retval != NULL && retval[0] != '\0')
Packit Service a721b1
    return retval;
Packit Service a721b1
  /* Last possibility is the LANG environment variable.  */
Packit Service a721b1
  retval = getenv ("LANG");
Packit Service a721b1
  if (retval != NULL && retval[0] != '\0')
Packit Service a721b1
    return retval;
Packit Service a721b1
Packit Service a721b1
  return NULL;
Packit Service a721b1
#endif
Packit Service a721b1
}
Packit Service a721b1
Packit Service a721b1
const char *
Packit Service a721b1
gl_locale_name_default (void)
Packit Service a721b1
{
Packit Service a721b1
  /* POSIX:2001 says:
Packit Service a721b1
     "All implementations shall define a locale as the default locale, to be
Packit Service a721b1
      invoked when no environment variables are set, or set to the empty
Packit Service a721b1
      string.  This default locale can be the POSIX locale or any other
Packit Service a721b1
      implementation-defined locale.  Some implementations may provide
Packit Service a721b1
      facilities for local installation administrators to set the default
Packit Service a721b1
      locale, customizing it for each location.  POSIX:2001 does not require
Packit Service a721b1
      such a facility.  */
Packit Service a721b1
Packit Service a721b1
#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined(WIN32_NATIVE))
Packit Service a721b1
Packit Service a721b1
  /* The system does not have a way of setting the locale, other than the
Packit Service a721b1
     POSIX specified environment variables.  We use C as default locale.  */
Packit Service a721b1
  return "C";
Packit Service a721b1
Packit Service a721b1
#else
Packit Service a721b1
Packit Service a721b1
  /* Return an XPG style locale name language[_territory][@modifier].
Packit Service a721b1
     Don't even bother determining the codeset; it's not useful in this
Packit Service a721b1
     context, because message catalogs are not specific to a single
Packit Service a721b1
     codeset.  */
Packit Service a721b1
Packit Service a721b1
# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
Packit Service a721b1
  /* MacOS X 10.2 or newer */
Packit Service a721b1
  {
Packit Service a721b1
    /* Cache the locale name, since CoreFoundation calls are expensive.  */
Packit Service a721b1
    static const char *cached_localename;
Packit Service a721b1
Packit Service a721b1
    if (cached_localename == NULL)
Packit Service a721b1
      {
Packit Service a721b1
	char namebuf[256];
Packit Service a721b1
#  if HAVE_CFLOCALECOPYCURRENT /* MacOS X 10.3 or newer */
Packit Service a721b1
	CFLocaleRef locale = CFLocaleCopyCurrent ();
Packit Service a721b1
	CFStringRef name = CFLocaleGetIdentifier (locale);
Packit Service a721b1
Packit Service a721b1
	if (CFStringGetCString (name, namebuf, sizeof(namebuf),
Packit Service a721b1
				kCFStringEncodingASCII))
Packit Service a721b1
	  {
Packit Service a721b1
	    gl_locale_name_canonicalize (namebuf);
Packit Service a721b1
	    cached_localename = strdup (namebuf);
Packit Service a721b1
	  }
Packit Service a721b1
	CFRelease (locale);
Packit Service a721b1
#  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.2 or newer */
Packit Service a721b1
	CFTypeRef value =
Packit Service a721b1
	  CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
Packit Service a721b1
				     kCFPreferencesCurrentApplication);
Packit Service a721b1
	if (value != NULL
Packit Service a721b1
	    && CFGetTypeID (value) == CFStringGetTypeID ()
Packit Service a721b1
	    && CFStringGetCString ((CFStringRef)value, namebuf, sizeof(namebuf),
Packit Service a721b1
				   kCFStringEncodingASCII))
Packit Service a721b1
	  {
Packit Service a721b1
	    gl_locale_name_canonicalize (namebuf);
Packit Service a721b1
	    cached_localename = strdup (namebuf);
Packit Service a721b1
	  }
Packit Service a721b1
#  endif
Packit Service a721b1
	if (cached_localename == NULL)
Packit Service a721b1
	  cached_localename = "C";
Packit Service a721b1
      }
Packit Service a721b1
    return cached_localename;
Packit Service a721b1
  }
Packit Service a721b1
Packit Service a721b1
# endif
Packit Service a721b1
Packit Service a721b1
# if defined(WIN32_NATIVE) /* WIN32, not Cygwin */
Packit Service a721b1
  {
Packit Service a721b1
    LCID lcid;
Packit Service a721b1
    LANGID langid;
Packit Service a721b1
    int primary, sub;
Packit Service a721b1
Packit Service a721b1
    /* Use native Win32 API locale ID.  */
Packit Service a721b1
    lcid = GetThreadLocale ();
Packit Service a721b1
Packit Service a721b1
    /* Strip off the sorting rules, keep only the language part.  */
Packit Service a721b1
    langid = LANGIDFROMLCID (lcid);
Packit Service a721b1
Packit Service a721b1
    /* Split into language and territory part.  */
Packit Service a721b1
    primary = PRIMARYLANGID (langid);
Packit Service a721b1
    sub = SUBLANGID (langid);
Packit Service a721b1
Packit Service a721b1
    /* Dispatch on language.
Packit Service a721b1
       See also http://www.unicode.org/unicode/onlinedat/languages.html .
Packit Service a721b1
       For details about languages, see http://www.ethnologue.com/ .  */
Packit Service a721b1
    switch (primary)
Packit Service a721b1
      {
Packit Service a721b1
      case LANG_AFRIKAANS: return "af_ZA";
Packit Service a721b1
      case LANG_ALBANIAN: return "sq_AL";
Packit Service a721b1
      case LANG_AMHARIC: return "am_ET";
Packit Service a721b1
      case LANG_ARABIC:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
Packit Service a721b1
	  case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
Packit Service a721b1
	  case SUBLANG_ARABIC_EGYPT: return "ar_EG";
Packit Service a721b1
	  case SUBLANG_ARABIC_LIBYA: return "ar_LY";
Packit Service a721b1
	  case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
Packit Service a721b1
	  case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
Packit Service a721b1
	  case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
Packit Service a721b1
	  case SUBLANG_ARABIC_OMAN: return "ar_OM";
Packit Service a721b1
	  case SUBLANG_ARABIC_YEMEN: return "ar_YE";
Packit Service a721b1
	  case SUBLANG_ARABIC_SYRIA: return "ar_SY";
Packit Service a721b1
	  case SUBLANG_ARABIC_JORDAN: return "ar_JO";
Packit Service a721b1
	  case SUBLANG_ARABIC_LEBANON: return "ar_LB";
Packit Service a721b1
	  case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
Packit Service a721b1
	  case SUBLANG_ARABIC_UAE: return "ar_AE";
Packit Service a721b1
	  case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
Packit Service a721b1
	  case SUBLANG_ARABIC_QATAR: return "ar_QA";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ar";
Packit Service a721b1
      case LANG_ARMENIAN: return "hy_AM";
Packit Service a721b1
      case LANG_ASSAMESE: return "as_IN";
Packit Service a721b1
      case LANG_AZERI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  /* FIXME: Adjust this when Azerbaijani locales appear on Unix.  */
Packit Service a721b1
	  case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
Packit Service a721b1
	  case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
Packit Service a721b1
	  }
Packit Service a721b1
	return "az";
Packit Service a721b1
      case LANG_BASQUE:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "eu_ES";
Packit Service a721b1
	  }
Packit Service a721b1
	return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR".  */
Packit Service a721b1
      case LANG_BELARUSIAN: return "be_BY";
Packit Service a721b1
      case LANG_BENGALI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_BENGALI_INDIA: return "bn_IN";
Packit Service a721b1
	  case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
Packit Service a721b1
	  }
Packit Service a721b1
	return "bn";
Packit Service a721b1
      case LANG_BULGARIAN: return "bg_BG";
Packit Service a721b1
      case LANG_BURMESE: return "my_MM";
Packit Service a721b1
      case LANG_CAMBODIAN: return "km_KH";
Packit Service a721b1
      case LANG_CATALAN: return "ca_ES";
Packit Service a721b1
      case LANG_CHEROKEE: return "chr_US";
Packit Service a721b1
      case LANG_CHINESE:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
Packit Service a721b1
	  case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
Packit Service a721b1
	  case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
Packit Service a721b1
	  case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
Packit Service a721b1
	  case SUBLANG_CHINESE_MACAU: return "zh_MO";
Packit Service a721b1
	  }
Packit Service a721b1
	return "zh";
Packit Service a721b1
      case LANG_CROATIAN:       /* LANG_CROATIAN == LANG_SERBIAN
Packit Service a721b1
				 * What used to be called Serbo-Croatian
Packit Service a721b1
				 * should really now be two separate
Packit Service a721b1
				 * languages because of political reasons.
Packit Service a721b1
				 * (Says tml, who knows nothing about Serbian
Packit Service a721b1
				 * or Croatian.)
Packit Service a721b1
				 * (I can feel those flames coming already.)
Packit Service a721b1
				 */
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "hr_HR";
Packit Service a721b1
	  case SUBLANG_SERBIAN_LATIN: return "sr_CS";
Packit Service a721b1
	  case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
Packit Service a721b1
	  }
Packit Service a721b1
	return "hr";
Packit Service a721b1
      case LANG_CZECH: return "cs_CZ";
Packit Service a721b1
      case LANG_DANISH: return "da_DK";
Packit Service a721b1
      case LANG_DIVEHI: return "dv_MV";
Packit Service a721b1
      case LANG_DUTCH:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DUTCH: return "nl_NL";
Packit Service a721b1
	  case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
Packit Service a721b1
	  }
Packit Service a721b1
	return "nl";
Packit Service a721b1
      case LANG_EDO: return "bin_NG";
Packit Service a721b1
      case LANG_ENGLISH:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
Packit Service a721b1
	   * English was the language spoken in England.
Packit Service a721b1
	   * Oh well.
Packit Service a721b1
	   */
Packit Service a721b1
	  case SUBLANG_ENGLISH_US: return "en_US";
Packit Service a721b1
	  case SUBLANG_ENGLISH_UK: return "en_GB";
Packit Service a721b1
	  case SUBLANG_ENGLISH_AUS: return "en_AU";
Packit Service a721b1
	  case SUBLANG_ENGLISH_CAN: return "en_CA";
Packit Service a721b1
	  case SUBLANG_ENGLISH_NZ: return "en_NZ";
Packit Service a721b1
	  case SUBLANG_ENGLISH_EIRE: return "en_IE";
Packit Service a721b1
	  case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
Packit Service a721b1
	  case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
Packit Service a721b1
	  case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
Packit Service a721b1
	  case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
Packit Service a721b1
	  case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
Packit Service a721b1
	  case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
Packit Service a721b1
	  case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
Packit Service a721b1
	  case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
Packit Service a721b1
	  case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
Packit Service a721b1
	  case SUBLANG_ENGLISH_INDIA: return "en_IN";
Packit Service a721b1
	  case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
Packit Service a721b1
	  case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
Packit Service a721b1
	  }
Packit Service a721b1
	return "en";
Packit Service a721b1
      case LANG_ESTONIAN: return "et_EE";
Packit Service a721b1
      case LANG_FAEROESE: return "fo_FO";
Packit Service a721b1
      case LANG_FARSI: return "fa_IR";
Packit Service a721b1
      case LANG_FINNISH: return "fi_FI";
Packit Service a721b1
      case LANG_FRENCH:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_FRENCH: return "fr_FR";
Packit Service a721b1
	  case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
Packit Service a721b1
	  case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
Packit Service a721b1
	  case SUBLANG_FRENCH_SWISS: return "fr_CH";
Packit Service a721b1
	  case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
Packit Service a721b1
	  case SUBLANG_FRENCH_MONACO: return "fr_MC";
Packit Service a721b1
	  case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
Packit Service a721b1
	  case SUBLANG_FRENCH_REUNION: return "fr_RE";
Packit Service a721b1
	  case SUBLANG_FRENCH_CONGO: return "fr_CG";
Packit Service a721b1
	  case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
Packit Service a721b1
	  case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
Packit Service a721b1
	  case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
Packit Service a721b1
	  case SUBLANG_FRENCH_MALI: return "fr_ML";
Packit Service a721b1
	  case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
Packit Service a721b1
	  case SUBLANG_FRENCH_HAITI: return "fr_HT";
Packit Service a721b1
	  }
Packit Service a721b1
	return "fr";
Packit Service a721b1
      case LANG_FRISIAN: return "fy_NL";
Packit Service a721b1
      case LANG_FULFULDE:
Packit Service a721b1
	/* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin.  */
Packit Service a721b1
	return "ff_NG";
Packit Service a721b1
      case LANG_GAELIC:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case 0x01: /* SCOTTISH */ return "gd_GB";
Packit Service a721b1
	  case 0x02: /* IRISH */ return "ga_IE";
Packit Service a721b1
	  }
Packit Service a721b1
	return "C";
Packit Service a721b1
      case LANG_GALICIAN: return "gl_ES";
Packit Service a721b1
      case LANG_GEORGIAN: return "ka_GE";
Packit Service a721b1
      case LANG_GERMAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_GERMAN: return "de_DE";
Packit Service a721b1
	  case SUBLANG_GERMAN_SWISS: return "de_CH";
Packit Service a721b1
	  case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
Packit Service a721b1
	  case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
Packit Service a721b1
	  case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
Packit Service a721b1
	  }
Packit Service a721b1
	return "de";
Packit Service a721b1
      case LANG_GREEK: return "el_GR";
Packit Service a721b1
      case LANG_GUARANI: return "gn_PY";
Packit Service a721b1
      case LANG_GUJARATI: return "gu_IN";
Packit Service a721b1
      case LANG_HAUSA: return "ha_NG";
Packit Service a721b1
      case LANG_HAWAIIAN:
Packit Service a721b1
	/* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
Packit Service a721b1
	   or Hawaii Creole English ("cpe_US", 600000 speakers)?  */
Packit Service a721b1
	return "cpe_US";
Packit Service a721b1
      case LANG_HEBREW: return "he_IL";
Packit Service a721b1
      case LANG_HINDI: return "hi_IN";
Packit Service a721b1
      case LANG_HUNGARIAN: return "hu_HU";
Packit Service a721b1
      case LANG_IBIBIO: return "nic_NG";
Packit Service a721b1
      case LANG_ICELANDIC: return "is_IS";
Packit Service a721b1
      case LANG_IGBO: return "ig_NG";
Packit Service a721b1
      case LANG_INDONESIAN: return "id_ID";
Packit Service a721b1
      case LANG_INUKTITUT: return "iu_CA";
Packit Service a721b1
      case LANG_ITALIAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_ITALIAN: return "it_IT";
Packit Service a721b1
	  case SUBLANG_ITALIAN_SWISS: return "it_CH";
Packit Service a721b1
	  }
Packit Service a721b1
	return "it";
Packit Service a721b1
      case LANG_JAPANESE: return "ja_JP";
Packit Service a721b1
      case LANG_KANNADA: return "kn_IN";
Packit Service a721b1
      case LANG_KANURI: return "kr_NG";
Packit Service a721b1
      case LANG_KASHMIRI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "ks_PK";
Packit Service a721b1
	  case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ks";
Packit Service a721b1
      case LANG_KAZAK: return "kk_KZ";
Packit Service a721b1
      case LANG_KONKANI:
Packit Service a721b1
	/* FIXME: Adjust this when such locales appear on Unix.  */
Packit Service a721b1
	return "kok_IN";
Packit Service a721b1
      case LANG_KOREAN: return "ko_KR";
Packit Service a721b1
      case LANG_KYRGYZ: return "ky_KG";
Packit Service a721b1
      case LANG_LAO: return "lo_LA";
Packit Service a721b1
      case LANG_LATIN: return "la_VA";
Packit Service a721b1
      case LANG_LATVIAN: return "lv_LV";
Packit Service a721b1
      case LANG_LITHUANIAN: return "lt_LT";
Packit Service a721b1
      case LANG_MACEDONIAN: return "mk_MK";
Packit Service a721b1
      case LANG_MALAY:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
Packit Service a721b1
	  case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ms";
Packit Service a721b1
      case LANG_MALAYALAM: return "ml_IN";
Packit Service a721b1
      case LANG_MALTESE: return "mt_MT";
Packit Service a721b1
      case LANG_MANIPURI:
Packit Service a721b1
	/* FIXME: Adjust this when such locales appear on Unix.  */
Packit Service a721b1
	return "mni_IN";
Packit Service a721b1
      case LANG_MARATHI: return "mr_IN";
Packit Service a721b1
      case LANG_MONGOLIAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "mn_MN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN".  */
Packit Service a721b1
      case LANG_NEPALI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "ne_NP";
Packit Service a721b1
	  case SUBLANG_NEPALI_INDIA: return "ne_IN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ne";
Packit Service a721b1
      case LANG_NORWEGIAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO";
Packit Service a721b1
	  case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
Packit Service a721b1
	  }
Packit Service a721b1
	return "no";
Packit Service a721b1
      case LANG_ORIYA: return "or_IN";
Packit Service a721b1
      case LANG_OROMO: return "om_ET";
Packit Service a721b1
      case LANG_PAPIAMENTU: return "pap_AN";
Packit Service a721b1
      case LANG_PASHTO:
Packit Service a721b1
	return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF".  */
Packit Service a721b1
      case LANG_POLISH: return "pl_PL";
Packit Service a721b1
      case LANG_PORTUGUESE:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_PORTUGUESE: return "pt_PT";
Packit Service a721b1
	  /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
Packit Service a721b1
	     Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
Packit Service a721b1
	  case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
Packit Service a721b1
	  }
Packit Service a721b1
	return "pt";
Packit Service a721b1
      case LANG_PUNJABI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
Packit Service a721b1
	  case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
Packit Service a721b1
	  }
Packit Service a721b1
	return "pa";
Packit Service a721b1
      case LANG_RHAETO_ROMANCE: return "rm_CH";
Packit Service a721b1
      case LANG_ROMANIAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
Packit Service a721b1
	  case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ro";
Packit Service a721b1
      case LANG_RUSSIAN:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "ru_RU";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD".  */
Packit Service a721b1
      case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
Packit Service a721b1
      case LANG_SANSKRIT: return "sa_IN";
Packit Service a721b1
      case LANG_SINDHI:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
Packit Service a721b1
	  case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF";
Packit Service a721b1
	  }
Packit Service a721b1
	return "sd";
Packit Service a721b1
      case LANG_SINHALESE: return "si_LK";
Packit Service a721b1
      case LANG_SLOVAK: return "sk_SK";
Packit Service a721b1
      case LANG_SLOVENIAN: return "sl_SI";
Packit Service a721b1
      case LANG_SOMALI: return "so_SO";
Packit Service a721b1
      case LANG_SORBIAN:
Packit Service a721b1
	/* FIXME: Adjust this when such locales appear on Unix.  */
Packit Service a721b1
	return "wen_DE";
Packit Service a721b1
      case LANG_SPANISH:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_SPANISH: return "es_ES";
Packit Service a721b1
	  case SUBLANG_SPANISH_MEXICAN: return "es_MX";
Packit Service a721b1
	  case SUBLANG_SPANISH_MODERN:
Packit Service a721b1
	    return "es_ES@modern";	/* not seen on Unix */
Packit Service a721b1
	  case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
Packit Service a721b1
	  case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
Packit Service a721b1
	  case SUBLANG_SPANISH_PANAMA: return "es_PA";
Packit Service a721b1
	  case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
Packit Service a721b1
	  case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
Packit Service a721b1
	  case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
Packit Service a721b1
	  case SUBLANG_SPANISH_PERU: return "es_PE";
Packit Service a721b1
	  case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
Packit Service a721b1
	  case SUBLANG_SPANISH_ECUADOR: return "es_EC";
Packit Service a721b1
	  case SUBLANG_SPANISH_CHILE: return "es_CL";
Packit Service a721b1
	  case SUBLANG_SPANISH_URUGUAY: return "es_UY";
Packit Service a721b1
	  case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
Packit Service a721b1
	  case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
Packit Service a721b1
	  case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
Packit Service a721b1
	  case SUBLANG_SPANISH_HONDURAS: return "es_HN";
Packit Service a721b1
	  case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
Packit Service a721b1
	  case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
Packit Service a721b1
	  }
Packit Service a721b1
	return "es";
Packit Service a721b1
      case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
Packit Service a721b1
      case LANG_SWAHILI: return "sw_KE";
Packit Service a721b1
      case LANG_SWEDISH:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "sv_SE";
Packit Service a721b1
	  case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
Packit Service a721b1
	  }
Packit Service a721b1
	return "sv";
Packit Service a721b1
      case LANG_SYRIAC: return "syr_TR"; /* An extinct language.  */
Packit Service a721b1
      case LANG_TAGALOG: return "tl_PH";
Packit Service a721b1
      case LANG_TAJIK: return "tg_TJ";
Packit Service a721b1
      case LANG_TAMAZIGHT:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  /* FIXME: Adjust this when Tamazight locales appear on Unix.  */
Packit Service a721b1
	  case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
Packit Service a721b1
	  case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ber_MA";
Packit Service a721b1
      case LANG_TAMIL:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_DEFAULT: return "ta_IN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG".  */
Packit Service a721b1
      case LANG_TATAR: return "tt_RU";
Packit Service a721b1
      case LANG_TELUGU: return "te_IN";
Packit Service a721b1
      case LANG_THAI: return "th_TH";
Packit Service a721b1
      case LANG_TIBETAN: return "bo_CN";
Packit Service a721b1
      case LANG_TIGRINYA:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
Packit Service a721b1
	  case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ti";
Packit Service a721b1
      case LANG_TSONGA: return "ts_ZA";
Packit Service a721b1
      case LANG_TSWANA: return "tn_BW";
Packit Service a721b1
      case LANG_TURKISH: return "tr_TR";
Packit Service a721b1
      case LANG_TURKMEN: return "tk_TM";
Packit Service a721b1
      case LANG_UKRAINIAN: return "uk_UA";
Packit Service a721b1
      case LANG_URDU:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_URDU_PAKISTAN: return "ur_PK";
Packit Service a721b1
	  case SUBLANG_URDU_INDIA: return "ur_IN";
Packit Service a721b1
	  }
Packit Service a721b1
	return "ur";
Packit Service a721b1
      case LANG_UZBEK:
Packit Service a721b1
	switch (sub)
Packit Service a721b1
	  {
Packit Service a721b1
	  case SUBLANG_UZBEK_LATIN: return "uz_UZ";
Packit Service a721b1
	  case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
Packit Service a721b1
	  }
Packit Service a721b1
	return "uz";
Packit Service a721b1
      case LANG_VENDA: return "ve_ZA";
Packit Service a721b1
      case LANG_VIETNAMESE: return "vi_VN";
Packit Service a721b1
      case LANG_WELSH: return "cy_GB";
Packit Service a721b1
      case LANG_XHOSA: return "xh_ZA";
Packit Service a721b1
      case LANG_YI: return "sit_CN";
Packit Service a721b1
      case LANG_YIDDISH: return "yi_IL";
Packit Service a721b1
      case LANG_YORUBA: return "yo_NG";
Packit Service a721b1
      case LANG_ZULU: return "zu_ZA";
Packit Service a721b1
      default: return "C";
Packit Service a721b1
      }
Packit Service a721b1
  }
Packit Service a721b1
# endif
Packit Service a721b1
#endif
Packit Service a721b1
}
Packit Service a721b1
Packit Service a721b1
const char *
Packit Service a721b1
gl_locale_name (int category, const char *categoryname)
Packit Service a721b1
{
Packit Service a721b1
  const char *retval;
Packit Service a721b1
Packit Service a721b1
  retval = gl_locale_name_posix (category, categoryname);
Packit Service a721b1
  if (retval != NULL)
Packit Service a721b1
    return retval;
Packit Service a721b1
Packit Service a721b1
  return gl_locale_name_default ();
Packit Service a721b1
}