Javascript NodeJS Intl.RelativeTimeFormat仅返回英文字符串
我试图在nodeJS中玩Javascript NodeJS Intl.RelativeTimeFormat仅返回英文字符串,javascript,node.js,internationalization,locale,ecmascript-intl,Javascript,Node.js,Internationalization,Locale,Ecmascript Intl,我试图在nodeJS中玩Intl,但它只输出英语,尽管我设置了不同的设置 这是我的尝试 $ node Welcome to Node.js v12.16.3. Type ".help" for more information. > const spanish = new Intl.RelativeTimeFormat('es-es') undefined > spanish.format(10, 'hours') 'in 10 hours' 这与我的地区设置有
Intl
,但它只输出英语,尽管我设置了不同的设置
这是我的尝试
$ node
Welcome to Node.js v12.16.3.
Type ".help" for more information.
> const spanish = new Intl.RelativeTimeFormat('es-es')
undefined
> spanish.format(10, 'hours')
'in 10 hours'
这与我的地区设置有关吗
$ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
(我在mac电脑上,以防万一)