Skip to content

Load Common Locale Data from CDN on Demand

Compare
Choose a tag to compare
@cwtuan cwtuan released this 12 Dec 13:10
· 226 commits to master since this release

For browser rendering, the common locale data such as date, currency, and number format are automatically loaded from CDN on demand.

For server-side rendering, they should be added in your application as shown in the example.

// For Node.js
import IntlPolyfill from "intl";
global.Intl = IntlPolyfill;
require('intl/locale-data/jsonp/en.js');
require('intl/locale-data/jsonp/zh.js');
require('intl/locale-data/jsonp/fr.js');
require('intl/locale-data/jsonp/ja.js');