gpt4 book ai didi

JavaScript - 获取浏览器支持的语言环境的完整列表

转载 作者:行者123 更新时间:2023-12-03 06:50:13 24 4
gpt4 key购买 nike

我找到了 supportedLocalesOf ,但是有没有办法获得所有受支持的语言环境,而不仅仅是检查给定列表中哪些是受支持的?

this 2012 post 中描述的“*”标签选项不再工作。

最佳答案

您可以使用npm ISO-639-1列出它们。假设所有浏览器都使用 639-1 是安全的。 this table from wikipedia 中显示的列作为他们的标准支持。
或使用以下硬编码列表

[
['Abkhazian', 'ab'],
['Afar', 'aa'],
['Afrikaans', 'af'],
['Akan', 'ak'],
['Albanian', 'sq'],
['Amharic', 'am'],
['Arabic', 'ar'],
['Aragonese', 'an'],
['Argentina', 'es-ar'],
['Armenian', 'hy'],
['Assamese', 'as'],
['Avaric', 'av'],
['Avestan', 'ae'],
['Aymara', 'ay'],
['Azerbaijani', 'az'],
['Bambara', 'bm'],
['Bashkir', 'ba'],
['Basque', 'eu'],
['Belarusian', 'be'],
['Bengali (Bangla)', 'bn'],
['Bihari', 'bh'],
['Bislama', 'bi'],
['Bosnian', 'bs'],
['Breton', 'br'],
['Bulgarian', 'bg'],
['Burmese', 'my'],
['Catalan', 'ca'],
['Chamorro', 'ch'],
['Chechen', 'ce'],
['Chichewa, Chewa, Nyanja', 'ny'],
['Chinese', 'zh'],
['Chinese (Simplified)', 'zh-Hans'],
['Chinese (Traditional)', 'zh-Hant'],
['Chuvash', 'cv'],
['Cornish', 'kw'],
['Corsican', 'co'],
['Cree', 'cr'],
['Croatian', 'hr'],
['Czech', 'cs'],
['Danish', 'da'],
['Divehi, Dhivehi, Maldivian', 'dv'],
['Dutch', 'nl'],
['Dzongkha', 'dz'],
['English', 'en'],
['Esperanto', 'eo'],
['Estonian', 'et'],
['Ewe', 'ee'],
['Faroese', 'fo'],
['Fijian', 'fj'],
['Finnish', 'fi'],
['French', 'fr'],
['Fula, Fulah, Pulaar, Pular', 'ff'],
['Galician', 'gl'],
['Gaelic (Scottish)', 'gd'],
['Gaelic (Manx)', 'gv'],
['Georgian', 'ka'],
['German', 'de'],
['Greek', 'el'],
['Greenlandic', 'kl'],
['Guarani', 'gn'],
['Gujarati', 'gu'],
['Haitian Creole', 'ht'],
['Hausa', 'ha'],
['Hebrew', 'he'],
['Herero', 'hz'],
['Hindi', 'hi'],
['Hiri Motu', 'ho'],
['Hungarian', 'hu'],
['Icelandic', 'is'],
['Ido', 'io'],
['Igbo', 'ig'],
['Indonesian', 'id, in'],
['Interlingua', 'ia'],
['Interlingue', 'ie'],
['Inuktitut', 'iu'],
['Inupiak', 'ik'],
['Irish', 'ga'],
['Italian', 'it'],
['Japanese', 'ja'],
['Javanese', 'jv'],
['Kalaallisut, Greenlandic', 'kl'],
['Kannada', 'kn'],
['Kanuri', 'kr'],
['Kashmiri', 'ks'],
['Kazakh', 'kk'],
['Khmer', 'km'],
['Kikuyu', 'ki'],
['Kinyarwanda (Rwanda)', 'rw'],
['Kirundi', 'rn'],
['Kyrgyz', 'ky'],
['Komi', 'kv'],
['Kongo', 'kg'],
['Korean', 'ko'],
['Kurdish', 'ku'],
['Kwanyama', 'kj'],
['Lao', 'lo'],
['Latin', 'la'],
['Latvian (Lettish)', 'lv'],
['Limburgish ( Limburger)', 'li'],
['Lingala', 'ln'],
['Lithuanian', 'lt'],
['Luga-Katanga', 'lu'],
['Luganda, Ganda', 'lg'],
['Luxembourgish', 'lb'],
['Manx', 'gv'],
['Macedonian', 'mk'],
['Malagasy', 'mg'],
['Malay', 'ms'],
['Malayalam', 'ml'],
['Maltese', 'mt'],
['Maori', 'mi'],
['Marathi', 'mr'],
['Marshallese', 'mh'],
['Moldavian', 'mo'],
['Mongolian', 'mn'],
['Nauru', 'na'],
['Navajo', 'nv'],
['Ndonga', 'ng'],
['Northern Ndebele', 'nd'],
['Nepali', 'ne'],
['Norwegian', 'no'],
['Norwegian bokmål', 'nb'],
['Norwegian nynorsk', 'nn'],
['Nuosu', 'ii'],
['Occitan', 'oc'],
['Ojibwe', 'oj'],
['Old Church Slavonic, Old Bulgarian', 'cu'],
['Oriya', 'or'],
['Oromo (Afaan Oromo)', 'om'],
['Ossetian', 'os'],
['Pāli', 'pi'],
['Pashto, Pushto', 'ps'],
['Persian (Farsi)', 'fa'],
['Polish', 'pl'],
['Portuguese', 'pt'],
['Punjabi (Eastern)', 'pa'],
['Quechua', 'qu'],
['Romansh', 'rm'],
['Romanian', 'ro'],
['Russian', 'ru'],
['Sami', 'se'],
['Samoan', 'sm'],
['Sango', 'sg'],
['Sanskrit', 'sa'],
['Serbian', 'sr'],
['Serbo-Croatian', 'sh'],
['Sesotho', 'st'],
['Setswana', 'tn'],
['Shona', 'sn'],
['Sichuan Yi', 'ii'],
['Sindhi', 'sd'],
['Sinhalese', 'si'],
['Siswati', 'ss'],
['Slovak', 'sk'],
['Slovenian', 'sl'],
['Somali', 'so'],
['Southern Ndebele', 'nr'],
['Spanish', 'es'],
['Sundanese', 'su'],
['Swahili (Kiswahili)', 'sw'],
['Swati', 'ss'],
['Swedish', 'sv'],
['Tagalog', 'tl'],
['Tahitian', 'ty'],
['Tajik', 'tg'],
['Tamil', 'ta'],
['Tatar', 'tt'],
['Telugu', 'te'],
['Thai', 'th'],
['Tibetan', 'bo'],
['Tigrinya', 'ti'],
['Tonga', 'to'],
['Tsonga', 'ts'],
['Turkish', 'tr'],
['Turkmen', 'tk'],
['Twi', 'tw'],
['Uyghur', 'ug'],
['Ukrainian', 'uk'],
['Urdu', 'ur'],
['Uzbek', 'uz'],
['Venda', 've'],
['Vietnamese', 'vi'],
['Volapük', 'vo'],
['Wallon', 'wa'],
['Welsh', 'cy'],
['Wolof', 'wo'],
['Western Frisian', 'fy'],
['Xhosa', 'xh'],
['Yiddish', 'yi', 'ji'],
['Yoruba', 'yo'],
['Zhuang, Chuang', 'za'],
['Zulu', 'zu'],
]

关于JavaScript - 获取浏览器支持的语言环境的完整列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52549577/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com