Line data Source code
1 : /// Enum representing RFC 5646 language codes.
2 : ///
3 : /// This enum contains language codes following the RFC 5646 standard
4 : /// for identifying languages and language variants.
5 : enum Rfc5646Language {
6 : /// Afrikaans language.
7 : afrikaans('af'),
8 :
9 : /// Afrikaans as spoken in South Africa.
10 : afrikaansSouthAfrica('af-ZA'),
11 :
12 : /// Arabic language.
13 : arabic('ar'),
14 :
15 : /// Arabic as spoken in United Arab Emirates.
16 : arabicUae('ar-AE'),
17 :
18 : /// Arabic as spoken in Bahrain.
19 : arabicBahrain('ar-BH'),
20 :
21 : /// Arabic as spoken in Algeria.
22 : arabicAlgeria('ar-DZ'),
23 :
24 : /// Arabic as spoken in Egypt.
25 : arabicEgypt('ar-EG'),
26 :
27 : /// Arabic as spoken in Iraq.
28 : arabicIraq('ar-IQ'),
29 :
30 : /// Arabic as spoken in Jordan.
31 : arabicJordan('ar-JO'),
32 :
33 : /// Arabic as spoken in Kuwait.
34 : arabicKuwait('ar-KW'),
35 :
36 : /// Arabic as spoken in Lebanon.
37 : arabicLebanon('ar-LB'),
38 :
39 : /// Arabic as spoken in Libya.
40 : arabicLibya('ar-LY'),
41 :
42 : /// Arabic as spoken in Morocco.
43 : arabicMorocco('ar-MA'),
44 :
45 : /// Arabic as spoken in Oman.
46 : arabicOman('ar-OM'),
47 :
48 : /// Arabic as spoken in Qatar.
49 : arabicQatar('ar-QA'),
50 :
51 : /// Arabic as spoken in Saudi Arabia.
52 : arabicSaudiArabia('ar-SA'),
53 :
54 : /// Arabic as spoken in Syria.
55 : arabicSyria('ar-SY'),
56 :
57 : /// Arabic as spoken in Tunisia.
58 : arabicTunisia('ar-TN'),
59 :
60 : /// Arabic as spoken in Yemen.
61 : arabicYemen('ar-YE'),
62 :
63 : /// Azeri Latin script.
64 : azeriLatin('az'),
65 :
66 : /// Azeri Latin script as used in Azerbaijan.
67 : azeriLatinAzerbaijan('az-AZ'),
68 :
69 : /// Azeri Cyrillic script as used in Azerbaijan.
70 : azeriCyrillicAzerbaijan('az-Cyrl-AZ'),
71 :
72 : /// Belarusian language.
73 : belarusian('be'),
74 :
75 : /// Belarusian as spoken in Belarus.
76 : belarusianBelarus('be-BY'),
77 :
78 : /// Bulgarian language.
79 : bulgarian('bg'),
80 :
81 : /// Bulgarian as spoken in Bulgaria.
82 : bulgarianBulgaria('bg-BG'),
83 :
84 : /// Bosnian as spoken in Bosnia and Herzegovina.
85 : bosnianBosniaAndHerzegovina('bs-BA'),
86 :
87 : /// Catalan language.
88 : catalan('ca'),
89 :
90 : /// Catalan as spoken in Spain.
91 : catalanSpain('ca-ES'),
92 :
93 : /// Czech language.
94 : czech('cs'),
95 :
96 : /// Czech as spoken in Czech Republic.
97 : czechCzechRepublic('cs-CZ'),
98 :
99 : /// Welsh language.
100 : welsh('cy'),
101 :
102 : /// Welsh as spoken in United Kingdom.
103 : welshUnitedKingdom('cy-GB'),
104 :
105 : /// Danish language.
106 : danish('da'),
107 :
108 : /// Danish as spoken in Denmark.
109 : danishDenmark('da-DK'),
110 :
111 : /// German language.
112 : german('de'),
113 :
114 : /// German as spoken in Austria.
115 : germanAustria('de-AT'),
116 :
117 : /// German as spoken in Switzerland.
118 : germanSwitzerland('de-CH'),
119 :
120 : /// German as spoken in Germany.
121 : germanGermany('de-DE'),
122 :
123 : /// German as spoken in Liechtenstein.
124 : germanLiechtenstein('de-LI'),
125 :
126 : /// German as spoken in Luxembourg.
127 : germanLuxembourg('de-LU'),
128 :
129 : /// Divehi language.
130 : divehi('dv'),
131 :
132 : /// Divehi as spoken in Maldives.
133 : divehiMaldives('dv-MV'),
134 :
135 : /// Greek language.
136 : greek('el'),
137 :
138 : /// Greek as spoken in Greece.
139 : greekGreece('el-GR'),
140 :
141 : /// English language.
142 : english('en'),
143 :
144 : /// English as spoken in Australia.
145 : englishAustralia('en-AU'),
146 :
147 : /// English as spoken in Belize.
148 : englishBelize('en-BZ'),
149 :
150 : /// English as spoken in Canada.
151 : englishCanada('en-CA'),
152 :
153 : /// English as spoken in Caribbean.
154 : englishCaribbean('en-CB'),
155 :
156 : /// English as spoken in United Kingdom.
157 : englishUnitedKingdom('en-GB'),
158 :
159 : /// English as spoken in Ireland.
160 : englishIreland('en-IE'),
161 :
162 : /// English as spoken in Jamaica.
163 : englishJamaica('en-JM'),
164 :
165 : /// English as spoken in New Zealand.
166 : englishNewZealand('en-NZ'),
167 :
168 : /// English as spoken in Republic of the Philippines.
169 : englishRepublicOfThePhilippines('en-PH'),
170 :
171 : /// English as spoken in Trinidad and Tobago.
172 : englishTrinidadAndTobago('en-TT'),
173 :
174 : /// English as spoken in United States.
175 : englishUnitedStates('en-US'),
176 :
177 : /// English as spoken in South Africa.
178 : englishSouthAfrica('en-ZA'),
179 :
180 : /// English as spoken in Zimbabwe.
181 : englishZimbabwe('en-ZW'),
182 :
183 : /// Esperanto language.
184 : esperanto('eo'),
185 :
186 : /// Spanish language.
187 : spanish('es'),
188 :
189 : /// Spanish as spoken in Argentina.
190 : spanishArgentina('es-AR'),
191 :
192 : /// Spanish as spoken in Bolivia.
193 : spanishBolivia('es-BO'),
194 :
195 : /// Spanish as spoken in USA.
196 : spanishEua('es-US'),
197 :
198 : /// Spanish as spoken in Chile.
199 : spanishChile('es-CL'),
200 :
201 : /// Spanish as spoken in Colombia.
202 : spanishColombia('es-CO'),
203 :
204 : /// Spanish as spoken in Costa Rica.
205 : spanishCostaRica('es-CR'),
206 :
207 : /// Spanish as spoken in the Dominican Republic.
208 : spanishDominicanRepublic('es-DO'),
209 :
210 : /// Spanish as spoken in Ecuador.
211 : spanishEcuador('es-EC'),
212 :
213 : /// Spanish as spoken in Spain.
214 : spanishSpain('es-ES'),
215 :
216 : /// Spanish as spoken in Guatemala.
217 : spanishGuatemala('es-GT'),
218 :
219 : /// Spanish as spoken in Honduras.
220 : spanishHonduras('es-HN'),
221 :
222 : /// Spanish as spoken in Mexico.
223 : spanishMexico('es-MX'),
224 :
225 : /// Spanish as spoken in Nicaragua.
226 : spanishNicaragua('es-NI'),
227 :
228 : /// Spanish as spoken in Panama.
229 : spanishPanama('es-PA'),
230 :
231 : /// Spanish as spoken in Peru.
232 : spanishPeru('es-PE'),
233 :
234 : /// Spanish as spoken in Puerto Rico.
235 : spanishPuertoRico('es-PR'),
236 :
237 : /// Spanish as spoken in Paraguay.
238 : spanishParaguay('es-PY'),
239 :
240 : /// Spanish as spoken in El Salvador.
241 : spanishElSalvador('es-SV'),
242 :
243 : /// Spanish as spoken in Uruguay.
244 : spanishUruguay('es-UY'),
245 :
246 : /// Spanish as spoken in Venezuela.
247 : spanishVenezuela('es-VE'),
248 :
249 : /// Estonian language.
250 : estonian('et'),
251 :
252 : /// Estonian as spoken in Estonia.
253 : estonianEstonia('et-EE'),
254 :
255 : /// Basque language.
256 : basque('eu'),
257 :
258 : /// Basque as spoken in Spain.
259 : basqueSpain('eu-ES'),
260 :
261 : /// Farsi language.
262 : farsi('fa'),
263 :
264 : /// Farsi as spoken in Iran.
265 : farsiIran('fa-IR'),
266 :
267 : /// Finnish language.
268 : finnish('fi'),
269 :
270 : /// Finnish as spoken in Finland.
271 : finnishFinland('fi-FI'),
272 :
273 : /// Faroese language.
274 : faroese('fo'),
275 :
276 : /// Faroese as spoken in Faroe Islands.
277 : faroeseFaroeIslands('fo-FO'),
278 :
279 : /// French language.
280 : french('fr'),
281 :
282 : /// French as spoken in Belgium.
283 : frenchBelgium('fr-BE'),
284 :
285 : /// French as spoken in Canada.
286 : frenchCanada('fr-CA'),
287 :
288 : /// French as spoken in Switzerland.
289 : frenchSwitzerland('fr-CH'),
290 :
291 : /// French as spoken in France.
292 : frenchFrance('fr-FR'),
293 :
294 : /// French as spoken in Luxembourg.
295 : frenchLuxembourg('fr-LU'),
296 :
297 : /// French as spoken in Monaco.
298 : frenchPrincipalityOfMonaco('fr-MC'),
299 :
300 : /// Galician language.
301 : galician('gl'),
302 :
303 : /// Galician as spoken in Spain.
304 : galicianSpain('gl-ES'),
305 :
306 : /// Gujarati language.
307 : gujarati('gu'),
308 :
309 : /// Gujarati as spoken in India.
310 : gujaratiIndia('gu-IN'),
311 :
312 : /// Hebrew language.
313 : hebrew('he'),
314 :
315 : /// Hebrew as spoken in Israel.
316 : hebrewIsrael('he-IL'),
317 :
318 : /// Hindi language.
319 : hindi('hi'),
320 :
321 : /// Hindi as spoken in India.
322 : hindiIndia('hi-IN'),
323 :
324 : /// Croatian language.
325 : croatian('hr'),
326 :
327 : /// Croatian as spoken in Bosnia and Herzegovina.
328 : croatianBosniaAndHerzegovina('hr-BA'),
329 :
330 : /// Croatian as spoken in Croatia.
331 : croatianCroatia('hr-HR'),
332 :
333 : /// Hungarian language.
334 : hungarian('hu'),
335 :
336 : /// Hungarian as spoken in Hungary.
337 : hungarianHungary('hu-HU'),
338 :
339 : /// Armenian language.
340 : armenian('hy'),
341 :
342 : /// Armenian as spoken in Armenia.
343 : armenianArmenia('hy-AM'),
344 :
345 : /// Indonesian language.
346 : indonesian('id'),
347 :
348 : /// Indonesian as spoken in Indonesia.
349 : indonesianIndonesia('id-ID'),
350 :
351 : /// Icelandic language.
352 : icelandic('is'),
353 :
354 : /// Icelandic as spoken in Iceland.
355 : icelandicIceland('is-IS'),
356 :
357 : /// Italian language.
358 : italian('it'),
359 :
360 : /// Italian as spoken in Switzerland.
361 : italianSwitzerland('it-CH'),
362 :
363 : /// Italian as spoken in Italy.
364 : italianItaly('it-IT'),
365 :
366 : /// Japanese language.
367 : japanese('ja'),
368 :
369 : /// Japanese as spoken in Japan.
370 : japaneseJapan('ja-JP'),
371 :
372 : /// Georgian language.
373 : georgian('ka'),
374 :
375 : /// Georgian as spoken in Georgia.
376 : georgianGeorgia('ka-GE'),
377 :
378 : /// Kazakh language.
379 : kazakh('kk'),
380 :
381 : /// Kazakh as spoken in Kazakhstan.
382 : kazakhKazakhstan('kk-KZ'),
383 :
384 : /// Kannada language.
385 : kannada('kn'),
386 :
387 : /// Kannada as spoken in India.
388 : kannadaIndia('kn-IN'),
389 :
390 : /// Korean language.
391 : korean('ko'),
392 :
393 : /// Korean as spoken in Korea.
394 : koreanKorea('ko-KR'),
395 :
396 : /// Konkani language.
397 : konkani('kok'),
398 :
399 : /// Konkani as spoken in India.
400 : konkaniIndia('kok-IN'),
401 :
402 : /// Kyrgyz language.
403 : kyrgyz('ky'),
404 :
405 : /// Kyrgyz as spoken in Kyrgyzstan.
406 : kyrgyzKyrgyzstan('ky-KG'),
407 :
408 : /// Lithuanian language.
409 : lithuanian('lt'),
410 :
411 : /// Lithuanian as spoken in Lithuania.
412 : lithuanianLithuania('lt-LT'),
413 :
414 : /// Latvian language.
415 : latvian('lv'),
416 :
417 : /// Latvian as spoken in Latvia.
418 : latvianLatvia('lv-LV'),
419 :
420 : /// Maori language.
421 : maori('mi'),
422 :
423 : /// Maori as spoken in New Zealand.
424 : maoriNewZealand('mi-NZ'),
425 :
426 : /// Macedonian language.
427 : fyroMacedonian('mk'),
428 :
429 : /// Macedonian as spoken in North Macedonia.
430 : fyroMacedonianFormerYugoslavRepublicOfMacedonia('mk-MK'),
431 :
432 : /// Mongolian language.
433 : mongolian('mn'),
434 :
435 : /// Mongolian as spoken in Mongolia.
436 : mongolianMongolia('mn-MN'),
437 :
438 : /// Marathi language.
439 : marathi('mr'),
440 :
441 : /// Marathi as spoken in India.
442 : marathiIndia('mr-IN'),
443 :
444 : /// Malay language.
445 : malay('ms'),
446 :
447 : /// Malay as spoken in Brunei Darussalam.
448 : malayBruneiDarussalam('ms-BN'),
449 :
450 : /// Malay as spoken in Malaysia.
451 : malayMalaysia('ms-MY'),
452 :
453 : /// Maltese language.
454 : maltese('mt'),
455 :
456 : /// Maltese as spoken in Malta.
457 : malteseMalta('mt-MT'),
458 :
459 : /// Norwegian Bokmål language.
460 : norwegianBokml('nb'),
461 :
462 : /// Norwegian Bokmål as spoken in Norway.
463 : norwegianBokmlNorway('nb-NO'),
464 :
465 : /// Dutch language.
466 : dutch('nl'),
467 :
468 : /// Dutch as spoken in Belgium.
469 : dutchBelgium('nl-BE'),
470 :
471 : /// Dutch as spoken in the Netherlands.
472 : dutchNetherlands('nl-NL'),
473 :
474 : /// Norwegian Nynorsk as spoken in Norway.
475 : norwegianNynorskNorway('nn-NO'),
476 :
477 : /// Northern Sotho language.
478 : northernSotho('ns'),
479 :
480 : /// Northern Sotho as spoken in South Africa.
481 : northernSothoSouthAfrica('ns-ZA'),
482 :
483 : /// Punjabi language.
484 : punjabi('pa'),
485 :
486 : /// Punjabi as spoken in India.
487 : punjabiIndia('pa-IN'),
488 :
489 : /// Polish language.
490 : polish('pl'),
491 :
492 : /// Polish as spoken in Poland.
493 : polishPoland('pl-PL'),
494 :
495 : /// Pashto language.
496 : pashto('ps'),
497 :
498 : /// Pashto as spoken in Afghanistan.
499 : pashtoAfghanistan('ps-AR'),
500 :
501 : /// Portuguese language.
502 : portuguese('pt'),
503 :
504 : /// Portuguese as spoken in Brazil.
505 : portugueseBrazil('pt-BR'),
506 :
507 : /// Portuguese as spoken in Portugal.
508 : portuguesePortugal('pt-PT'),
509 :
510 : /// Quechua language.
511 : quechua('qu'),
512 :
513 : /// Quechua as spoken in Bolivia.
514 : quechuaBolivia('qu-BO'),
515 :
516 : /// Quechua as spoken in Ecuador.
517 : quechuaEcuador('qu-EC'),
518 :
519 : /// Quechua as spoken in Peru.
520 : quechuaPeru('qu-PE'),
521 :
522 : /// Romanian language.
523 : romanian('ro'),
524 :
525 : /// Romanian as spoken in Romania.
526 : romanianRomania('ro-RO'),
527 :
528 : /// Russian language.
529 : russian('ru'),
530 :
531 : /// Russian as spoken in Russia.
532 : russianRussia('ru-RU'),
533 :
534 : /// Sanskrit language.
535 : sanskrit('sa'),
536 :
537 : /// Sanskrit as spoken in India.
538 : sanskritIndia('sa-IN'),
539 :
540 : /// Sami language.
541 : sami('se'),
542 :
543 : /// Sami as spoken in Finland.
544 : samiFinland('se-FI'),
545 :
546 : /// Sami as spoken in Norway.
547 : samiNorway('se-NO'),
548 :
549 : /// Sami as spoken in Sweden.
550 : samiSweden('se-SE'),
551 :
552 : /// Slovak language.
553 : slovak('sk'),
554 :
555 : /// Slovak as spoken in Slovakia.
556 : slovakSlovakia('sk-SK'),
557 :
558 : /// Slovenian language.
559 : slovenian('sl'),
560 :
561 : /// Slovenian as spoken in Slovenia.
562 : slovenianSlovenia('sl-SI'),
563 :
564 : /// Albanian language.
565 : albanian('sq'),
566 :
567 : /// Albanian as spoken in Albania.
568 : albanianAlbania('sq-AL'),
569 :
570 : /// Serbian Latin script as spoken in Bosnia and Herzegovina.
571 : serbianLatinBosniaAndHerzegovina('sr-BA'),
572 :
573 : /// Serbian Cyrillic script as spoken in Bosnia and Herzegovina.
574 : serbianCyrillicBosniaAndHerzegovina('sr-Cyrl-BA'),
575 :
576 : /// Serbian Latin script as spoken in Serbia and Montenegro.
577 : serbianLatinSerbiaAndMontenegro('sr-SP'),
578 :
579 : /// Serbian Cyrillic script as spoken in Serbia and Montenegro.
580 : serbianCyrillicSerbiaAndMontenegro('sr-Cyrl-SP'),
581 :
582 : /// Swedish language.
583 : swedish('sv'),
584 :
585 : /// Swedish as spoken in Finland.
586 : swedishFinland('sv-FI'),
587 :
588 : /// Swedish as spoken in Sweden.
589 : swedishSweden('sv-SE'),
590 :
591 : /// Swahili language.
592 : swahili('sw'),
593 :
594 : /// Swahili as spoken in Kenya.
595 : swahiliKenya('sw-KE'),
596 :
597 : /// Syriac language.
598 : syriac('syr'),
599 :
600 : /// Syriac as spoken in Syria.
601 : syriacSyria('syr-SY'),
602 :
603 : /// Tamil language.
604 : tamil('ta'),
605 :
606 : /// Tamil as spoken in India.
607 : tamilIndia('ta-IN'),
608 :
609 : /// Telugu language.
610 : telugu('te'),
611 :
612 : /// Telugu as spoken in India.
613 : teluguIndia('te-IN'),
614 :
615 : /// Thai language.
616 : thai('th'),
617 :
618 : /// Thai as spoken in Thailand.
619 : thaiThailand('th-TH'),
620 :
621 : /// Tagalog language.
622 : tagalog('tl'),
623 :
624 : /// Tagalog as spoken in Philippines.
625 : tagalogPhilippines('tl-PH'),
626 :
627 : /// Tswana language.
628 : tswana('tn'),
629 :
630 : /// Tswana as spoken in South Africa.
631 : tswanaSouthAfrica('tn-ZA'),
632 :
633 : /// Turkish language.
634 : turkish('tr'),
635 :
636 : /// Turkish as spoken in Turkey.
637 : turkishTurkey('tr-TR'),
638 :
639 : /// Tatar language.
640 : tatar('tt'),
641 :
642 : /// Tatar as spoken in Russia.
643 : tatarRussia('tt-RU'),
644 :
645 : /// Tsonga language.
646 : tsonga('ts'),
647 :
648 : /// Ukrainian language.
649 : ukrainian('uk'),
650 :
651 : /// Ukrainian as spoken in Ukraine.
652 : ukrainianUkraine('uk-UA'),
653 :
654 : /// Urdu language.
655 : urdu('ur'),
656 :
657 : /// Urdu as spoken in Islamic Republic Of Pakistan.
658 : urduIslamicRepublicOfPakistan('ur-PK'),
659 :
660 : /// Uzbek Latin script.
661 : uzbekLatin('uz'),
662 :
663 : /// Uzbek Latin script as spoken in Uzbekistan.
664 : uzbekLatinUzbekistan('uz-UZ'),
665 :
666 : /// Uzbek Cyrillic script as spoken in Uzbekistan.
667 : uzbekCyrillicUzbekistan('uz-Cyrl-UZ'),
668 :
669 : /// Vietnamese language.
670 : vietnamese('vi'),
671 :
672 : /// Vietnamese as spoken in Viet Nam.
673 : vietnameseVietNam('vi-VN'),
674 :
675 : /// Xhosa language.
676 : xhosa('xh'),
677 :
678 : /// Xhosa as spoken in South Africa.
679 : xhosaSouthAfrica('xh-ZA'),
680 :
681 : /// Chinese language.
682 : chinese('zh'),
683 :
684 : /// Chinese as spoken in China.
685 : chineseS('zh-CN'),
686 :
687 : /// Chinese as spoken in Hong Kong.
688 : chineseHongKong('zh-HK'),
689 :
690 : /// Chinese as spoken in Macau.
691 : chineseMacau('zh-MO'),
692 :
693 : /// Chinese as spoken in Singapore.
694 : chineseSingapore('zh-SG'),
695 :
696 : /// Chinese as spoken in Taiwan.
697 : chineseT('zh-TW'),
698 :
699 : /// Zulu language.
700 : zulu('zu'),
701 :
702 : /// Zulu as spoken in South Africa.
703 : zuluSouthAfrica('zu-ZA');
704 :
705 : /// The string value representing the language code.
706 : final String value;
707 :
708 : /// Creates a [Rfc5646Language] with the given [value].
709 : const Rfc5646Language(this.value);
710 :
711 0 : @override
712 : String toString() {
713 0 : return value;
714 : }
715 :
716 : /// Creates a [Rfc5646Language] from a string value.
717 : ///
718 : /// [value] - The string representation of the language code.
719 : ///
720 : /// Returns the corresponding [Rfc5646Language] enum value.
721 : /// Throws a [StateError] if no matching language code is found.
722 0 : factory Rfc5646Language.fromMap(String value) {
723 0 : return values.firstWhere((element) => element.toString() == value);
724 : }
725 : }
|