gt-react-native 0.0.1-alpha.8 → 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/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/polyfill.js +6 -0
- 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 +1 -0
- 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 +15 -0
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":[]}
|
|
@@ -30,4 +30,10 @@ import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
|
30
30
|
import '@formatjs/intl-datetimeformat/locale-data/en';
|
|
31
31
|
import '@formatjs/intl-datetimeformat/locale-data/zh';
|
|
32
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
|
+
}
|
|
33
39
|
//# sourceMappingURL=polyfill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"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","ignoreList":[]}
|
|
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"}
|
|
@@ -25,4 +25,5 @@ import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
|
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":"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"}
|
|
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
|
@@ -34,3 +34,18 @@ import '@formatjs/intl-relativetimeformat/locale-data/es';
|
|
|
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
|
+
}
|