1 | /* |
2 | * Copyright (c) 1996, 2017, 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 | "" , "" , |
139 | }; |
140 | |
141 | /* |
142 | * Linux/Solaris language string to ISO639 string mapping table. |
143 | */ |
144 | static char *language_names[] = { |
145 | "C" , "en" , |
146 | "POSIX" , "en" , |
147 | "cz" , "cs" , |
148 | "he" , "iw" , |
149 | #ifdef __linux__ |
150 | "hs" , "en" , // used on Linux, not clear what it stands for |
151 | #endif |
152 | "id" , "in" , |
153 | "sh" , "sr" , // sh is deprecated |
154 | "su" , "fi" , |
155 | #ifdef __linux__ |
156 | "ua" , "en" , // used on Linux, not clear what it stands for |
157 | "catalan" , "ca" , |
158 | "croatian" , "hr" , |
159 | "czech" , "cs" , |
160 | "danish" , "da" , |
161 | "dansk" , "da" , |
162 | "deutsch" , "de" , |
163 | "dutch" , "nl" , |
164 | "finnish" , "fi" , |
165 | "fran\xE7\x61is" , "fr" , |
166 | "french" , "fr" , |
167 | "german" , "de" , |
168 | "greek" , "el" , |
169 | "hebrew" , "he" , |
170 | "hrvatski" , "hr" , |
171 | "hungarian" , "hu" , |
172 | "icelandic" , "is" , |
173 | "italian" , "it" , |
174 | "japanese" , "ja" , |
175 | "norwegian" , "no" , |
176 | "polish" , "pl" , |
177 | "portuguese" , "pt" , |
178 | "romanian" , "ro" , |
179 | "russian" , "ru" , |
180 | "slovak" , "sk" , |
181 | "slovene" , "sl" , |
182 | "slovenian" , "sl" , |
183 | "spanish" , "es" , |
184 | "swedish" , "sv" , |
185 | "turkish" , "tr" , |
186 | #else |
187 | "chinese" , "zh" , |
188 | "japanese" , "ja" , |
189 | "korean" , "ko" , |
190 | #endif |
191 | "" , "" , |
192 | }; |
193 | |
194 | /* |
195 | * Linux/Solaris script string to Java script name mapping table. |
196 | */ |
197 | static char *script_names[] = { |
198 | #ifdef __linux__ |
199 | "cyrillic" , "Cyrl" , |
200 | "devanagari" , "Deva" , |
201 | "iqtelif" , "Latn" , |
202 | "latin" , "Latn" , |
203 | #endif |
204 | "Arab" , "Arab" , |
205 | "Cyrl" , "Cyrl" , |
206 | "Deva" , "Deva" , |
207 | "Ethi" , "Ethi" , |
208 | "Hans" , "Hans" , |
209 | "Hant" , "Hant" , |
210 | "Latn" , "Latn" , |
211 | "Sund" , "Sund" , |
212 | "Syrc" , "Syrc" , |
213 | "Tfng" , "Tfng" , |
214 | "" , "" , |
215 | }; |
216 | |
217 | /* |
218 | * Linux/Solaris country string to ISO3166 string mapping table. |
219 | */ |
220 | static char *country_names[] = { |
221 | #ifdef __linux__ |
222 | "RN" , "US" , // used on Linux, not clear what it stands for |
223 | #endif |
224 | "YU" , "CS" , // YU has been removed from ISO 3166 |
225 | "" , "" , |
226 | }; |
227 | |
228 | /* |
229 | * Linux/Solaris variant string to Java variant name mapping table. |
230 | */ |
231 | static char *variant_names[] = { |
232 | "nynorsk" , "NY" , |
233 | "" , "" , |
234 | }; |
235 | |