--- title: NavigatorLanguage.language slug: orphaned/Web/API/NavigatorLanguage/language translation_of: Web/API/NavigatorLanguage/language original_slug: Web/API/NavigatorLanguage/language ---
NavigatorLanguage.language 읽기 전용 속성은 사용자의 기본 언어 (일반적으로 브라우저 UI의 언어)를 나타내는 문자열을 반환합니다.
var lang = navigator.language
A {{domxref("DOMString")}}. lang
stores a string representing the language version as defined in BCP 47. Examples of valid language codes include "en", "en-US", "fr", "fr-FR", "es-ES", etc.
Note that in Safari on macOS and iOS prior to 10.2, the country code returned is lowercase: "en-us", "fr-fr" etc.
if (window.navigator.language != 'en') { doLangSelect(window.navigator.language); }
Specification | Status | Comment |
---|---|---|
{{ SpecName('HTML5.1', '#dom-navigator-language', 'NavigatorLanguage.language') }} | {{ Spec2('HTML5.1') }} | Initial definition |
{{Compat("api.NavigatorLanguage.language")}}