I am looking for a shim for the ECMAScript Internationalization API. Does anyone know of such a project? (Even if it's still currently a work-in-progress.)
The Intl object is the namespace for the ECMAScript Internationalization API, which provides language sensitive string comparison, number formatting, and date and time formatting.
A Locale object represents a specific geographical, political, or cultural region. An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user.
Yes, there's a polyfill for ECMA-402 (aka ECMA Internationalization API Specification) available at https://github.com/andyearnshaw/Intl.js.
For use in Node.js applications, you can install with NPM:
npm install intl
It's also available as a Bower component for the front-end:
bower install intl
There's support for NumberFormat
and DateTimeFormat
, but no support for Collator
. Currently, for client-side browser environments, you need to add the locale data using a separate function. See the README.md file for details.
Disclaimer: @AndyE is the author of Intl.js
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With