1 /*
   2  * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 /*
  27  * Mappings from partial locale names to full locale names
  28  */
  29  static char *locale_aliases[] = {
  30     "ar", "ar_EG",
  31     "be", "be_BY",
  32     "bg", "bg_BG",
  33     "br", "br_FR",
  34     "ca", "ca_ES",
  35     "cs", "cs_CZ",
  36     "cz", "cs_CZ",
  37     "da", "da_DK",
  38     "de", "de_DE",
  39     "el", "el_GR",
  40     "en", "en_US",
  41     "eo", "eo",    /* no country for Esperanto */
  42     "es", "es_ES",
  43     "et", "et_EE",
  44     "eu", "eu_ES",
  45     "fi", "fi_FI",
  46     "fr", "fr_FR",
  47     "ga", "ga_IE",
  48     "gl", "gl_ES",
  49     "he", "iw_IL",
  50     "hr", "hr_HR",
  51 #ifdef __linux__
  52     "hs", "en_US", // used on Linux, not clear what it stands for
  53 #endif
  54     "hu", "hu_HU",
  55     "id", "in_ID",
  56     "in", "in_ID",
  57     "is", "is_IS",
  58     "it", "it_IT",
  59     "iw", "iw_IL",
  60     "ja", "ja_JP",
  61     "kl", "kl_GL",
  62     "ko", "ko_KR",
  63     "lt", "lt_LT",
  64     "lv", "lv_LV",
  65     "mk", "mk_MK",
  66     "nl", "nl_NL",
  67     "no", "no_NO",
  68     "pl", "pl_PL",
  69     "pt", "pt_PT",
  70     "ro", "ro_RO",
  71     "ru", "ru_RU",
  72     "se", "se_NO",
  73     "sk", "sk_SK",
  74     "sl", "sl_SI",
  75     "sq", "sq_AL",
  76     "sr", "sr_CS",
  77     "su", "fi_FI",
  78     "sv", "sv_SE",
  79     "th", "th_TH",
  80     "tr", "tr_TR",
  81 #ifdef __linux__
  82     "ua", "en_US", // used on Linux, not clear what it stands for
  83 #endif
  84     "uk", "uk_UA",
  85     "vi", "vi_VN",
  86     "wa", "wa_BE",
  87     "zh", "zh_CN",
  88 #ifdef __linux__
  89     "bokmal", "nb_NO",
  90     "bokm\xE5l", "nb_NO",
  91     "catalan", "ca_ES",
  92     "croatian", "hr_HR",
  93     "czech", "cs_CZ",
  94     "danish", "da_DK",
  95     "dansk", "da_DK",
  96     "deutsch", "de_DE",
  97     "dutch", "nl_NL",
  98     "eesti", "et_EE",
  99     "estonian", "et_EE",
 100     "finnish", "fi_FI",
 101     "fran\xE7\x61is", "fr_FR",
 102     "french", "fr_FR",
 103     "galego", "gl_ES",
 104     "galician", "gl_ES",
 105     "german", "de_DE",
 106     "greek", "el_GR",
 107     "hebrew", "iw_IL",
 108     "hrvatski", "hr_HR",
 109     "hungarian", "hu_HU",
 110     "icelandic", "is_IS",
 111     "italian", "it_IT",
 112     "japanese", "ja_JP",
 113     "korean", "ko_KR",
 114     "lithuanian", "lt_LT",
 115     "norwegian", "no_NO",
 116     "nynorsk", "nn_NO",
 117     "polish", "pl_PL",
 118     "portuguese", "pt_PT",
 119     "romanian", "ro_RO",
 120     "russian", "ru_RU",
 121     "slovak", "sk_SK",
 122     "slovene", "sl_SI",
 123     "slovenian", "sl_SI",
 124     "spanish", "es_ES",
 125     "swedish", "sv_SE",
 126     "thai", "th_TH",
 127     "turkish", "tr_TR",
 128 #else
 129     "big5", "zh_TW.Big5",
 130     "chinese", "zh_CN",
 131     "iso_8859_1", "en_US.ISO8859-1",
 132     "iso_8859_15", "en_US.ISO8859-15",
 133     "japanese", "ja_JP",
 134     "no_NY", "no_NO@nynorsk",
 135     "sr_SP", "sr_YU",
 136     "tchinese", "zh_TW",
 137 #endif
 138 #ifdef MACOSX
 139     "sr-Latn", "sr_CS",   // Mappings as done by old Apple JRS code
 140     "tk", "tk-Cyrl",
 141     "tt-Latn", "tt-Cyrl",
 142     "uz", "uz_UZ",
 143     "uz-Arab", "uz_UZ",
 144     "uz-Latn", "uz_UZ",
 145     "zh-Hans", "zh_CN",
 146     "zh-Hant", "zh_TW",
 147 #endif
 148     "", "",
 149  };
 150 
 151 /*
 152  * Linux/Solaris language string to ISO639 string mapping table.
 153  */
 154 static char *language_names[] = {
 155     "C", "en",
 156     "POSIX", "en",
 157     "cz", "cs",
 158     "he", "iw",
 159 #ifdef __linux__
 160     "hs", "en", // used on Linux, not clear what it stands for
 161 #endif
 162     "id", "in",
 163     "sh", "sr", // sh is deprecated
 164     "su", "fi",
 165 #ifdef __linux__
 166     "ua", "en", // used on Linux, not clear what it stands for
 167     "catalan", "ca",
 168     "croatian", "hr",
 169     "czech", "cs",
 170     "danish", "da",
 171     "dansk", "da",
 172     "deutsch", "de",
 173     "dutch", "nl",
 174     "finnish", "fi",
 175     "fran\xE7\x61is", "fr",
 176     "french", "fr",
 177     "german", "de",
 178     "greek", "el",
 179     "hebrew", "he",
 180     "hrvatski", "hr",
 181     "hungarian", "hu",
 182     "icelandic", "is",
 183     "italian", "it",
 184     "japanese", "ja",
 185     "norwegian", "no",
 186     "polish", "pl",
 187     "portuguese", "pt",
 188     "romanian", "ro",
 189     "russian", "ru",
 190     "slovak", "sk",
 191     "slovene", "sl",
 192     "slovenian", "sl",
 193     "spanish", "es",
 194     "swedish", "sv",
 195     "turkish", "tr",
 196 #else
 197     "chinese", "zh",
 198     "japanese", "ja",
 199     "korean", "ko",
 200 #endif
 201     "", "",
 202 };
 203 
 204 /*
 205  * Linux/Solaris script string to Java script name mapping table.
 206  */
 207 static char *script_names[] = {
 208 #ifdef __linux__
 209     "cyrillic", "Cyrl",
 210     "devanagari", "Deva",
 211     "iqtelif", "Latn",
 212     "latin", "Latn",
 213 #endif
 214     "Hans", "Hans",
 215     "Hant", "Hant",
 216     "Latn", "Latn",
 217     "Cyrl", "Cyrl",
 218     "Arab", "Arab",
 219     "", "",
 220 };
 221 
 222 /*
 223  * Linux/Solaris country string to ISO3166 string mapping table.
 224  */
 225 static char *country_names[] = {
 226 #ifdef __linux__
 227     "RN", "US", // used on Linux, not clear what it stands for
 228 #endif
 229     "YU", "CS", // YU has been removed from ISO 3166
 230     "", "",
 231 };
 232 
 233 /*
 234  * Linux/Solaris variant string to Java variant name mapping table.
 235  */
 236 static char *variant_names[] = {
 237     "nynorsk", "NY",
 238     "", "",
 239 };