My Node.js version on Windows 8.1 is:
$ node -v
v5.3.0
But it seems it doesn't support locale identification and negotiation. I mean the support of ECMAScript Internationalization API. Only en
locale is supported. Here is an example in a browser and in Node.js. In a browser a locale is identified just fine:
// en
> Intl.NumberFormat('en', {currency: 'USD', style:"currency"}).format(300)
> "$300.00"
// ru
> Intl.NumberFormat('ru', {currency: 'USD', style:"currency"}).format(300)
> "300,00 $"
But in Node.js it doesn't work. Node.js returns the same en
format for both en
and ru
:
// en
> Intl.NumberFormat('en', {currency: 'USD', style:"currency"}).format(300)
'$300.00'
// ru
> Intl.NumberFormat('ru', {currency: 'USD', style:"currency"}).format(300)
'$300.00'
Is there a way to see what locales does a given Node.js support and how can I enable desired locales?