navigator.language


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}'`);