gt-react-native 0.0.1-alpha.7 → 0.0.1-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/gtreactnative/GtReactNativePackage.kt +1 -0
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/polyfill.js +14 -7
- package/lib/module/utils/polyfill.js.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/polyfill.d.ts +7 -6
- package/lib/typescript/src/utils/polyfill.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +2 -1
- package/src/utils/polyfill.ts +24 -9
package/lib/module/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import "./utils/polyfill.js";
|
|
3
|
+
import { polyfillLocales } from "./utils/polyfill.js";
|
|
4
4
|
import GtReactNative from "./NativeGtReactNative.js";
|
|
5
5
|
import { GTProvider } from "./provider/GTProvider.js";
|
|
6
6
|
export function multiply(a, b) {
|
|
7
7
|
return GtReactNative.multiply(a, b);
|
|
8
8
|
}
|
|
9
9
|
import { T, useGT, useTranslations, useDefaultLocale, useLocale, useRegion, Var, Num, Currency, DateTime, Plural, Branch, useLocales, useLocaleSelector, useSetLocale, useGTClass, useLocaleProperties, useRegionSelector, useLocaleDirection, useMessages, msg, decodeMsg, decodeOptions } from '@generaltranslation/react-core';
|
|
10
|
-
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, msg, decodeMsg, decodeOptions, useMessages };
|
|
10
|
+
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, msg, decodeMsg, decodeOptions, useMessages, polyfillLocales };
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GtReactNative","GTProvider","multiply","a","b","T","useGT","useTranslations","useDefaultLocale","useLocale","useRegion","Var","Num","Currency","DateTime","Plural","Branch","useLocales","useLocaleSelector","useSetLocale","useGTClass","useLocaleProperties","useRegionSelector","useLocaleDirection","useMessages","msg","decodeMsg","decodeOptions"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"names":["polyfillLocales","GtReactNative","GTProvider","multiply","a","b","T","useGT","useTranslations","useDefaultLocale","useLocale","useRegion","Var","Num","Currency","DateTime","Plural","Branch","useLocales","useLocaleSelector","useSetLocale","useGTClass","useLocaleProperties","useRegionSelector","useLocaleDirection","useMessages","msg","decodeMsg","decodeOptions"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,qBAAkB;AAClD,OAAOC,aAAa,MAAM,0BAAuB;AAEjD,SAASC,UAAU,QAAQ,0BAAuB;AAClD,OAAO,SAASC,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAU;EACrD,OAAOJ,aAAa,CAACE,QAAQ,CAACC,CAAC,EAAEC,CAAC,CAAC;AACrC;AAEA,SACEC,CAAC,EACDC,KAAK,EACLC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACTC,SAAS,EACTC,GAAG,EACHC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,UAAU,EACVC,iBAAiB,EACjBC,YAAY,EACZC,UAAU,EACVC,mBAAmB,EACnBC,iBAAiB,EACjBC,kBAAkB,EAClBC,WAAW,EACXC,GAAG,EACHC,SAAS,EACTC,aAAa,QACR,gCAAgC;AAOvC,SACEhB,GAAG,EACHC,GAAG,EACHC,QAAQ,EACRC,QAAQ,EACRT,CAAC,EACDJ,UAAU,EACVc,MAAM,EACNC,MAAM,EACNV,KAAK,EACLC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACTQ,UAAU,EACVE,YAAY,EACZD,iBAAiB,EACjBR,SAAS,EACTY,iBAAiB,EACjBF,UAAU,EACVC,mBAAmB,EACnBE,kBAAkB,EAIlBE,GAAG,EACHC,SAAS,EACTC,aAAa,EACbH,WAAW,EACXzB,eAAe","ignoreList":[]}
|
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
//
|
|
3
|
+
// Intl object not natively supported, see: https://formatjs.github.io/docs/polyfills
|
|
4
|
+
// See also: The Ultimate Guide to React Native Optimization - page 124
|
|
4
5
|
|
|
5
6
|
import '@formatjs/intl-getcanonicallocales/polyfill';
|
|
6
7
|
import '@formatjs/intl-locale/polyfill';
|
|
7
8
|
import '@formatjs/intl-displaynames/polyfill';
|
|
9
|
+
import '@formatjs/intl-listformat/polyfill';
|
|
10
|
+
import '@formatjs/intl-pluralrules/polyfill-force'; // https://github.com/formatjs/formatjs/issues/4463
|
|
11
|
+
import '@formatjs/intl-numberformat/polyfill';
|
|
12
|
+
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
13
|
+
import '@formatjs/intl-datetimeformat/polyfill';
|
|
14
|
+
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
8
15
|
import '@formatjs/intl-displaynames/locale-data/en';
|
|
9
16
|
import '@formatjs/intl-displaynames/locale-data/zh';
|
|
10
17
|
import '@formatjs/intl-displaynames/locale-data/es';
|
|
11
|
-
import '@formatjs/intl-listformat/polyfill';
|
|
12
18
|
import '@formatjs/intl-listformat/locale-data/en';
|
|
13
19
|
import '@formatjs/intl-listformat/locale-data/zh';
|
|
14
20
|
import '@formatjs/intl-listformat/locale-data/es';
|
|
15
|
-
import '@formatjs/intl-pluralrules/polyfill';
|
|
16
21
|
import '@formatjs/intl-pluralrules/locale-data/en';
|
|
17
22
|
import '@formatjs/intl-pluralrules/locale-data/zh';
|
|
18
23
|
import '@formatjs/intl-pluralrules/locale-data/es';
|
|
19
|
-
import '@formatjs/intl-numberformat/polyfill';
|
|
20
24
|
import '@formatjs/intl-numberformat/locale-data/en';
|
|
21
25
|
import '@formatjs/intl-numberformat/locale-data/zh';
|
|
22
26
|
import '@formatjs/intl-numberformat/locale-data/es';
|
|
23
|
-
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
24
27
|
import '@formatjs/intl-relativetimeformat/locale-data/en';
|
|
25
28
|
import '@formatjs/intl-relativetimeformat/locale-data/zh';
|
|
26
29
|
import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
27
|
-
import '@formatjs/intl-datetimeformat/polyfill';
|
|
28
|
-
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
29
30
|
import '@formatjs/intl-datetimeformat/locale-data/en';
|
|
30
31
|
import '@formatjs/intl-datetimeformat/locale-data/zh';
|
|
31
32
|
import '@formatjs/intl-datetimeformat/locale-data/es';
|
|
33
|
+
async function polyfillLocale(locale) {
|
|
34
|
+
await Promise.all([import(`@formatjs/intl-displaynames/locale-data/${locale}`), import(`@formatjs/intl-listformat/locale-data/${locale}`), import(`@formatjs/intl-pluralrules/locale-data/${locale}`), import(`@formatjs/intl-numberformat/locale-data/${locale}`), import(`@formatjs/intl-relativetimeformat/locale-data/${locale}`), import(`@formatjs/intl-datetimeformat/locale-data/${locale}`)]);
|
|
35
|
+
}
|
|
36
|
+
export async function polyfillLocales(locales) {
|
|
37
|
+
await Promise.all(locales.map(polyfillLocale));
|
|
38
|
+
}
|
|
32
39
|
//# sourceMappingURL=polyfill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/polyfill.ts"],"mappings":";;AAAA;;AAEA,OAAO,6CAA6C;
|
|
1
|
+
{"version":3,"names":["polyfillLocale","locale","Promise","all","polyfillLocales","locales","map"],"sourceRoot":"../../../src","sources":["utils/polyfill.ts"],"mappings":";;AAAA;AACA;;AAEA,OAAO,6CAA6C;AACpD,OAAO,gCAAgC;AACvC,OAAO,sCAAsC;AAC7C,OAAO,oCAAoC;AAC3C,OAAO,2CAA2C,CAAC,CAAC;AACpD,OAAO,sCAAsC;AAC7C,OAAO,4CAA4C;AACnD,OAAO,wCAAwC;AAC/C,OAAO,0CAA0C;AAEjD,OAAO,4CAA4C;AACnD,OAAO,4CAA4C;AACnD,OAAO,4CAA4C;AAEnD,OAAO,0CAA0C;AACjD,OAAO,0CAA0C;AACjD,OAAO,0CAA0C;AAEjD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAClD,OAAO,2CAA2C;AAElD,OAAO,4CAA4C;AACnD,OAAO,4CAA4C;AACnD,OAAO,4CAA4C;AAEnD,OAAO,kDAAkD;AACzD,OAAO,kDAAkD;AACzD,OAAO,kDAAkD;AAEzD,OAAO,8CAA8C;AACrD,OAAO,8CAA8C;AACrD,OAAO,8CAA8C;AAErD,eAAeA,cAAcA,CAACC,MAAc,EAAE;EAC5C,MAAMC,OAAO,CAACC,GAAG,CAAC,CAChB,MAAM,CAAC,2CAA2CF,MAAM,EAAE,CAAC,EAC3D,MAAM,CAAC,yCAAyCA,MAAM,EAAE,CAAC,EACzD,MAAM,CAAC,0CAA0CA,MAAM,EAAE,CAAC,EAC1D,MAAM,CAAC,2CAA2CA,MAAM,EAAE,CAAC,EAC3D,MAAM,CAAC,iDAAiDA,MAAM,EAAE,CAAC,EACjE,MAAM,CAAC,6CAA6CA,MAAM,EAAE,CAAC,CAC9D,CAAC;AACJ;AAEA,OAAO,eAAeG,eAAeA,CAACC,OAAiB,EAAE;EACvD,MAAMH,OAAO,CAACC,GAAG,CAACE,OAAO,CAACC,GAAG,CAACN,cAAc,CAAC,CAAC;AAChD","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import './utils/polyfill';
|
|
1
|
+
import { polyfillLocales } from './utils/polyfill';
|
|
2
2
|
import { GTProvider } from './provider/GTProvider';
|
|
3
3
|
export declare function multiply(a: number, b: number): number;
|
|
4
4
|
import { T, useGT, useTranslations, useDefaultLocale, useLocale, useRegion, Var, Num, Currency, DateTime, Plural, Branch, useLocales, useLocaleSelector, useSetLocale, useGTClass, useLocaleProperties, useRegionSelector, useLocaleDirection, useMessages, msg, decodeMsg, decodeOptions } from '@generaltranslation/react-core';
|
|
5
5
|
import type { DictionaryTranslationOptions, InlineTranslationOptions, RuntimeTranslationOptions } from '@generaltranslation/react-core/types';
|
|
6
|
-
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, type DictionaryTranslationOptions, type InlineTranslationOptions, type RuntimeTranslationOptions, msg, decodeMsg, decodeOptions, useMessages, };
|
|
6
|
+
export { Var, Num, Currency, DateTime, T, GTProvider, Plural, Branch, useGT, useTranslations, useDefaultLocale, useLocale, useLocales, useSetLocale, useLocaleSelector, useRegion, useRegionSelector, useGTClass, useLocaleProperties, useLocaleDirection, type DictionaryTranslationOptions, type InlineTranslationOptions, type RuntimeTranslationOptions, msg, decodeMsg, decodeOptions, useMessages, polyfillLocales, };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAGnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,OAAO,EACL,CAAC,EACD,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,GAAG,EACH,SAAS,EACT,aAAa,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,GAAG,EACH,GAAG,EACH,QAAQ,EACR,QAAQ,EACR,CAAC,EACD,UAAU,EACV,MAAM,EACN,MAAM,EACN,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,GAAG,EACH,SAAS,EACT,aAAa,EACb,WAAW,EACX,eAAe,GAChB,CAAC"}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import '@formatjs/intl-getcanonicallocales/polyfill';
|
|
2
2
|
import '@formatjs/intl-locale/polyfill';
|
|
3
3
|
import '@formatjs/intl-displaynames/polyfill';
|
|
4
|
+
import '@formatjs/intl-listformat/polyfill';
|
|
5
|
+
import '@formatjs/intl-pluralrules/polyfill-force';
|
|
6
|
+
import '@formatjs/intl-numberformat/polyfill';
|
|
7
|
+
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
8
|
+
import '@formatjs/intl-datetimeformat/polyfill';
|
|
9
|
+
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
4
10
|
import '@formatjs/intl-displaynames/locale-data/en';
|
|
5
11
|
import '@formatjs/intl-displaynames/locale-data/zh';
|
|
6
12
|
import '@formatjs/intl-displaynames/locale-data/es';
|
|
7
|
-
import '@formatjs/intl-listformat/polyfill';
|
|
8
13
|
import '@formatjs/intl-listformat/locale-data/en';
|
|
9
14
|
import '@formatjs/intl-listformat/locale-data/zh';
|
|
10
15
|
import '@formatjs/intl-listformat/locale-data/es';
|
|
11
|
-
import '@formatjs/intl-pluralrules/polyfill';
|
|
12
16
|
import '@formatjs/intl-pluralrules/locale-data/en';
|
|
13
17
|
import '@formatjs/intl-pluralrules/locale-data/zh';
|
|
14
18
|
import '@formatjs/intl-pluralrules/locale-data/es';
|
|
15
|
-
import '@formatjs/intl-numberformat/polyfill';
|
|
16
19
|
import '@formatjs/intl-numberformat/locale-data/en';
|
|
17
20
|
import '@formatjs/intl-numberformat/locale-data/zh';
|
|
18
21
|
import '@formatjs/intl-numberformat/locale-data/es';
|
|
19
|
-
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
20
22
|
import '@formatjs/intl-relativetimeformat/locale-data/en';
|
|
21
23
|
import '@formatjs/intl-relativetimeformat/locale-data/zh';
|
|
22
24
|
import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
23
|
-
import '@formatjs/intl-datetimeformat/polyfill';
|
|
24
|
-
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
25
25
|
import '@formatjs/intl-datetimeformat/locale-data/en';
|
|
26
26
|
import '@formatjs/intl-datetimeformat/locale-data/zh';
|
|
27
27
|
import '@formatjs/intl-datetimeformat/locale-data/es';
|
|
28
|
+
export declare function polyfillLocales(locales: string[]): Promise<void>;
|
|
28
29
|
//# sourceMappingURL=polyfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../../../src/utils/polyfill.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../../../src/utils/polyfill.ts"],"names":[],"mappings":"AAGA,OAAO,6CAA6C,CAAC;AACrD,OAAO,gCAAgC,CAAC;AACxC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,2CAA2C,CAAC;AACnD,OAAO,sCAAsC,CAAC;AAC9C,OAAO,4CAA4C,CAAC;AACpD,OAAO,wCAAwC,CAAC;AAChD,OAAO,0CAA0C,CAAC;AAElD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAEpD,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAClD,OAAO,0CAA0C,CAAC;AAElD,OAAO,2CAA2C,CAAC;AACnD,OAAO,2CAA2C,CAAC;AACnD,OAAO,2CAA2C,CAAC;AAEnD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AAEpD,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAC1D,OAAO,kDAAkD,CAAC;AAE1D,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,8CAA8C,CAAC;AAatD,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,iBAEtD"}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './utils/polyfill';
|
|
1
|
+
import { polyfillLocales } from './utils/polyfill';
|
|
2
2
|
import GtReactNative from './NativeGtReactNative';
|
|
3
3
|
|
|
4
4
|
import { GTProvider } from './provider/GTProvider';
|
|
@@ -65,4 +65,5 @@ export {
|
|
|
65
65
|
decodeMsg,
|
|
66
66
|
decodeOptions,
|
|
67
67
|
useMessages,
|
|
68
|
+
polyfillLocales,
|
|
68
69
|
};
|
package/src/utils/polyfill.ts
CHANGED
|
@@ -1,36 +1,51 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Intl object not natively supported, see: https://formatjs.github.io/docs/polyfills
|
|
2
|
+
// See also: The Ultimate Guide to React Native Optimization - page 124
|
|
2
3
|
|
|
3
4
|
import '@formatjs/intl-getcanonicallocales/polyfill';
|
|
4
|
-
|
|
5
5
|
import '@formatjs/intl-locale/polyfill';
|
|
6
|
-
|
|
7
6
|
import '@formatjs/intl-displaynames/polyfill';
|
|
7
|
+
import '@formatjs/intl-listformat/polyfill';
|
|
8
|
+
import '@formatjs/intl-pluralrules/polyfill-force'; // https://github.com/formatjs/formatjs/issues/4463
|
|
9
|
+
import '@formatjs/intl-numberformat/polyfill';
|
|
10
|
+
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
11
|
+
import '@formatjs/intl-datetimeformat/polyfill';
|
|
12
|
+
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
13
|
+
|
|
8
14
|
import '@formatjs/intl-displaynames/locale-data/en';
|
|
9
15
|
import '@formatjs/intl-displaynames/locale-data/zh';
|
|
10
16
|
import '@formatjs/intl-displaynames/locale-data/es';
|
|
11
17
|
|
|
12
|
-
import '@formatjs/intl-listformat/polyfill';
|
|
13
18
|
import '@formatjs/intl-listformat/locale-data/en';
|
|
14
19
|
import '@formatjs/intl-listformat/locale-data/zh';
|
|
15
20
|
import '@formatjs/intl-listformat/locale-data/es';
|
|
16
21
|
|
|
17
|
-
import '@formatjs/intl-pluralrules/polyfill';
|
|
18
22
|
import '@formatjs/intl-pluralrules/locale-data/en';
|
|
19
23
|
import '@formatjs/intl-pluralrules/locale-data/zh';
|
|
20
24
|
import '@formatjs/intl-pluralrules/locale-data/es';
|
|
21
25
|
|
|
22
|
-
import '@formatjs/intl-numberformat/polyfill';
|
|
23
26
|
import '@formatjs/intl-numberformat/locale-data/en';
|
|
24
27
|
import '@formatjs/intl-numberformat/locale-data/zh';
|
|
25
28
|
import '@formatjs/intl-numberformat/locale-data/es';
|
|
26
29
|
|
|
27
|
-
import '@formatjs/intl-relativetimeformat/polyfill';
|
|
28
30
|
import '@formatjs/intl-relativetimeformat/locale-data/en';
|
|
29
31
|
import '@formatjs/intl-relativetimeformat/locale-data/zh';
|
|
30
32
|
import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
31
33
|
|
|
32
|
-
import '@formatjs/intl-datetimeformat/polyfill';
|
|
33
|
-
import '@formatjs/intl-datetimeformat/add-all-tz';
|
|
34
34
|
import '@formatjs/intl-datetimeformat/locale-data/en';
|
|
35
35
|
import '@formatjs/intl-datetimeformat/locale-data/zh';
|
|
36
36
|
import '@formatjs/intl-datetimeformat/locale-data/es';
|
|
37
|
+
|
|
38
|
+
async function polyfillLocale(locale: string) {
|
|
39
|
+
await Promise.all([
|
|
40
|
+
import(`@formatjs/intl-displaynames/locale-data/${locale}`),
|
|
41
|
+
import(`@formatjs/intl-listformat/locale-data/${locale}`),
|
|
42
|
+
import(`@formatjs/intl-pluralrules/locale-data/${locale}`),
|
|
43
|
+
import(`@formatjs/intl-numberformat/locale-data/${locale}`),
|
|
44
|
+
import(`@formatjs/intl-relativetimeformat/locale-data/${locale}`),
|
|
45
|
+
import(`@formatjs/intl-datetimeformat/locale-data/${locale}`),
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function polyfillLocales(locales: string[]) {
|
|
50
|
+
await Promise.all(locales.map(polyfillLocale));
|
|
51
|
+
}
|