navigator.language
- 类型:<string>
navigator.language 只读属性返回一个字符串,表示 Node.js 实例的首选语言。该语言将由 Node.js 在运行时使用的 ICU 库根据操作系统的默认语言来确定。
【The navigator.language read-only property returns a string representing the
preferred language of the Node.js instance. The language will be determined by
the ICU library used by Node.js at runtime based on the
default language of the operating system.】
该值表示在 RFC 5646 中定义的语言版本。
【The value is representing the language version as defined in RFC 5646.】
在没有 ICU 的构建中,回退值为 'en-US'。
【The fallback value on builds without ICU is 'en-US'.】
console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);