📜  navigator.language 所有语言的列表 (1)

📅  最后修改于: 2023-12-03 15:03:09.048000             🧑  作者: Mango

Navigator Language List

The navigator.language property in JavaScript returns a string representing the language version of the browser.

Syntax
var language = navigator.language;
Example
console.log(navigator.language); // "en-US"
List of Language Codes

Here's a list of all the possible language codes you may get with the navigator.language property:

  • af: Afrikaans
  • sq: Albanian
  • am: Amharic
  • ar: Arabic
  • hy: Armenian
  • az: Azerbaijani
  • eu: Basque
  • be: Belarusian
  • bn: Bengali (Bangla)
  • bs: Bosnian
  • bg: Bulgarian
  • my: Burmese
  • ca: Catalan
  • ceb: Cebuano
  • zh-CN: Chinese (Simplified)
  • zh-TW: Chinese (Traditional)
  • co: Corsican
  • hr: Croatian
  • cs: Czech
  • da: Danish
  • nl: Dutch
  • en: English
  • eo: Esperanto
  • et: Estonian
  • fo: Faroese
  • tl: Filipino
  • fi: Finnish
  • fr: French
  • fy: Frisian
  • gl: Galician
  • ka: Georgian
  • de: German
  • el: Greek
  • gu: Gujarati
  • ht: Haitian Creole
  • ha: Hausa
  • haw: Hawaiian
  • he: Hebrew
  • hi: Hindi
  • hmn: Hmong
  • hu: Hungarian
  • is: Icelandic
  • ig: Igbo
  • id: Indonesian
  • ga: Irish
  • it: Italian
  • ja: Japanese
  • jw: Javanese
  • kn: Kannada
  • kk: Kazakh
  • km: Khmer
  • rw: Kinyarwanda (Rwanda)
  • ko: Korean
  • ku: Kurdish
  • ky: Kyrgyz
  • lo: Lao
  • la: Latin
  • lv: Latvian
  • lt: Lithuanian
  • lb: Luxembourgish
  • mk: Macedonian
  • mg: Malagasy
  • ms: Malay
  • ml: Malayalam
  • mt: Maltese
  • mi: Maori
  • mr: Marathi
  • mn: Mongolian
  • ne: Nepali
  • no: Norwegian
  • ny: Nyanja (Chichewa)
  • or: Odia (Oriya)
  • ps: Pashto
  • fa: Persian (Farsi)
  • pl: Polish
  • pt: Portuguese
  • pa: Punjabi
  • ro: Romanian
  • ru: Russian
  • sm: Samoan
  • gd: Scots Gaelic
  • sr: Serbian
  • st: Sesotho
  • sn: Shona
  • sd: Sindhi
  • si: Sinhala (Sinhalese)
  • sk: Slovak
  • sl: Slovenian
  • so: Somali
  • es: Spanish
  • su: Sundanese
  • sw: Swahili
  • sv: Swedish
  • tg: Tajik
  • ta: Tamil
  • tt: Tatar
  • te: Telugu
  • th: Thai
  • tr: Turkish
  • tk: Turkmen
  • uk: Ukrainian
  • ur: Urdu
  • ug: Uyghur
  • uz: Uzbek
  • vi: Vietnamese
  • cy: Welsh
  • xh: Xhosa
  • yi: Yiddish
  • yo: Yoruba
  • zu: Zulu
Conclusion

The navigator.language property in JavaScript returns a string representing the language version of the browser. It can be used to provide localized content to users.