-
Notifications
You must be signed in to change notification settings - Fork 215
Implement require('intl').polyfill(['en', 'fr', 'pt'])
#89
Comments
I will probably try to get this in by 1.0.0-rc-2. |
That's a good idea! 👍 |
I don't have time to work on this these days, we need a brave soul to take it. |
got a hint where to start - or even your concerns and plans how to implement that feature? |
@johannestroeger we will need the input from @srl295 on this. Node 0.12 is definitely not the focus anymore. Ideally, we should have a quick and easy way to detect what are the locales supported by the node runtime without having to attempt to create instance and test for the respective |
According to the official documentation, we have to detect the supported languages ourself. |
Now that nodejs 0.12, and iojs ships with Intl by default, the polyfilling process becomes a little bit messy. For info about this here: http://formatjs.io/guides/runtime-environments/#polyfill-node
These is the piece of code that we are using today for polyfill Intl in node:
This is to guarantee that the polyfill is used if at least one of the locales supported by your app is not supported natively in nodejs, then it falls back to the polyfill.
As a new pattern is emerging in other polyfills when used thru NPM, the
polyfill()
method will normally patch the runtime when needed./cc @ericf
The text was updated successfully, but these errors were encountered: