1#[rustfmt::skip]
2static TABLE: &[(u16, Language, &str, &str)] = &[
3 (0x0000, Language::Unknown, "Unknown", "Unknown"),
4 (0x0436, Language::Afrikaans_SouthAfrica, "Afrikaans", "South Africa"),
5 (0x041C, Language::Albanian_Albania, "Albanian", "Albania"),
6 (0x0484, Language::Alsatian_France, "Alsatian", "France"),
7 (0x045E, Language::Amharic_Ethiopia, "Amharic", "Ethiopia"),
8 (0x1401, Language::Arabic_Algeria, "Arabic", "Algeria"),
9 (0x3C01, Language::Arabic_Bahrain, "Arabic", "Bahrain"),
10 (0x0C01, Language::Arabic_Egypt, "Arabic", "Egypt"),
11 (0x0801, Language::Arabic_Iraq, "Arabic", "Iraq"),
12 (0x2C01, Language::Arabic_Jordan, "Arabic", "Jordan"),
13 (0x3401, Language::Arabic_Kuwait, "Arabic", "Kuwait"),
14 (0x3001, Language::Arabic_Lebanon, "Arabic", "Lebanon"),
15 (0x1001, Language::Arabic_Libya, "Arabic", "Libya"),
16 (0x1801, Language::Arabic_Morocco, "Arabic", "Morocco"),
17 (0x2001, Language::Arabic_Oman, "Arabic", "Oman"),
18 (0x4001, Language::Arabic_Qatar, "Arabic", "Qatar"),
19 (0x0401, Language::Arabic_SaudiArabia, "Arabic", "Saudi Arabia"),
20 (0x2801, Language::Arabic_Syria, "Arabic", "Syria"),
21 (0x1C01, Language::Arabic_Tunisia, "Arabic", "Tunisia"),
22 (0x3801, Language::Arabic_UAE, "Arabic", "U.A.E."),
23 (0x2401, Language::Arabic_Yemen, "Arabic", "Yemen"),
24 (0x042B, Language::Armenian_Armenia, "Armenian", "Armenia"),
25 (0x044D, Language::Assamese_India, "Assamese", "India"),
26 (0x082C, Language::Azeri_Cyrillic_Azerbaijan, "Azeri (Cyrillic)", "Azerbaijan"),
27 (0x042C, Language::Azeri_Latin_Azerbaijan, "Azeri (Latin)", "Azerbaijan"),
28 (0x046D, Language::Bashkir_Russia, "Bashkir", "Russia"),
29 (0x042D, Language::Basque_Basque, "Basque", "Basque"),
30 (0x0423, Language::Belarusian_Belarus, "Belarusian", "Belarus"),
31 (0x0845, Language::Bengali_Bangladesh, "Bengali", "Bangladesh"),
32 (0x0445, Language::Bengali_India, "Bengali", "India"),
33 (0x201A, Language::Bosnian_Cyrillic_BosniaAndHerzegovina, "Bosnian (Cyrillic)", "Bosnia and Herzegovina"),
34 (0x141A, Language::Bosnian_Latin_BosniaAndHerzegovina, "Bosnian (Latin)", "Bosnia and Herzegovina"),
35 (0x047E, Language::Breton_France, "Breton", "France"),
36 (0x0402, Language::Bulgarian_Bulgaria, "Bulgarian", "Bulgaria"),
37 (0x0403, Language::Catalan_Catalan, "Catalan", "Catalan"),
38 (0x0C04, Language::Chinese_HongKongSAR, "Chinese", "Hong Kong S.A.R."),
39 (0x1404, Language::Chinese_MacaoSAR, "Chinese", "Macao S.A.R."),
40 (0x0804, Language::Chinese_PeoplesRepublicOfChina, "Chinese", "People's Republic of China"),
41 (0x1004, Language::Chinese_Singapore, "Chinese", "Singapore"),
42 (0x0404, Language::Chinese_Taiwan, "Chinese", "Taiwan"),
43 (0x0483, Language::Corsican_France, "Corsican", "France"),
44 (0x041A, Language::Croatian_Croatia, "Croatian", "Croatia"),
45 (0x101A, Language::Croatian_Latin_BosniaAndHerzegovina, "Croatian (Latin)", "Bosnia and Herzegovina"),
46 (0x0405, Language::Czech_CzechRepublic, "Czech", "Czech Republic"),
47 (0x0406, Language::Danish_Denmark, "Danish", "Denmark"),
48 (0x048C, Language::Dari_Afghanistan, "Dari", "Afghanistan"),
49 (0x0465, Language::Divehi_Maldives, "Divehi", "Maldives"),
50 (0x0813, Language::Dutch_Belgium, "Dutch", "Belgium"),
51 (0x0413, Language::Dutch_Netherlands, "Dutch", "Netherlands"),
52 (0x0C09, Language::English_Australia, "English", "Australia"),
53 (0x2809, Language::English_Belize, "English", "Belize"),
54 (0x1009, Language::English_Canada, "English", "Canada"),
55 (0x2409, Language::English_Caribbean, "English", "Caribbean"),
56 (0x4009, Language::English_India, "English", "India"),
57 (0x1809, Language::English_Ireland, "English", "Ireland"),
58 (0x2009, Language::English_Jamaica, "English", "Jamaica"),
59 (0x4409, Language::English_Malaysia, "English", "Malaysia"),
60 (0x1409, Language::English_NewZealand, "English", "New Zealand"),
61 (0x3409, Language::English_RepublicOfThePhilippines, "English", "Republic of the Philippines"),
62 (0x4809, Language::English_Singapore, "English", "Singapore"),
63 (0x1C09, Language::English_SouthAfrica, "English", "South Africa"),
64 (0x2C09, Language::English_TrinidadAndTobago, "English", "Trinidad and Tobago"),
65 (0x0809, Language::English_UnitedKingdom, "English", "United Kingdom"),
66 (0x0409, Language::English_UnitedStates, "English", "United States"),
67 (0x3009, Language::English_Zimbabwe, "English", "Zimbabwe"),
68 (0x0425, Language::Estonian_Estonia, "Estonian", "Estonia"),
69 (0x0438, Language::Faroese_FaroeIslands, "Faroese", "Faroe Islands"),
70 (0x0464, Language::Filipino_Philippines, "Filipino", "Philippines"),
71 (0x040B, Language::Finnish_Finland, "Finnish", "Finland"),
72 (0x080C, Language::French_Belgium, "French", "Belgium"),
73 (0x0C0C, Language::French_Canada, "French", "Canada"),
74 (0x040C, Language::French_France, "French", "France"),
75 (0x140c, Language::French_Luxembourg, "French", "Luxembourg"),
76 (0x180C, Language::French_PrincipalityOfMonaco, "French", "Principality of Monaco"),
77 (0x100C, Language::French_Switzerland, "French", "Switzerland"),
78 (0x0462, Language::Frisian_Netherlands, "Frisian", "Netherlands"),
79 (0x0456, Language::Galician_Galician, "Galician", "Galician"),
80 (0x0437, Language::Georgian_Georgia, "Georgian", "Georgia"),
81 (0x0C07, Language::German_Austria, "German", "Austria"),
82 (0x0407, Language::German_Germany, "German", "Germany"),
83 (0x1407, Language::German_Liechtenstein, "German", "Liechtenstein"),
84 (0x1007, Language::German_Luxembourg, "German", "Luxembourg"),
85 (0x0807, Language::German_Switzerland, "German", "Switzerland"),
86 (0x0408, Language::Greek_Greece, "Greek", "Greece"),
87 (0x046F, Language::Greenlandic_Greenland, "Greenlandic", "Greenland"),
88 (0x0447, Language::Gujarati_India, "Gujarati", "India"),
89 (0x0468, Language::Hausa_Latin_Nigeria, "Hausa (Latin)", "Nigeria"),
90 (0x040D, Language::Hebrew_Israel, "Hebrew", "Israel"),
91 (0x0439, Language::Hindi_India, "Hindi", "India"),
92 (0x040E, Language::Hungarian_Hungary, "Hungarian", "Hungary"),
93 (0x040F, Language::Icelandic_Iceland, "Icelandic", "Iceland"),
94 (0x0470, Language::Igbo_Nigeria, "Igbo", "Nigeria"),
95 (0x0421, Language::Indonesian_Indonesia, "Indonesian", "Indonesia"),
96 (0x045D, Language::Inuktitut_Canada, "Inuktitut", "Canada"),
97 (0x085D, Language::Inuktitut_Latin_Canada, "Inuktitut (Latin)", "Canada"),
98 (0x083C, Language::Irish_Ireland, "Irish", "Ireland"),
99 (0x0434, Language::isiXhosa_SouthAfrica, "isiXhosa", "South Africa"),
100 (0x0435, Language::isiZulu_SouthAfrica, "isiZulu", "South Africa"),
101 (0x0410, Language::Italian_Italy, "Italian", "Italy"),
102 (0x0810, Language::Italian_Switzerland, "Italian", "Switzerland"),
103 (0x0411, Language::Japanese_Japan, "Japanese", "Japan"),
104 (0x044B, Language::Kannada_India, "Kannada", "India"),
105 (0x043F, Language::Kazakh_Kazakhstan, "Kazakh", "Kazakhstan"),
106 (0x0453, Language::Khmer_Cambodia, "Khmer", "Cambodia"),
107 (0x0486, Language::Kiche_Guatemala, "K'iche", "Guatemala"),
108 (0x0487, Language::Kinyarwanda_Rwanda, "Kinyarwanda", "Rwanda"),
109 (0x0441, Language::Kiswahili_Kenya, "Kiswahili", "Kenya"),
110 (0x0457, Language::Konkani_India, "Konkani", "India"),
111 (0x0412, Language::Korean_Korea, "Korean", "Korea"),
112 (0x0440, Language::Kyrgyz_Kyrgyzstan, "Kyrgyz", "Kyrgyzstan"),
113 (0x0454, Language::Lao_LaoPDR, "Lao", "Lao P.D.R."),
114 (0x0426, Language::Latvian_Latvia, "Latvian", "Latvia"),
115 (0x0427, Language::Lithuanian_Lithuania, "Lithuanian", "Lithuania"),
116 (0x082E, Language::LowerSorbian_Germany, "Lower Sorbian", "Germany"),
117 (0x046E, Language::Luxembourgish_Luxembourg, "Luxembourgish", "Luxembourg"),
118 (0x042F, Language::Macedonian_NorthMacedonia, "Macedonian", "North Macedonia"),
119 (0x083E, Language::Malay_BruneiDarussalam, "Malay", "Brunei Darussalam"),
120 (0x043E, Language::Malay_Malaysia, "Malay", "Malaysia"),
121 (0x044C, Language::Malayalam_India, "Malayalam", "India"),
122 (0x043A, Language::Maltese_Malta, "Maltese", "Malta"),
123 (0x0481, Language::Maori_NewZealand, "Maori", "New Zealand"),
124 (0x047A, Language::Mapudungun_Chile, "Mapudungun", "Chile"),
125 (0x044E, Language::Marathi_India, "Marathi", "India"),
126 (0x047C, Language::Mohawk_Mohawk, "Mohawk", "Mohawk"),
127 (0x0450, Language::Mongolian_Cyrillic_Mongolia, "Mongolian (Cyrillic)", "Mongolia"),
128 (0x0850, Language::Mongolian_Traditional_PeoplesRepublicOfChina, "Mongolian (Traditional)", "People's Republic of China"),
129 (0x0461, Language::Nepali_Nepal, "Nepali", "Nepal"),
130 (0x0414, Language::Norwegian_Bokmal_Norway, "Norwegian (Bokmal)", "Norway"),
131 (0x0814, Language::Norwegian_Nynorsk_Norway, "Norwegian (Nynorsk)", "Norway"),
132 (0x0482, Language::Occitan_France, "Occitan", "France"),
133 (0x0448, Language::Odia_India, "Odia (formerly Oriya)", "India"),
134 (0x0463, Language::Pashto_Afghanistan, "Pashto", "Afghanistan"),
135 (0x0415, Language::Polish_Poland, "Polish", "Poland"),
136 (0x0416, Language::Portuguese_Brazil, "Portuguese", "Brazil"),
137 (0x0816, Language::Portuguese_Portugal, "Portuguese", "Portugal"),
138 (0x0446, Language::Punjabi_India, "Punjabi", "India"),
139 (0x046B, Language::Quechua_Bolivia, "Quechua", "Bolivia"),
140 (0x086B, Language::Quechua_Ecuador, "Quechua", "Ecuador"),
141 (0x0C6B, Language::Quechua_Peru, "Quechua", "Peru"),
142 (0x0418, Language::Romanian_Romania, "Romanian", "Romania"),
143 (0x0417, Language::Romansh_Switzerland, "Romansh", "Switzerland"),
144 (0x0419, Language::Russian_Russia, "Russian", "Russia"),
145 (0x243B, Language::Sami_Inari_Finland, "Sami (Inari)", "Finland"),
146 (0x103B, Language::Sami_Lule_Norway, "Sami (Lule)", "Norway"),
147 (0x143B, Language::Sami_Lule_Sweden, "Sami (Lule)", "Sweden"),
148 (0x0C3B, Language::Sami_Northern_Finland, "Sami (Northern)", "Finland"),
149 (0x043B, Language::Sami_Northern_Norway, "Sami (Northern)", "Norway"),
150 (0x083B, Language::Sami_Northern_Sweden, "Sami (Northern)", "Sweden"),
151 (0x203B, Language::Sami_Skolt_Finland, "Sami (Skolt)", "Finland"),
152 (0x183B, Language::Sami_Southern_Norway, "Sami (Southern)", "Norway"),
153 (0x1C3B, Language::Sami_Southern_Sweden, "Sami (Southern)", "Sweden"),
154 (0x044F, Language::Sanskrit_India, "Sanskrit", "India"),
155 (0x1C1A, Language::Serbian_Cyrillic_BosniaAndHerzegovina, "Serbian (Cyrillic)", "Bosnia and Herzegovina"),
156 (0x0C1A, Language::Serbian_Cyrillic_Serbia, "Serbian (Cyrillic)", "Serbia"),
157 (0x181A, Language::Serbian_Latin_BosniaAndHerzegovina, "Serbian (Latin)", "Bosnia and Herzegovina"),
158 (0x081A, Language::Serbian_Latin_Serbia, "Serbian (Latin)", "Serbia"),
159 (0x046C, Language::SesothoSaLeboa_SouthAfrica, "Sesotho sa Leboa", "South Africa"),
160 (0x0432, Language::Setswana_SouthAfrica, "Setswana", "South Africa"),
161 (0x045B, Language::Sinhala_SriLanka, "Sinhala", "Sri Lanka"),
162 (0x041B, Language::Slovak_Slovakia, "Slovak", "Slovakia"),
163 (0x0424, Language::Slovenian_Slovenia, "Slovenian", "Slovenia"),
164 (0x2C0A, Language::Spanish_Argentina, "Spanish", "Argentina"),
165 (0x400A, Language::Spanish_Bolivia, "Spanish", "Bolivia"),
166 (0x340A, Language::Spanish_Chile, "Spanish", "Chile"),
167 (0x240A, Language::Spanish_Colombia, "Spanish", "Colombia"),
168 (0x140A, Language::Spanish_CostaRica, "Spanish", "Costa Rica"),
169 (0x1C0A, Language::Spanish_DominicanRepublic, "Spanish", "Dominican Republic"),
170 (0x300A, Language::Spanish_Ecuador, "Spanish", "Ecuador"),
171 (0x440A, Language::Spanish_ElSalvador, "Spanish", "El Salvador"),
172 (0x100A, Language::Spanish_Guatemala, "Spanish", "Guatemala"),
173 (0x480A, Language::Spanish_Honduras, "Spanish", "Honduras"),
174 (0x080A, Language::Spanish_Mexico, "Spanish", "Mexico"),
175 (0x4C0A, Language::Spanish_Nicaragua, "Spanish", "Nicaragua"),
176 (0x180A, Language::Spanish_Panama, "Spanish", "Panama"),
177 (0x3C0A, Language::Spanish_Paraguay, "Spanish", "Paraguay"),
178 (0x280A, Language::Spanish_Peru, "Spanish", "Peru"),
179 (0x500A, Language::Spanish_PuertoRico, "Spanish", "Puerto Rico"),
180 (0x0C0A, Language::Spanish_ModernSort_Spain, "Spanish (Modern Sort)", "Spain"),
181 (0x040A, Language::Spanish_TraditionalSort_Spain, "Spanish (Traditional Sort)", "Spain"),
182 (0x540A, Language::Spanish_UnitedStates, "Spanish", "United States"),
183 (0x380A, Language::Spanish_Uruguay, "Spanish", "Uruguay"),
184 (0x200A, Language::Spanish_Venezuela, "Spanish", "Venezuela"),
185 (0x081D, Language::Swedish_Finland, "Swedish", "Finland"),
186 (0x041D, Language::Swedish_Sweden, "Swedish", "Sweden"),
187 (0x045A, Language::Syriac_Syria, "Syriac", "Syria"),
188 (0x0428, Language::Tajik_Cyrillic_Tajikistan, "Tajik (Cyrillic)", "Tajikistan"),
189 (0x085F, Language::Tamazight_Latin_Algeria, "Tamazight (Latin)", "Algeria"),
190 (0x0449, Language::Tamil_India, "Tamil", "India"),
191 (0x0444, Language::Tatar_Russia, "Tatar", "Russia"),
192 (0x044A, Language::Telugu_India, "Telugu", "India"),
193 (0x041E, Language::Thai_Thailand, "Thai", "Thailand"),
194 (0x0451, Language::Tibetan_PRC, "Tibetan", "PRC"),
195 (0x041F, Language::Turkish_Turkey, "Turkish", "Turkey"),
196 (0x0442, Language::Turkmen_Turkmenistan, "Turkmen", "Turkmenistan"),
197 (0x0480, Language::Uighur_PRC, "Uighur", "PRC"),
198 (0x0422, Language::Ukrainian_Ukraine, "Ukrainian", "Ukraine"),
199 (0x042E, Language::UpperSorbian_Germany, "Upper Sorbian", "Germany"),
200 (0x0420, Language::Urdu_IslamicRepublicOfPakistan, "Urdu", "Islamic Republic of Pakistan"),
201 (0x0843, Language::Uzbek_Cyrillic_Uzbekistan, "Uzbek (Cyrillic)", "Uzbekistan"),
202 (0x0443, Language::Uzbek_Latin_Uzbekistan, "Uzbek (Latin)", "Uzbekistan"),
203 (0x042A, Language::Vietnamese_Vietnam, "Vietnamese", "Vietnam"),
204 (0x0452, Language::Welsh_UnitedKingdom, "Welsh", "United Kingdom"),
205 (0x0488, Language::Wolof_Senegal, "Wolof", "Senegal"),
206 (0x0485, Language::Yakut_Russia, "Yakut", "Russia"),
207 (0x0478, Language::Yi_PRC, "Yi", "PRC"),
208 (0x046A, Language::Yoruba_Nigeria, "Yoruba", "Nigeria"),
209];
210
211/// A [`Name`](crate::name::Name) language.
212///
213/// Consists of Language + Region pairs.
214///
215/// <https://learn.microsoft.com/en-us/typography/opentype/spec/name#windows-language-ids>
216#[allow(missing_docs)]
217#[allow(non_camel_case_types)]
218#[derive(Clone, Copy, PartialEq, Eq, Debug)]
219pub enum Language {
220 Unknown = 0,
221 Afrikaans_SouthAfrica,
222 Albanian_Albania,
223 Alsatian_France,
224 Amharic_Ethiopia,
225 Arabic_Algeria,
226 Arabic_Bahrain,
227 Arabic_Egypt,
228 Arabic_Iraq,
229 Arabic_Jordan,
230 Arabic_Kuwait,
231 Arabic_Lebanon,
232 Arabic_Libya,
233 Arabic_Morocco,
234 Arabic_Oman,
235 Arabic_Qatar,
236 Arabic_SaudiArabia,
237 Arabic_Syria,
238 Arabic_Tunisia,
239 Arabic_UAE,
240 Arabic_Yemen,
241 Armenian_Armenia,
242 Assamese_India,
243 Azeri_Cyrillic_Azerbaijan,
244 Azeri_Latin_Azerbaijan,
245 Bashkir_Russia,
246 Basque_Basque,
247 Belarusian_Belarus,
248 Bengali_Bangladesh,
249 Bengali_India,
250 Bosnian_Cyrillic_BosniaAndHerzegovina,
251 Bosnian_Latin_BosniaAndHerzegovina,
252 Breton_France,
253 Bulgarian_Bulgaria,
254 Catalan_Catalan,
255 Chinese_HongKongSAR,
256 Chinese_MacaoSAR,
257 Chinese_PeoplesRepublicOfChina,
258 Chinese_Singapore,
259 Chinese_Taiwan,
260 Corsican_France,
261 Croatian_Croatia,
262 Croatian_Latin_BosniaAndHerzegovina,
263 Czech_CzechRepublic,
264 Danish_Denmark,
265 Dari_Afghanistan,
266 Divehi_Maldives,
267 Dutch_Belgium,
268 Dutch_Netherlands,
269 English_Australia,
270 English_Belize,
271 English_Canada,
272 English_Caribbean,
273 English_India,
274 English_Ireland,
275 English_Jamaica,
276 English_Malaysia,
277 English_NewZealand,
278 English_RepublicOfThePhilippines,
279 English_Singapore,
280 English_SouthAfrica,
281 English_TrinidadAndTobago,
282 English_UnitedKingdom,
283 English_UnitedStates,
284 English_Zimbabwe,
285 Estonian_Estonia,
286 Faroese_FaroeIslands,
287 Filipino_Philippines,
288 Finnish_Finland,
289 French_Belgium,
290 French_Canada,
291 French_France,
292 French_Luxembourg,
293 French_PrincipalityOfMonaco,
294 French_Switzerland,
295 Frisian_Netherlands,
296 Galician_Galician,
297 Georgian_Georgia,
298 German_Austria,
299 German_Germany,
300 German_Liechtenstein,
301 German_Luxembourg,
302 German_Switzerland,
303 Greek_Greece,
304 Greenlandic_Greenland,
305 Gujarati_India,
306 Hausa_Latin_Nigeria,
307 Hebrew_Israel,
308 Hindi_India,
309 Hungarian_Hungary,
310 Icelandic_Iceland,
311 Igbo_Nigeria,
312 Indonesian_Indonesia,
313 Inuktitut_Canada,
314 Inuktitut_Latin_Canada,
315 Irish_Ireland,
316 isiXhosa_SouthAfrica,
317 isiZulu_SouthAfrica,
318 Italian_Italy,
319 Italian_Switzerland,
320 Japanese_Japan,
321 Kannada_India,
322 Kazakh_Kazakhstan,
323 Khmer_Cambodia,
324 Kiche_Guatemala,
325 Kinyarwanda_Rwanda,
326 Kiswahili_Kenya,
327 Konkani_India,
328 Korean_Korea,
329 Kyrgyz_Kyrgyzstan,
330 Lao_LaoPDR,
331 Latvian_Latvia,
332 Lithuanian_Lithuania,
333 LowerSorbian_Germany,
334 Luxembourgish_Luxembourg,
335 Macedonian_NorthMacedonia,
336 Malay_BruneiDarussalam,
337 Malay_Malaysia,
338 Malayalam_India,
339 Maltese_Malta,
340 Maori_NewZealand,
341 Mapudungun_Chile,
342 Marathi_India,
343 Mohawk_Mohawk,
344 Mongolian_Cyrillic_Mongolia,
345 Mongolian_Traditional_PeoplesRepublicOfChina,
346 Nepali_Nepal,
347 Norwegian_Bokmal_Norway,
348 Norwegian_Nynorsk_Norway,
349 Occitan_France,
350 Odia_India,
351 Pashto_Afghanistan,
352 Polish_Poland,
353 Portuguese_Brazil,
354 Portuguese_Portugal,
355 Punjabi_India,
356 Quechua_Bolivia,
357 Quechua_Ecuador,
358 Quechua_Peru,
359 Romanian_Romania,
360 Romansh_Switzerland,
361 Russian_Russia,
362 Sami_Inari_Finland,
363 Sami_Lule_Norway,
364 Sami_Lule_Sweden,
365 Sami_Northern_Finland,
366 Sami_Northern_Norway,
367 Sami_Northern_Sweden,
368 Sami_Skolt_Finland,
369 Sami_Southern_Norway,
370 Sami_Southern_Sweden,
371 Sanskrit_India,
372 Serbian_Cyrillic_BosniaAndHerzegovina,
373 Serbian_Cyrillic_Serbia,
374 Serbian_Latin_BosniaAndHerzegovina,
375 Serbian_Latin_Serbia,
376 SesothoSaLeboa_SouthAfrica,
377 Setswana_SouthAfrica,
378 Sinhala_SriLanka,
379 Slovak_Slovakia,
380 Slovenian_Slovenia,
381 Spanish_Argentina,
382 Spanish_Bolivia,
383 Spanish_Chile,
384 Spanish_Colombia,
385 Spanish_CostaRica,
386 Spanish_DominicanRepublic,
387 Spanish_Ecuador,
388 Spanish_ElSalvador,
389 Spanish_Guatemala,
390 Spanish_Honduras,
391 Spanish_Mexico,
392 Spanish_Nicaragua,
393 Spanish_Panama,
394 Spanish_Paraguay,
395 Spanish_Peru,
396 Spanish_PuertoRico,
397 Spanish_ModernSort_Spain,
398 Spanish_TraditionalSort_Spain,
399 Spanish_UnitedStates,
400 Spanish_Uruguay,
401 Spanish_Venezuela,
402 Swedish_Finland,
403 Swedish_Sweden,
404 Syriac_Syria,
405 Tajik_Cyrillic_Tajikistan,
406 Tamazight_Latin_Algeria,
407 Tamil_India,
408 Tatar_Russia,
409 Telugu_India,
410 Thai_Thailand,
411 Tibetan_PRC,
412 Turkish_Turkey,
413 Turkmen_Turkmenistan,
414 Uighur_PRC,
415 Ukrainian_Ukraine,
416 UpperSorbian_Germany,
417 Urdu_IslamicRepublicOfPakistan,
418 Uzbek_Cyrillic_Uzbekistan,
419 Uzbek_Latin_Uzbekistan,
420 Vietnamese_Vietnam,
421 Welsh_UnitedKingdom,
422 Wolof_Senegal,
423 Yakut_Russia,
424 Yi_PRC,
425 Yoruba_Nigeria,
426}
427
428impl Language {
429 pub(crate) fn windows_language(id: u16) -> Self {
430 if let Some(index: usize) = TABLE.iter().position(|v: &(u16, Language, &str, &str)| v.0 == id) {
431 TABLE[index].1
432 } else {
433 Self::Unknown
434 }
435 }
436
437 /// Returns the primary language.
438 pub fn primary_language(&self) -> &'static str {
439 TABLE[*self as usize].2
440 }
441
442 /// Returns a language region.
443 pub fn region(&self) -> &'static str {
444 TABLE[*self as usize].3
445 }
446}
447
448impl core::fmt::Display for Language {
449 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
450 write!(f, "{} ({})", self.primary_language(), self.region())
451 }
452}
453