forked from andyearnshaw/Intl.js
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
30 lines (24 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Expose `IntlPolyfill` as global to add locale data into runtime later on.
global.IntlPolyfill = require('./lib/core.js');
// Require all locale data for `Intl`. This module will be
// ignored when bundling for the browser with Browserify/Webpack.
require('./locale-data/complete.js');
// hack to export the polyfill as global Intl if needed
if (!global.Intl) {
global.Intl = global.IntlPolyfill;
global.IntlPolyfill.__applyLocaleSensitivePrototypes();
}
// providing an idiomatic api for the nodejs version of this module
module.exports = global.IntlPolyfill;
let x= 'pl-u-hc-h12-ca-buddhist-cu-eur-nu-arab-kn-true';
let loc3 = new global.IntlPolyfill.Locale(x, {
hourCycle: 'h24',
calendar: 'gregory',
currency: 'usd',
numberingSystem: 'mlym',
numeric: false,
caseFirst: "false"
});
loc3.foo = 'foo';
console.log(loc3);
console.log(loc3.toString());