gt-react-native 11.0.0-odysseus.4 → 11.0.0
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/dist/commonjs/NativeGtReactNative.js +3 -6
- package/dist/commonjs/NativeGtReactNative.js.map +1 -1
- package/dist/commonjs/condition-store/NativeConditionStore.js +19 -27
- package/dist/commonjs/condition-store/NativeConditionStore.js.map +1 -1
- package/dist/commonjs/hooks/selectors.js.map +1 -1
- package/dist/commonjs/index.js +35 -10
- package/dist/commonjs/plugin-dir/index.js +3 -6
- package/dist/commonjs/plugin-dir/index.js.map +1 -1
- package/dist/commonjs/plugin.js +2 -5
- package/dist/commonjs/provider/GTProvider.js +32 -21
- package/dist/commonjs/provider/GTProvider.js.map +1 -1
- package/dist/commonjs/provider/NativeGTProvider.js +1 -4
- package/dist/commonjs/provider/NativeGTProvider.js.map +1 -1
- package/dist/commonjs/setup/initializeGT.js +6 -11
- package/dist/commonjs/utils/getInitialNativeConditions.js +2 -2
- package/dist/commonjs/utils/getInitialNativeConditions.js.map +1 -1
- package/dist/commonjs/utils/getLocale.js +1 -1
- package/dist/commonjs/utils/getLocale.js.map +1 -1
- package/dist/commonjs/utils/getNativeLocales.js +1 -1
- package/dist/commonjs/utils/getNativeLocales.js.map +1 -1
- package/dist/commonjs/utils/nativeStore.js +4 -4
- package/dist/commonjs/utils/nativeStore.js.map +1 -1
- package/dist/commonjs/utils/resolveLocale.js +1 -2
- package/dist/commonjs/utils/resolveLocale.js.map +1 -1
- package/dist/module/NativeGtReactNative.d.ts +1 -2
- package/dist/module/NativeGtReactNative.d.ts.map +1 -1
- package/dist/module/NativeGtReactNative.js +2 -2
- package/dist/module/NativeGtReactNative.js.map +1 -1
- package/dist/module/condition-store/NativeConditionStore.d.ts +0 -7
- package/dist/module/condition-store/NativeConditionStore.d.ts.map +1 -1
- package/dist/module/condition-store/NativeConditionStore.js +20 -28
- package/dist/module/condition-store/NativeConditionStore.js.map +1 -1
- package/dist/module/hooks/selectors.d.ts +3 -33
- package/dist/module/hooks/selectors.d.ts.map +1 -1
- package/dist/module/hooks/selectors.js.map +1 -1
- package/dist/module/index.d.ts +13 -18
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +3 -4
- package/dist/module/plugin-dir/index.d.ts +1 -1
- package/dist/module/plugin-dir/index.d.ts.map +1 -1
- package/dist/module/plugin-dir/index.js +2 -2
- package/dist/module/plugin-dir/index.js.map +1 -1
- package/dist/module/plugin.d.ts +1 -1
- package/dist/module/plugin.d.ts.map +1 -1
- package/dist/module/plugin.js +2 -2
- package/dist/module/provider/GTProvider.d.ts +1 -1
- package/dist/module/provider/GTProvider.d.ts.map +1 -1
- package/dist/module/provider/GTProvider.js +32 -21
- package/dist/module/provider/GTProvider.js.map +1 -1
- package/dist/module/provider/NativeGTProvider.d.ts.map +1 -1
- package/dist/module/provider/NativeGTProvider.js +1 -4
- package/dist/module/provider/NativeGTProvider.js.map +1 -1
- package/dist/module/setup/initializeGT.d.ts +3 -4
- package/dist/module/setup/initializeGT.d.ts.map +1 -1
- package/dist/module/setup/initializeGT.js +1 -11
- package/dist/module/utils/getInitialNativeConditions.d.ts.map +1 -1
- package/dist/module/utils/getInitialNativeConditions.js +3 -3
- package/dist/module/utils/getInitialNativeConditions.js.map +1 -1
- package/dist/module/utils/getLocale.d.ts.map +1 -1
- package/dist/module/utils/getLocale.js +2 -2
- package/dist/module/utils/getLocale.js.map +1 -1
- package/dist/module/utils/getNativeLocales.js +2 -2
- package/dist/module/utils/getNativeLocales.js.map +1 -1
- package/dist/module/utils/nativeStore.d.ts +1 -1
- package/dist/module/utils/nativeStore.d.ts.map +1 -1
- package/dist/module/utils/nativeStore.js +6 -6
- package/dist/module/utils/nativeStore.js.map +1 -1
- package/dist/module/utils/resolveLocale.d.ts.map +1 -1
- package/dist/module/utils/resolveLocale.js +1 -2
- package/dist/module/utils/resolveLocale.js.map +1 -1
- package/package.json +6 -6
- package/src/NativeGtReactNative.ts +2 -1
- package/src/condition-store/NativeConditionStore.ts +21 -40
- package/src/hooks/selectors.ts +17 -3
- package/src/index.tsx +39 -67
- package/src/plugin-dir/index.ts +1 -1
- package/src/plugin.ts +1 -1
- package/src/provider/GTProvider.tsx +51 -29
- package/src/provider/NativeGTProvider.tsx +1 -9
- package/src/setup/initializeGT.ts +7 -19
- package/src/utils/getInitialNativeConditions.ts +3 -6
- package/src/utils/getLocale.ts +2 -2
- package/src/utils/getNativeLocales.ts +1 -1
- package/src/utils/nativeStore.ts +4 -4
- package/src/utils/resolveLocale.ts +1 -5
- package/dist/commonjs/hooks/utils.js +0 -17
- package/dist/commonjs/hooks/utils.js.map +0 -1
- package/dist/commonjs/setup/initializeGT.js.map +0 -1
- package/dist/commonjs/utils/utils.js +0 -13
- package/dist/commonjs/utils/utils.js.map +0 -1
- package/dist/module/hooks/utils.d.ts +0 -3
- package/dist/module/hooks/utils.d.ts.map +0 -1
- package/dist/module/hooks/utils.js +0 -14
- package/dist/module/hooks/utils.js.map +0 -1
- package/dist/module/setup/initializeGT.js.map +0 -1
- package/dist/module/utils/utils.d.ts +0 -3
- package/dist/module/utils/utils.d.ts.map +0 -1
- package/dist/module/utils/utils.js +0 -12
- package/dist/module/utils/utils.js.map +0 -1
- package/src/hooks/utils.ts +0 -14
- package/src/utils/utils.ts +0 -12
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
2
|
require("./_virtual/_rolldown/runtime.js");
|
|
6
3
|
//#region src/NativeGtReactNative.ts
|
|
7
|
-
|
|
4
|
+
const GtReactNative = require("react-native").TurboModuleRegistry.getEnforcing("GtReactNative");
|
|
8
5
|
//#endregion
|
|
9
|
-
exports.
|
|
6
|
+
exports.GtReactNative = GtReactNative;
|
|
10
7
|
|
|
11
8
|
//# sourceMappingURL=NativeGtReactNative.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGtReactNative.js","names":["TurboModuleRegistry"],"sources":["../../src/NativeGtReactNative.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nexport interface Spec extends TurboModule {\n multiply(a: number, b: number): number;\n getNativeLocales(): string[];\n nativeStoreGet(key: string): string | null;\n nativeStoreSet(key: string, value: string): void;\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"NativeGtReactNative.js","names":["TurboModuleRegistry"],"sources":["../../src/NativeGtReactNative.ts"],"sourcesContent":["import type { TurboModule } from 'react-native';\nimport { TurboModuleRegistry } from 'react-native';\nexport interface Spec extends TurboModule {\n multiply(a: number, b: number): number;\n getNativeLocales(): string[];\n nativeStoreGet(key: string): string | null;\n nativeStoreSet(key: string, value: string): void;\n}\n\nexport const GtReactNative =\n TurboModuleRegistry.getEnforcing<Spec>('GtReactNative');\n"],"mappings":";;;AASA,MAAa,uCACXA,CAAAA,oBAAoB,aAAmB,gBAAgB"}
|
|
@@ -10,61 +10,44 @@ let _generaltranslation_react_core_pure = require("@generaltranslation/react-cor
|
|
|
10
10
|
* Condition store implementation for React Native.
|
|
11
11
|
*/
|
|
12
12
|
var NativeConditionStore = class {
|
|
13
|
-
localeStoreKey;
|
|
14
|
-
regionStoreKey;
|
|
15
|
-
enableI18nStoreKey;
|
|
16
13
|
customReload;
|
|
17
14
|
constructor(config) {
|
|
18
15
|
this.customReload = config._reload ?? (() => void 0);
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
this.enableI18nStoreKey = config.enableI18nStoreKey ?? _generaltranslation_react_core_pure.defaultEnableI18nCookieName;
|
|
22
|
-
this.updateLocale(config.locale ?? require_utils_getLocale.getLocale({ localeStoreKey: this.localeStoreKey }));
|
|
23
|
-
const region = require_utils_getInitialNativeConditions.getInitialRegion({
|
|
24
|
-
region: config.region,
|
|
25
|
-
regionStoreKey: this.regionStoreKey
|
|
26
|
-
});
|
|
16
|
+
this.updateLocale(config.locale ?? require_utils_getLocale.getLocale());
|
|
17
|
+
const region = require_utils_getInitialNativeConditions.getInitialRegion({ region: config.region });
|
|
27
18
|
if (region !== void 0) this.updateRegion(region);
|
|
28
|
-
this.updateEnableI18n(require_utils_getInitialNativeConditions.getInitialEnableI18n({
|
|
29
|
-
enableI18n: config.enableI18n,
|
|
30
|
-
enableI18nStoreKey: this.enableI18nStoreKey
|
|
31
|
-
}));
|
|
19
|
+
this.updateEnableI18n(require_utils_getInitialNativeConditions.getInitialEnableI18n({ enableI18n: config.enableI18n }));
|
|
32
20
|
}
|
|
33
|
-
updateConfig = ({ localeStoreKey, regionStoreKey, enableI18nStoreKey }) => {
|
|
34
|
-
this.localeStoreKey = localeStoreKey ?? _generaltranslation_react_core_pure.defaultLocaleCookieName;
|
|
35
|
-
this.regionStoreKey = regionStoreKey ?? _generaltranslation_react_core_pure.defaultRegionCookieName;
|
|
36
|
-
this.enableI18nStoreKey = enableI18nStoreKey ?? _generaltranslation_react_core_pure.defaultEnableI18nCookieName;
|
|
37
|
-
};
|
|
38
21
|
getLocale = () => {
|
|
39
|
-
return require_utils_getLocale.getLocale(
|
|
22
|
+
return require_utils_getLocale.getLocale();
|
|
40
23
|
};
|
|
41
24
|
setLocale = (locale) => {
|
|
42
25
|
const nextLocale = require_utils_resolveLocale.resolveLocale(locale);
|
|
43
|
-
require_utils_nativeStore.nativeStoreSet(
|
|
26
|
+
require_utils_nativeStore.nativeStoreSet(getLocaleStoreKey(), nextLocale);
|
|
44
27
|
this.reload({ locale: nextLocale });
|
|
45
28
|
};
|
|
46
29
|
getRegion = () => {
|
|
47
|
-
return require_utils_nativeStore.nativeStoreGet(
|
|
30
|
+
return require_utils_nativeStore.nativeStoreGet(getRegionStoreKey()) || void 0;
|
|
48
31
|
};
|
|
49
32
|
setRegion = (region) => {
|
|
50
33
|
this.updateRegion(region);
|
|
51
34
|
this.reload({ region });
|
|
52
35
|
};
|
|
53
36
|
getEnableI18n = () => {
|
|
54
|
-
return require_utils_nativeStore.nativeStoreGet(
|
|
37
|
+
return require_utils_nativeStore.nativeStoreGet(getEnableI18nStoreKey()) !== "false";
|
|
55
38
|
};
|
|
56
39
|
setEnableI18n = (enableI18n) => {
|
|
57
40
|
this.updateEnableI18n(enableI18n);
|
|
58
41
|
this.reload({ enableI18n });
|
|
59
42
|
};
|
|
60
43
|
updateLocale = (locale) => {
|
|
61
|
-
require_utils_nativeStore.nativeStoreSet(
|
|
44
|
+
require_utils_nativeStore.nativeStoreSet(getLocaleStoreKey(), require_utils_resolveLocale.resolveLocale(locale));
|
|
62
45
|
};
|
|
63
46
|
updateRegion = (region) => {
|
|
64
|
-
require_utils_nativeStore.nativeStoreSet(
|
|
47
|
+
require_utils_nativeStore.nativeStoreSet(getRegionStoreKey(), region ?? "");
|
|
65
48
|
};
|
|
66
49
|
updateEnableI18n = (enableI18n) => {
|
|
67
|
-
require_utils_nativeStore.nativeStoreSet(
|
|
50
|
+
require_utils_nativeStore.nativeStoreSet(getEnableI18nStoreKey(), enableI18n ? "true" : "false");
|
|
68
51
|
};
|
|
69
52
|
reload = (state = {}) => {
|
|
70
53
|
this.customReload({
|
|
@@ -74,6 +57,15 @@ var NativeConditionStore = class {
|
|
|
74
57
|
});
|
|
75
58
|
};
|
|
76
59
|
};
|
|
60
|
+
function getLocaleStoreKey() {
|
|
61
|
+
return (0, _generaltranslation_react_core_pure.getI18nConfig)().getLocaleCookieName();
|
|
62
|
+
}
|
|
63
|
+
function getRegionStoreKey() {
|
|
64
|
+
return (0, _generaltranslation_react_core_pure.getI18nConfig)().getRegionCookieName();
|
|
65
|
+
}
|
|
66
|
+
function getEnableI18nStoreKey() {
|
|
67
|
+
return (0, _generaltranslation_react_core_pure.getI18nConfig)().getEnableI18nCookieName();
|
|
68
|
+
}
|
|
77
69
|
//#endregion
|
|
78
70
|
exports.NativeConditionStore = NativeConditionStore;
|
|
79
71
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeConditionStore.js","names":["
|
|
1
|
+
{"version":3,"file":"NativeConditionStore.js","names":["getLocale","getInitialRegion","getInitialEnableI18n","resolveLocale","nativeStoreGet"],"sources":["../../../src/condition-store/NativeConditionStore.ts"],"sourcesContent":["import type {\n LocaleCandidates,\n WritableConditionStoreInterface,\n WritableConditionStoreParams,\n} from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { nativeStoreGet, nativeStoreSet } from '../utils/nativeStore';\nimport { resolveLocale } from '../utils/resolveLocale';\n\nexport type NativeConditionStoreParams = WritableConditionStoreParams & {\n _reload?: ReloadType;\n};\n\nexport type NativeConditionStoreState = {\n locale: string;\n region: string | undefined;\n enableI18n: boolean;\n};\n\nexport type ReloadType = (state: NativeConditionStoreState) => void;\n\n/**\n * Condition store implementation for React Native.\n */\nexport class NativeConditionStore implements WritableConditionStoreInterface {\n private customReload: ReloadType;\n\n constructor(config: NativeConditionStoreParams) {\n this.customReload = config._reload ?? (() => undefined);\n\n this.updateLocale(config.locale ?? getLocale());\n const region = getInitialRegion({\n region: config.region,\n });\n if (region !== undefined) {\n this.updateRegion(region);\n }\n this.updateEnableI18n(\n getInitialEnableI18n({\n enableI18n: config.enableI18n,\n })\n );\n }\n\n getLocale = (): string => {\n return getLocale();\n };\n\n setLocale = (locale: LocaleCandidates): void => {\n const nextLocale = resolveLocale(locale);\n nativeStoreSet(getLocaleStoreKey(), nextLocale);\n this.reload({ locale: nextLocale });\n };\n\n getRegion = (): string | undefined => {\n return nativeStoreGet(getRegionStoreKey()) || undefined;\n };\n\n setRegion = (region: string | undefined): void => {\n this.updateRegion(region);\n this.reload({ region });\n };\n\n getEnableI18n = (): boolean => {\n return nativeStoreGet(getEnableI18nStoreKey()) !== 'false';\n };\n\n setEnableI18n = (enableI18n: boolean): void => {\n this.updateEnableI18n(enableI18n);\n this.reload({ enableI18n });\n };\n\n updateLocale = (locale: LocaleCandidates): void => {\n nativeStoreSet(getLocaleStoreKey(), resolveLocale(locale));\n };\n\n updateRegion = (region: string | undefined): void => {\n nativeStoreSet(getRegionStoreKey(), region ?? '');\n };\n\n updateEnableI18n = (enableI18n: boolean): void => {\n nativeStoreSet(getEnableI18nStoreKey(), enableI18n ? 'true' : 'false');\n };\n\n reload = (state: Partial<NativeConditionStoreState> = {}): void => {\n this.customReload({\n locale: state.locale ?? this.getLocale(),\n region: 'region' in state ? state.region : this.getRegion(),\n enableI18n: state.enableI18n ?? this.getEnableI18n(),\n });\n };\n}\n\nfunction getLocaleStoreKey(): string {\n return getI18nConfig().getLocaleCookieName();\n}\n\nfunction getRegionStoreKey(): string {\n return getI18nConfig().getRegionCookieName();\n}\n\nfunction getEnableI18nStoreKey(): string {\n return getI18nConfig().getEnableI18nCookieName();\n}\n"],"mappings":";;;;;;;;;;;AA6BA,IAAa,uBAAb,MAA6E;CAC3E;CAEA,YAAY,QAAoC;AAC9C,OAAK,eAAe,OAAO,kBAAkB,KAAA;AAE7C,OAAK,aAAa,OAAO,UAAUA,wBAAAA,WAAW,CAAC;EAC/C,MAAM,SAASC,yCAAAA,iBAAiB,EAC9B,QAAQ,OAAO,QAChB,CAAC;AACF,MAAI,WAAW,KAAA,EACb,MAAK,aAAa,OAAO;AAE3B,OAAK,iBACHC,yCAAAA,qBAAqB,EACnB,YAAY,OAAO,YACpB,CAAC,CACH;;CAGH,kBAA0B;AACxB,SAAOF,wBAAAA,WAAW;;CAGpB,aAAa,WAAmC;EAC9C,MAAM,aAAaG,4BAAAA,cAAc,OAAO;AACxC,4BAAA,eAAe,mBAAmB,EAAE,WAAW;AAC/C,OAAK,OAAO,EAAE,QAAQ,YAAY,CAAC;;CAGrC,kBAAsC;AACpC,SAAOC,0BAAAA,eAAe,mBAAmB,CAAC,IAAI,KAAA;;CAGhD,aAAa,WAAqC;AAChD,OAAK,aAAa,OAAO;AACzB,OAAK,OAAO,EAAE,QAAQ,CAAC;;CAGzB,sBAA+B;AAC7B,SAAOA,0BAAAA,eAAe,uBAAuB,CAAC,KAAK;;CAGrD,iBAAiB,eAA8B;AAC7C,OAAK,iBAAiB,WAAW;AACjC,OAAK,OAAO,EAAE,YAAY,CAAC;;CAG7B,gBAAgB,WAAmC;AACjD,4BAAA,eAAe,mBAAmB,EAAED,4BAAAA,cAAc,OAAO,CAAC;;CAG5D,gBAAgB,WAAqC;AACnD,4BAAA,eAAe,mBAAmB,EAAE,UAAU,GAAG;;CAGnD,oBAAoB,eAA8B;AAChD,4BAAA,eAAe,uBAAuB,EAAE,aAAa,SAAS,QAAQ;;CAGxE,UAAU,QAA4C,EAAE,KAAW;AACjE,OAAK,aAAa;GAChB,QAAQ,MAAM,UAAU,KAAK,WAAW;GACxC,QAAQ,YAAY,QAAQ,MAAM,SAAS,KAAK,WAAW;GAC3D,YAAY,MAAM,cAAc,KAAK,eAAe;GACrD,CAAC;;;AAIN,SAAS,oBAA4B;AACnC,SAAA,GAAA,oCAAA,gBAAsB,CAAC,qBAAqB;;AAG9C,SAAS,oBAA4B;AACnC,SAAA,GAAA,oCAAA,gBAAsB,CAAC,qBAAqB;;AAG9C,SAAS,wBAAgC;AACvC,SAAA,GAAA,oCAAA,gBAAsB,CAAC,yBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","names":["useSetLocale","useSetRegion"],"sources":["../../../src/hooks/selectors.ts"],"sourcesContent":["import { useSetLocale, useSetRegion } from './condition-store';\nimport {\n useInternalLocaleSelector,\n useInternalRegionSelector,\n} from '@generaltranslation/react-core/hooks';\nimport type {
|
|
1
|
+
{"version":3,"file":"selectors.js","names":["useSetLocale","useSetRegion"],"sources":["../../../src/hooks/selectors.ts"],"sourcesContent":["import { useSetLocale, useSetRegion } from './condition-store';\nimport {\n useInternalLocaleSelector,\n useInternalRegionSelector,\n} from '@generaltranslation/react-core/hooks';\nimport type {\n InternalLocaleSelectorResult,\n InternalRegionSelectorOptions,\n InternalRegionSelectorResult,\n} from '@generaltranslation/react-core/hooks';\n\n// Explicit return types are required: project references make TypeScript try to\n// name the inferred selector types, which otherwise reach into\n// generaltranslation's non-portable bundled declarations (TS2742).\nexport function useLocaleSelector(\n locales?: string[]\n): InternalLocaleSelectorResult & { setLocale: (locale: string) => void } {\n const setLocale = useSetLocale();\n return { setLocale, ...useInternalLocaleSelector(locales) };\n}\n\nexport function useRegionSelector(\n options?: InternalRegionSelectorOptions\n): InternalRegionSelectorResult & {\n setLocale: (locale: string) => void;\n setRegion: (region: string | undefined) => void;\n} {\n const setLocale = useSetLocale();\n const setRegion = useSetRegion();\n return { setLocale, setRegion, ...useInternalRegionSelector(options) };\n}\n"],"mappings":";;;;;AAcA,SAAgB,kBACd,SACwE;AAExE,QAAO;EAAE,WADSA,8BAAAA,cACA;EAAE,IAAA,GAAA,qCAAA,2BAA6B,QAAQ;EAAE;;AAG7D,SAAgB,kBACd,SAIA;AAGA,QAAO;EAAE,WAFSA,8BAAAA,cAEA;EAAE,WADFC,8BAAAA,cACW;EAAE,IAAA,GAAA,qCAAA,2BAA6B,QAAQ;EAAE"}
|
package/dist/commonjs/index.js
CHANGED
|
@@ -5,10 +5,8 @@ const require_utils_getLocale = require("./utils/getLocale.js");
|
|
|
5
5
|
const require_provider_GTProvider = require("./provider/GTProvider.js");
|
|
6
6
|
const require_hooks_condition_store = require("./hooks/condition-store.js");
|
|
7
7
|
const require_hooks_selectors = require("./hooks/selectors.js");
|
|
8
|
-
const require_hooks_utils = require("./hooks/utils.js");
|
|
9
|
-
const require_setup_initializeGT = require("./setup/initializeGT.js");
|
|
10
|
-
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
11
8
|
let _generaltranslation_react_core_components = require("@generaltranslation/react-core/components");
|
|
9
|
+
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
12
10
|
let _generaltranslation_react_core_hooks = require("@generaltranslation/react-core/hooks");
|
|
13
11
|
Object.defineProperty(exports, "Branch", {
|
|
14
12
|
enumerable: true,
|
|
@@ -101,6 +99,12 @@ Object.defineProperty(exports, "derive", {
|
|
|
101
99
|
return _generaltranslation_react_core_pure.derive;
|
|
102
100
|
}
|
|
103
101
|
});
|
|
102
|
+
Object.defineProperty(exports, "getDefaultLocale", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function() {
|
|
105
|
+
return _generaltranslation_react_core_pure.getDefaultLocale;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
104
108
|
Object.defineProperty(exports, "getFormatLocales", {
|
|
105
109
|
enumerable: true,
|
|
106
110
|
get: function() {
|
|
@@ -109,6 +113,12 @@ Object.defineProperty(exports, "getFormatLocales", {
|
|
|
109
113
|
});
|
|
110
114
|
exports.getLocale = require_utils_getLocale.getLocale;
|
|
111
115
|
exports.getLocaleFromNativeStore = require_utils_nativeStore.getLocaleFromNativeStore;
|
|
116
|
+
Object.defineProperty(exports, "getLocales", {
|
|
117
|
+
enumerable: true,
|
|
118
|
+
get: function() {
|
|
119
|
+
return _generaltranslation_react_core_pure.getLocales;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
112
122
|
Object.defineProperty(exports, "getReactI18nCache", {
|
|
113
123
|
enumerable: true,
|
|
114
124
|
get: function() {
|
|
@@ -121,13 +131,24 @@ Object.defineProperty(exports, "getTranslationsSnapshot", {
|
|
|
121
131
|
return _generaltranslation_react_core_pure.getTranslationsSnapshot;
|
|
122
132
|
}
|
|
123
133
|
});
|
|
134
|
+
Object.defineProperty(exports, "getVersionId", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function() {
|
|
137
|
+
return _generaltranslation_react_core_pure.getVersionId;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
124
140
|
Object.defineProperty(exports, "gtFallback", {
|
|
125
141
|
enumerable: true,
|
|
126
142
|
get: function() {
|
|
127
143
|
return _generaltranslation_react_core_pure.gtFallback;
|
|
128
144
|
}
|
|
129
145
|
});
|
|
130
|
-
exports
|
|
146
|
+
Object.defineProperty(exports, "initializeGT", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function() {
|
|
149
|
+
return _generaltranslation_react_core_pure.internalInitializeGTSRA;
|
|
150
|
+
}
|
|
151
|
+
});
|
|
131
152
|
Object.defineProperty(exports, "mFallback", {
|
|
132
153
|
enumerable: true,
|
|
133
154
|
get: function() {
|
|
@@ -140,6 +161,12 @@ Object.defineProperty(exports, "msg", {
|
|
|
140
161
|
return _generaltranslation_react_core_pure.msg;
|
|
141
162
|
}
|
|
142
163
|
});
|
|
164
|
+
Object.defineProperty(exports, "resolveCanonicalLocale", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function() {
|
|
167
|
+
return _generaltranslation_react_core_pure.resolveCanonicalLocale;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
143
170
|
Object.defineProperty(exports, "setReactI18nCache", {
|
|
144
171
|
enumerable: true,
|
|
145
172
|
get: function() {
|
|
@@ -176,19 +203,18 @@ Object.defineProperty(exports, "useGT", {
|
|
|
176
203
|
return _generaltranslation_react_core_hooks.useGT;
|
|
177
204
|
}
|
|
178
205
|
});
|
|
179
|
-
Object.defineProperty(exports, "
|
|
206
|
+
Object.defineProperty(exports, "useLocale", {
|
|
180
207
|
enumerable: true,
|
|
181
208
|
get: function() {
|
|
182
|
-
return _generaltranslation_react_core_hooks.
|
|
209
|
+
return _generaltranslation_react_core_hooks.useLocale;
|
|
183
210
|
}
|
|
184
211
|
});
|
|
185
|
-
Object.defineProperty(exports, "
|
|
212
|
+
Object.defineProperty(exports, "useLocaleDirection", {
|
|
186
213
|
enumerable: true,
|
|
187
214
|
get: function() {
|
|
188
|
-
return _generaltranslation_react_core_hooks.
|
|
215
|
+
return _generaltranslation_react_core_hooks.useLocaleDirection;
|
|
189
216
|
}
|
|
190
217
|
});
|
|
191
|
-
exports.useLocaleDirection = require_hooks_utils.useLocaleDirection;
|
|
192
218
|
Object.defineProperty(exports, "useLocaleProperties", {
|
|
193
219
|
enumerable: true,
|
|
194
220
|
get: function() {
|
|
@@ -224,4 +250,3 @@ Object.defineProperty(exports, "useTranslations", {
|
|
|
224
250
|
return _generaltranslation_react_core_hooks.useTranslations;
|
|
225
251
|
}
|
|
226
252
|
});
|
|
227
|
-
exports.useVersionId = require_hooks_utils.useVersionId;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
2
|
const require_runtime = require("../_virtual/_rolldown/runtime.js");
|
|
6
3
|
const require_plugin_dir_types = require("./types.js");
|
|
7
4
|
const require_plugin_dir_utils_resolveLocales = require("./utils/resolveLocales.js");
|
|
8
5
|
let path = require("path");
|
|
9
6
|
path = require_runtime.__toESM(path);
|
|
10
7
|
//#region src/plugin-dir/index.ts
|
|
11
|
-
function
|
|
8
|
+
function plugin(babel, { locales, config, configFilePath, entryPointFilePath = path.resolve(process.cwd(), "src", "App.tsx"), excludePolyfills = [] }) {
|
|
12
9
|
const { types: t } = babel;
|
|
13
10
|
return {
|
|
14
11
|
name: "gt-react-native/plugin",
|
|
@@ -33,6 +30,6 @@ function plugin_dir_default(babel, { locales, config, configFilePath, entryPoint
|
|
|
33
30
|
};
|
|
34
31
|
}
|
|
35
32
|
//#endregion
|
|
36
|
-
exports.
|
|
33
|
+
exports.plugin = plugin;
|
|
37
34
|
|
|
38
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["resolveLocales","POLYFILLS","LOCALE_POLYFILLS"],"sources":["../../../src/plugin-dir/index.ts"],"sourcesContent":["import * as path from 'path';\nimport type { PluginObj, types } from '@babel/core';\nimport { LOCALE_POLYFILLS, POLYFILLS, type PluginOptions } from './types';\nimport { resolveLocales } from './utils/resolveLocales';\n\nexport
|
|
1
|
+
{"version":3,"file":"index.js","names":["resolveLocales","POLYFILLS","LOCALE_POLYFILLS"],"sources":["../../../src/plugin-dir/index.ts"],"sourcesContent":["import * as path from 'path';\nimport type { PluginObj, types } from '@babel/core';\nimport { LOCALE_POLYFILLS, POLYFILLS, type PluginOptions } from './types';\nimport { resolveLocales } from './utils/resolveLocales';\n\nexport function plugin(\n babel: { types: typeof types },\n {\n locales,\n config,\n configFilePath,\n entryPointFilePath = path.resolve(process.cwd(), 'src', 'App.tsx'),\n excludePolyfills = [],\n }: PluginOptions\n): PluginObj {\n const { types: t } = babel;\n\n return {\n name: 'gt-react-native/plugin',\n visitor: {\n Program(programPath, state) {\n const currentFilePath = path.resolve(\n state.filename || state.file.opts.filename || ''\n );\n\n // Only apply polyfills to files that import gt-react-native or generaltranslation\n if (currentFilePath !== entryPointFilePath) {\n return;\n }\n\n const resolvedLocales = resolveLocales({\n locales,\n config,\n configFilePath,\n });\n\n // TODO: smart imports based on if the polyfill is required, do this as a wrapper around AppRegistry.registerComponent()\n const imports = [\n ...POLYFILLS.filter(\n (polyfill) => !excludePolyfills.includes(polyfill)\n ),\n ...resolvedLocales.flatMap((locale) =>\n LOCALE_POLYFILLS.map((localeData) => `${localeData}/${locale}`)\n ),\n ];\n\n const existingImports = new Set<string>();\n programPath.node.body.forEach((node) => {\n if (\n t.isImportDeclaration(node) &&\n typeof node.source.value === 'string' &&\n imports.includes(node.source.value)\n ) {\n existingImports.add(node.source.value);\n }\n });\n\n const importsToAdd = imports.filter((imp) => !existingImports.has(imp));\n\n if (importsToAdd.length > 0) {\n const newImports = importsToAdd.map((importPath) =>\n t.importDeclaration([], t.stringLiteral(importPath))\n );\n\n programPath.node.body.unshift(...newImports);\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,OACd,OACA,EACE,SACA,QACA,gBACA,qBAAqB,KAAK,QAAQ,QAAQ,KAAK,EAAE,OAAO,UAAU,EAClE,mBAAmB,EAAE,IAEZ;CACX,MAAM,EAAE,OAAO,MAAM;AAErB,QAAO;EACL,MAAM;EACN,SAAS,EACP,QAAQ,aAAa,OAAO;AAM1B,OALwB,KAAK,QAC3B,MAAM,YAAY,MAAM,KAAK,KAAK,YAAY,GAI7B,KAAK,mBACtB;GAGF,MAAM,kBAAkBA,wCAAAA,eAAe;IACrC;IACA;IACA;IACD,CAAC;GAGF,MAAM,UAAU,CACd,GAAGC,yBAAAA,UAAU,QACV,aAAa,CAAC,iBAAiB,SAAS,SAAS,CACnD,EACD,GAAG,gBAAgB,SAAS,WAC1BC,yBAAAA,iBAAiB,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,CAChE,CACF;GAED,MAAM,kCAAkB,IAAI,KAAa;AACzC,eAAY,KAAK,KAAK,SAAS,SAAS;AACtC,QACE,EAAE,oBAAoB,KAAK,IAC3B,OAAO,KAAK,OAAO,UAAU,YAC7B,QAAQ,SAAS,KAAK,OAAO,MAAM,CAEnC,iBAAgB,IAAI,KAAK,OAAO,MAAM;KAExC;GAEF,MAAM,eAAe,QAAQ,QAAQ,QAAQ,CAAC,gBAAgB,IAAI,IAAI,CAAC;AAEvE,OAAI,aAAa,SAAS,GAAG;IAC3B,MAAM,aAAa,aAAa,KAAK,eACnC,EAAE,kBAAkB,EAAE,EAAE,EAAE,cAAc,WAAW,CAAC,CACrD;AAED,gBAAY,KAAK,KAAK,QAAQ,GAAG,WAAW;;KAGjD;EACF"}
|
package/dist/commonjs/plugin.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
Object.
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
5
2
|
const require_plugin_dir_index = require("./plugin-dir/index.js");
|
|
6
|
-
exports.
|
|
3
|
+
exports.plugin = require_plugin_dir_index.plugin;
|
|
@@ -10,34 +10,25 @@ let react = require("react");
|
|
|
10
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
11
|
//#region src/provider/GTProvider.tsx
|
|
12
12
|
function GTProvider(props) {
|
|
13
|
-
|
|
14
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
15
|
-
fallback: loadingFallback ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultLoadingFallback, {}),
|
|
16
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadableGTProvider, { ...providerProps })
|
|
17
|
-
});
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadableGTProvider, { ...props });
|
|
18
14
|
}
|
|
19
15
|
/**
|
|
20
16
|
* This wrapper takes the place of a loader that would be present in
|
|
21
17
|
* SSR style applications.
|
|
22
18
|
*/
|
|
23
19
|
function LoadableGTProvider(props) {
|
|
24
|
-
const {
|
|
20
|
+
const { fallback, ...providerProps } = props;
|
|
21
|
+
const renderedFallback = fallback ?? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultLoadingFallback, {});
|
|
22
|
+
const { locale, region, enableI18n } = providerProps;
|
|
25
23
|
const [nativeConditions, setNativeConditions] = (0, react.useState)(() => ({
|
|
26
|
-
locale: require_utils_getLocale.getLocale(
|
|
27
|
-
region: require_utils_getInitialNativeConditions.getInitialRegion({
|
|
28
|
-
|
|
29
|
-
regionStoreKey
|
|
30
|
-
}),
|
|
31
|
-
enableI18n: require_utils_getInitialNativeConditions.getInitialEnableI18n({
|
|
32
|
-
enableI18n,
|
|
33
|
-
enableI18nStoreKey
|
|
34
|
-
})
|
|
24
|
+
locale: require_utils_getLocale.getLocale(),
|
|
25
|
+
region: require_utils_getInitialNativeConditions.getInitialRegion({ region }),
|
|
26
|
+
enableI18n: require_utils_getInitialNativeConditions.getInitialEnableI18n({ enableI18n })
|
|
35
27
|
}));
|
|
36
28
|
const activeLocale = require_utils_resolveLocale.resolveLocale(locale ?? nativeConditions.locale);
|
|
37
29
|
const activeRegion = region ?? nativeConditions.region;
|
|
38
30
|
const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;
|
|
39
|
-
const
|
|
40
|
-
const translations = (0, react.useMemo)(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
31
|
+
const fallbackTranslations = (0, react.useMemo)(() => ({ [activeLocale]: {} }), [activeLocale]);
|
|
41
32
|
const reload = (0, react.useCallback)((state) => {
|
|
42
33
|
setNativeConditions((previousState) => ({
|
|
43
34
|
locale: locale === void 0 ? state.locale : previousState.locale,
|
|
@@ -49,13 +40,33 @@ function LoadableGTProvider(props) {
|
|
|
49
40
|
locale,
|
|
50
41
|
region
|
|
51
42
|
]);
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react.Suspense, {
|
|
44
|
+
fallback: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_provider_NativeGTProvider.NativeGTProvider, {
|
|
45
|
+
...providerProps,
|
|
46
|
+
locale: activeLocale,
|
|
47
|
+
region: activeRegion,
|
|
48
|
+
enableI18n: activeEnableI18n,
|
|
49
|
+
translations: fallbackTranslations,
|
|
50
|
+
_reload: reload,
|
|
51
|
+
children: renderedFallback
|
|
52
|
+
}),
|
|
53
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LoadedGTProvider, {
|
|
54
|
+
...providerProps,
|
|
55
|
+
locale: activeLocale,
|
|
56
|
+
region: activeRegion,
|
|
57
|
+
enableI18n: activeEnableI18n,
|
|
58
|
+
_reload: reload
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function LoadedGTProvider(props) {
|
|
63
|
+
const activeLocale = require_utils_resolveLocale.resolveLocale(props.locale);
|
|
64
|
+
const localeTranslations = (0, react.use)(require_provider_loadTranslations.loadTranslations(activeLocale));
|
|
65
|
+
const translations = (0, react.useMemo)(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
52
66
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_provider_NativeGTProvider.NativeGTProvider, {
|
|
53
67
|
...props,
|
|
54
68
|
locale: activeLocale,
|
|
55
|
-
|
|
56
|
-
enableI18n: activeEnableI18n,
|
|
57
|
-
translations,
|
|
58
|
-
_reload: reload
|
|
69
|
+
translations
|
|
59
70
|
});
|
|
60
71
|
}
|
|
61
72
|
function DefaultLoadingFallback() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.js","names":["
|
|
1
|
+
{"version":3,"file":"GTProvider.js","names":["getLocale","getInitialRegion","getInitialEnableI18n","resolveLocale","Suspense","NativeGTProvider","loadTranslations","View","ActivityIndicator","StyleSheet"],"sources":["../../../src/provider/GTProvider.tsx"],"sourcesContent":["import type { InternalGTProviderProps } from '@generaltranslation/react-core/components';\nimport { Suspense, use, useCallback, useMemo, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { ActivityIndicator, StyleSheet, View } from 'react-native';\nimport type { LocaleCandidates, Locale } from 'gt-i18n/internal/types';\nimport type {\n NativeConditionStoreParams,\n NativeConditionStoreState,\n} from '../condition-store/NativeConditionStore';\nimport { getLocale } from '../utils/getLocale';\nimport {\n getInitialEnableI18n,\n getInitialRegion,\n} from '../utils/getInitialNativeConditions';\nimport { resolveLocale } from '../utils/resolveLocale';\nimport { loadTranslations, type LocaleTranslations } from './loadTranslations';\nimport {\n NativeGTProvider,\n type NativeGTProviderProps,\n} from './NativeGTProvider';\n\nexport type GTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore' | 'translations'\n> &\n Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {\n children?: ReactNode;\n locale?: LocaleCandidates;\n fallback?: ReactNode;\n };\n\ntype LoadedGTProviderProps = Omit<NativeGTProviderProps, 'translations'>;\ntype TranslationSnapshot = Record<Locale, LocaleTranslations>;\n\nexport function GTProvider(props: GTProviderProps) {\n return <LoadableGTProvider {...props} />;\n}\n\n/**\n * This wrapper takes the place of a loader that would be present in\n * SSR style applications.\n */\nfunction LoadableGTProvider(props: GTProviderProps) {\n const { fallback, ...providerProps } = props;\n const renderedFallback = fallback ?? <DefaultLoadingFallback />;\n const { locale, region, enableI18n } = providerProps;\n // Keep native conditions in React state so condition-store writes trigger rerenders.\n const [nativeConditions, setNativeConditions] =\n useState<NativeConditionStoreState>(() => ({\n locale: getLocale(),\n region: getInitialRegion({ region }),\n enableI18n: getInitialEnableI18n({ enableI18n }),\n }));\n const activeLocale = resolveLocale(locale ?? nativeConditions.locale);\n const activeRegion = region ?? nativeConditions.region;\n const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;\n const fallbackTranslations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: {} }),\n [activeLocale]\n );\n const reload = useCallback(\n (state: NativeConditionStoreState) => {\n setNativeConditions((previousState) => ({\n locale: locale === undefined ? state.locale : previousState.locale,\n region: region === undefined ? state.region : previousState.region,\n enableI18n:\n enableI18n === undefined\n ? state.enableI18n\n : previousState.enableI18n,\n }));\n },\n [enableI18n, locale, region]\n );\n\n return (\n <Suspense\n fallback={\n <NativeGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n translations={fallbackTranslations}\n _reload={reload}\n >\n {renderedFallback}\n </NativeGTProvider>\n }\n >\n <LoadedGTProvider\n {...providerProps}\n locale={activeLocale}\n region={activeRegion}\n enableI18n={activeEnableI18n}\n _reload={reload}\n />\n </Suspense>\n );\n}\n\nfunction LoadedGTProvider(props: LoadedGTProviderProps) {\n const activeLocale = resolveLocale(props.locale);\n const localeTranslations = use(loadTranslations(activeLocale));\n const translations = useMemo<TranslationSnapshot>(\n () => ({ [activeLocale]: localeTranslations }),\n [activeLocale, localeTranslations]\n );\n\n return (\n <NativeGTProvider\n {...props}\n locale={activeLocale}\n translations={translations}\n />\n );\n}\n\nfunction DefaultLoadingFallback() {\n return (\n <View style={styles.loadingContainer}>\n <ActivityIndicator />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n loadingContainer: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n"],"mappings":";;;;;;;;;;;AAkCA,SAAgB,WAAW,OAAwB;AACjD,QAAO,iBAAA,GAAA,kBAAA,KAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,iBAAA,GAAA,kBAAA,KAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,iBACoB;EACzC,QAAQA,wBAAAA,WAAW;EACnB,QAAQC,yCAAAA,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAYC,yCAAAA,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAeC,4BAAAA,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,wBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,UAAA,GAAA,MAAA,cACH,UAAqC;AACpC,uBAAqB,mBAAmB;GACtC,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,QAAQ,WAAW,KAAA,IAAY,MAAM,SAAS,cAAc;GAC5D,YACE,eAAe,KAAA,IACX,MAAM,aACN,cAAc;GACrB,EAAE;IAEL;EAAC;EAAY;EAAQ;EAAO,CAC7B;AAED,QACE,iBAAA,GAAA,kBAAA,KAACC,MAAAA,UAAD;EACE,UACE,iBAAA,GAAA,kBAAA,KAACC,kCAAAA,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,iBAAA,GAAA,kBAAA,KAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAeF,4BAAAA,cAAc,MAAM,OAAO;CAChD,MAAM,sBAAA,GAAA,MAAA,KAAyBG,kCAAAA,iBAAiB,aAAa,CAAC;CAC9D,MAAM,gBAAA,GAAA,MAAA,gBACG,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,iBAAA,GAAA,kBAAA,KAACD,kCAAAA,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,iBAAA,GAAA,kBAAA,KAACE,aAAAA,MAAD;EAAM,OAAO,OAAO;YAClB,iBAAA,GAAA,kBAAA,KAACC,aAAAA,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAASC,aAAAA,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../_virtual/_rolldown/runtime.js");
|
|
3
3
|
const require_condition_store_NativeConditionStore = require("../condition-store/NativeConditionStore.js");
|
|
4
|
-
let react = require("react");
|
|
5
4
|
let _generaltranslation_react_core_components = require("@generaltranslation/react-core/components");
|
|
5
|
+
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
7
|
//#region src/provider/NativeGTProvider.tsx
|
|
8
8
|
function NativeGTProvider(props) {
|
|
@@ -12,9 +12,6 @@ function NativeGTProvider(props) {
|
|
|
12
12
|
props.locale,
|
|
13
13
|
props.region,
|
|
14
14
|
props.enableI18n,
|
|
15
|
-
props.localeStoreKey,
|
|
16
|
-
props.regionStoreKey,
|
|
17
|
-
props.enableI18nStoreKey,
|
|
18
15
|
props._reload
|
|
19
16
|
]);
|
|
20
17
|
const i18nStoreRef = (0, react.useRef)(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGTProvider.js","names":["NativeConditionStore","I18nStore","InternalGTProvider"],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [
|
|
1
|
+
{"version":3,"file":"NativeGTProvider.js","names":["NativeConditionStore","I18nStore","InternalGTProvider"],"sources":["../../../src/provider/NativeGTProvider.tsx"],"sourcesContent":["import {\n I18nStore,\n InternalGTProvider,\n type InternalGTProviderProps,\n} from '@generaltranslation/react-core/components';\nimport { useMemo, useRef } from 'react';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport type { NativeConditionStoreParams } from '../condition-store/NativeConditionStore';\nimport { NativeConditionStore } from '../condition-store/NativeConditionStore';\n\nexport type NativeGTProviderProps = Omit<\n InternalGTProviderProps,\n 'conditionStore' | 'i18nStore'\n> &\n Omit<NativeConditionStoreParams, 'locale'> & {\n locale: LocaleCandidates;\n };\n\nexport function NativeGTProvider(props: NativeGTProviderProps) {\n const conditionStore = useMemo(() => {\n return new NativeConditionStore(props);\n }, [props.locale, props.region, props.enableI18n, props._reload]);\n\n const i18nStoreRef = useRef<I18nStore | null>(null);\n if (i18nStoreRef.current == null) {\n i18nStoreRef.current = new I18nStore();\n }\n\n return (\n <InternalGTProvider\n {...props}\n conditionStore={conditionStore}\n i18nStore={i18nStoreRef.current}\n />\n );\n}\n"],"mappings":";;;;;;;AAkBA,SAAgB,iBAAiB,OAA8B;CAC7D,MAAM,kBAAA,GAAA,MAAA,eAA+B;AACnC,SAAO,IAAIA,6CAAAA,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,gBAAA,GAAA,MAAA,QAAwC,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAIC,0CAAAA,WAAW;AAGxC,QACE,iBAAA,GAAA,kBAAA,KAACC,0CAAAA,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("../_virtual/_rolldown/runtime.js");
|
|
3
3
|
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
exports.initializeGT = initializeGT;
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=initializeGT.js.map
|
|
4
|
+
Object.defineProperty(exports, "initializeGT", {
|
|
5
|
+
enumerable: true,
|
|
6
|
+
get: function() {
|
|
7
|
+
return _generaltranslation_react_core_pure.internalInitializeGTSRA;
|
|
8
|
+
}
|
|
9
|
+
});
|
|
@@ -3,11 +3,11 @@ require("../_virtual/_rolldown/runtime.js");
|
|
|
3
3
|
const require_utils_nativeStore = require("./nativeStore.js");
|
|
4
4
|
let _generaltranslation_react_core_pure = require("@generaltranslation/react-core/pure");
|
|
5
5
|
//#region src/utils/getInitialNativeConditions.ts
|
|
6
|
-
function getInitialRegion({ region, regionStoreKey = _generaltranslation_react_core_pure.
|
|
6
|
+
function getInitialRegion({ region, regionStoreKey = (0, _generaltranslation_react_core_pure.getI18nConfig)().getRegionCookieName() }) {
|
|
7
7
|
if (region !== void 0) return region;
|
|
8
8
|
return require_utils_nativeStore.nativeStoreGet(regionStoreKey) || void 0;
|
|
9
9
|
}
|
|
10
|
-
function getInitialEnableI18n({ enableI18n, enableI18nStoreKey = _generaltranslation_react_core_pure.
|
|
10
|
+
function getInitialEnableI18n({ enableI18n, enableI18nStoreKey = (0, _generaltranslation_react_core_pure.getI18nConfig)().getEnableI18nCookieName() }) {
|
|
11
11
|
if (enableI18n !== void 0) return enableI18n;
|
|
12
12
|
const storedEnableI18n = require_utils_nativeStore.nativeStoreGet(enableI18nStoreKey);
|
|
13
13
|
if (storedEnableI18n === null) return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInitialNativeConditions.js","names":["
|
|
1
|
+
{"version":3,"file":"getInitialNativeConditions.js","names":["nativeStoreGet"],"sources":["../../../src/utils/getInitialNativeConditions.ts"],"sourcesContent":["import type { WritableConditionStoreParams } from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { nativeStoreGet } from './nativeStore';\n\ntype InitialRegionParams = Pick<WritableConditionStoreParams, 'region'> & {\n regionStoreKey?: string;\n};\n\ntype InitialEnableI18nParams = Pick<\n WritableConditionStoreParams,\n 'enableI18n'\n> & {\n enableI18nStoreKey?: string;\n};\n\nexport function getInitialRegion({\n region,\n regionStoreKey = getI18nConfig().getRegionCookieName(),\n}: InitialRegionParams): string | undefined {\n if (region !== undefined) return region;\n return nativeStoreGet(regionStoreKey) || undefined;\n}\n\nexport function getInitialEnableI18n({\n enableI18n,\n enableI18nStoreKey = getI18nConfig().getEnableI18nCookieName(),\n}: InitialEnableI18nParams): boolean {\n if (enableI18n !== undefined) return enableI18n;\n const storedEnableI18n = nativeStoreGet(enableI18nStoreKey);\n if (storedEnableI18n === null) return true;\n return storedEnableI18n === 'true';\n}\n"],"mappings":";;;;;AAeA,SAAgB,iBAAiB,EAC/B,QACA,kBAAA,GAAA,oCAAA,gBAAgC,CAAC,qBAAqB,IACZ;AAC1C,KAAI,WAAW,KAAA,EAAW,QAAO;AACjC,QAAOA,0BAAAA,eAAe,eAAe,IAAI,KAAA;;AAG3C,SAAgB,qBAAqB,EACnC,YACA,sBAAA,GAAA,oCAAA,gBAAoC,CAAC,yBAAyB,IAC3B;AACnC,KAAI,eAAe,KAAA,EAAW,QAAO;CACrC,MAAM,mBAAmBA,0BAAAA,eAAe,mBAAmB;AAC3D,KAAI,qBAAqB,KAAM,QAAO;AACtC,QAAO,qBAAqB"}
|
|
@@ -8,7 +8,7 @@ let _generaltranslation_react_core_pure = require("@generaltranslation/react-cor
|
|
|
8
8
|
/**
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
|
-
function getLocale({ localeStoreKey = _generaltranslation_react_core_pure.
|
|
11
|
+
function getLocale({ localeStoreKey = (0, _generaltranslation_react_core_pure.getI18nConfig)().getLocaleCookieName() } = {}) {
|
|
12
12
|
const candidates = [];
|
|
13
13
|
pushLocaleCandidates(candidates, require_utils_nativeStore.nativeStoreGet(localeStoreKey));
|
|
14
14
|
candidates.push(...require_utils_getNativeLocales.getNativeLocales());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.js","names":["
|
|
1
|
+
{"version":3,"file":"getLocale.js","names":["nativeStoreGet","getNativeLocales","resolveLocale"],"sources":["../../../src/utils/getLocale.ts"],"sourcesContent":["import type { LocaleCandidates } from 'gt-i18n/internal/types';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { getNativeLocales } from './getNativeLocales';\nimport { nativeStoreGet } from './nativeStore';\nimport { resolveLocale } from './resolveLocale';\n\nexport type GetLocaleParams = {\n localeStoreKey?: string;\n};\n\n/**\n * @internal\n */\nexport function getLocale({\n localeStoreKey = getI18nConfig().getLocaleCookieName(),\n}: GetLocaleParams = {}): string {\n const candidates: string[] = [];\n pushLocaleCandidates(candidates, nativeStoreGet(localeStoreKey));\n candidates.push(...getNativeLocales());\n\n return resolveLocale(candidates);\n}\n\nfunction pushLocaleCandidates(\n target: string[],\n locale: LocaleCandidates | null\n) {\n if (!locale) return;\n if (Array.isArray(locale)) {\n target.push(...locale);\n return;\n }\n target.push(locale);\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,UAAU,EACxB,kBAAA,GAAA,oCAAA,gBAAgC,CAAC,qBAAqB,KACnC,EAAE,EAAU;CAC/B,MAAM,aAAuB,EAAE;AAC/B,sBAAqB,YAAYA,0BAAAA,eAAe,eAAe,CAAC;AAChE,YAAW,KAAK,GAAGC,+BAAAA,kBAAkB,CAAC;AAEtC,QAAOC,4BAAAA,cAAc,WAAW;;AAGlC,SAAS,qBACP,QACA,QACA;AACA,KAAI,CAAC,OAAQ;AACb,KAAI,MAAM,QAAQ,OAAO,EAAE;AACzB,SAAO,KAAK,GAAG,OAAO;AACtB;;AAEF,QAAO,KAAK,OAAO"}
|
|
@@ -14,7 +14,7 @@ let react_native = require("react-native");
|
|
|
14
14
|
function getNativeLocales() {
|
|
15
15
|
try {
|
|
16
16
|
if (react_native.Platform.OS === "web") return getWebLocales();
|
|
17
|
-
return require_NativeGtReactNative.
|
|
17
|
+
return require_NativeGtReactNative.GtReactNative.getNativeLocales() || [];
|
|
18
18
|
} catch {
|
|
19
19
|
return [];
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNativeLocales.js","names":["Platform","GtReactNative"],"sources":["../../../src/utils/getNativeLocales.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport GtReactNative from '../NativeGtReactNative';\n\n/**\n * Get native device locales in preference order\n * Returns an empty array if detection fails or is not supported\n *\n * iOS: Returns current locale first, followed by preferred languages\n * Android: Returns user's preferred language list (LocaleList on API 24+, single locale on older versions)\n * Web: Returns browser language preferences from navigator\n */\nexport function getNativeLocales(): string[] {\n try {\n // Web platform - use browser locale detection\n if (Platform.OS === 'web') {\n return getWebLocales();\n }\n\n // Try to get locales from native module\n return GtReactNative.getNativeLocales() || [];\n } catch {\n // Return empty array on any error (native module not available, etc.)\n return [];\n }\n}\n\n/**\n * Get browser locales for web platform\n */\nfunction getWebLocales(): string[] {\n try {\n if (typeof navigator === 'undefined') {\n return [];\n }\n\n const locales: string[] = [];\n\n // Use navigator.languages if available (most browsers)\n if (navigator.languages && Array.isArray(navigator.languages)) {\n locales.push(...navigator.languages);\n } else if (navigator.language) {\n // Fallback to single language\n locales.push(navigator.language);\n } else {\n // IE fallback\n const legacyNavigator = navigator as Navigator & {\n userLanguage?: string;\n };\n if (legacyNavigator.userLanguage) {\n locales.push(legacyNavigator.userLanguage);\n }\n }\n\n return locales;\n } catch {\n return [];\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBAA6B;AAC3C,KAAI;AAEF,MAAIA,aAAAA,SAAS,OAAO,MAClB,QAAO,eAAe;AAIxB,SAAOC,4BAAAA,
|
|
1
|
+
{"version":3,"file":"getNativeLocales.js","names":["Platform","GtReactNative"],"sources":["../../../src/utils/getNativeLocales.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { GtReactNative } from '../NativeGtReactNative';\n\n/**\n * Get native device locales in preference order\n * Returns an empty array if detection fails or is not supported\n *\n * iOS: Returns current locale first, followed by preferred languages\n * Android: Returns user's preferred language list (LocaleList on API 24+, single locale on older versions)\n * Web: Returns browser language preferences from navigator\n */\nexport function getNativeLocales(): string[] {\n try {\n // Web platform - use browser locale detection\n if (Platform.OS === 'web') {\n return getWebLocales();\n }\n\n // Try to get locales from native module\n return GtReactNative.getNativeLocales() || [];\n } catch {\n // Return empty array on any error (native module not available, etc.)\n return [];\n }\n}\n\n/**\n * Get browser locales for web platform\n */\nfunction getWebLocales(): string[] {\n try {\n if (typeof navigator === 'undefined') {\n return [];\n }\n\n const locales: string[] = [];\n\n // Use navigator.languages if available (most browsers)\n if (navigator.languages && Array.isArray(navigator.languages)) {\n locales.push(...navigator.languages);\n } else if (navigator.language) {\n // Fallback to single language\n locales.push(navigator.language);\n } else {\n // IE fallback\n const legacyNavigator = navigator as Navigator & {\n userLanguage?: string;\n };\n if (legacyNavigator.userLanguage) {\n locales.push(legacyNavigator.userLanguage);\n }\n }\n\n return locales;\n } catch {\n return [];\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,mBAA6B;AAC3C,KAAI;AAEF,MAAIA,aAAAA,SAAS,OAAO,MAClB,QAAO,eAAe;AAIxB,SAAOC,4BAAAA,cAAc,kBAAkB,IAAI,EAAE;SACvC;AAEN,SAAO,EAAE;;;;;;AAOb,SAAS,gBAA0B;AACjC,KAAI;AACF,MAAI,OAAO,cAAc,YACvB,QAAO,EAAE;EAGX,MAAM,UAAoB,EAAE;AAG5B,MAAI,UAAU,aAAa,MAAM,QAAQ,UAAU,UAAU,CAC3D,SAAQ,KAAK,GAAG,UAAU,UAAU;WAC3B,UAAU,SAEnB,SAAQ,KAAK,UAAU,SAAS;OAC3B;GAEL,MAAM,kBAAkB;AAGxB,OAAI,gBAAgB,aAClB,SAAQ,KAAK,gBAAgB,aAAa;;AAI9C,SAAO;SACD;AACN,SAAO,EAAE"}
|
|
@@ -11,12 +11,12 @@ let _generaltranslation_react_core_pure = require("@generaltranslation/react-cor
|
|
|
11
11
|
* This reads persisted native storage directly, so it can temporarily be out of
|
|
12
12
|
* sync with React state while a locale change is in progress.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* Defaults to the store key configured through initializeGT().
|
|
15
15
|
*
|
|
16
16
|
* @param key - The key to get the locale from
|
|
17
17
|
* @returns The locale from the native store
|
|
18
18
|
*/
|
|
19
|
-
function getLocaleFromNativeStore(key = _generaltranslation_react_core_pure.
|
|
19
|
+
function getLocaleFromNativeStore(key = (0, _generaltranslation_react_core_pure.getI18nConfig)().getLocaleCookieName()) {
|
|
20
20
|
return nativeStoreGet(key);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -32,7 +32,7 @@ function nativeStoreGet(key) {
|
|
|
32
32
|
}
|
|
33
33
|
return localStorage.getItem(key);
|
|
34
34
|
}
|
|
35
|
-
return require_NativeGtReactNative.
|
|
35
|
+
return require_NativeGtReactNative.GtReactNative.nativeStoreGet(key);
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Set a value in the native store
|
|
@@ -48,7 +48,7 @@ function nativeStoreSet(key, value) {
|
|
|
48
48
|
localStorage.setItem(key, value);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
require_NativeGtReactNative.
|
|
51
|
+
require_NativeGtReactNative.GtReactNative.nativeStoreSet(key, value);
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
exports.getLocaleFromNativeStore = getLocaleFromNativeStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeStore.js","names":["
|
|
1
|
+
{"version":3,"file":"nativeStore.js","names":["Platform","ssrUnsupportedWarning","GtReactNative"],"sources":["../../../src/utils/nativeStore.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { getI18nConfig } from '@generaltranslation/react-core/pure';\nimport { GtReactNative } from '../NativeGtReactNative';\nimport { ssrUnsupportedWarning } from '../errors-dir/warnings';\n\n/**\n * Get the locale from the native store.\n *\n * This reads persisted native storage directly, so it can temporarily be out of\n * sync with React state while a locale change is in progress.\n *\n * Defaults to the store key configured through initializeGT().\n *\n * @param key - The key to get the locale from\n * @returns The locale from the native store\n */\nexport function getLocaleFromNativeStore(\n key = getI18nConfig().getLocaleCookieName()\n): string | null {\n return nativeStoreGet(key);\n}\n\n/**\n * Get a value from the native store\n * @param key - The key to get the value for\n * @returns The value for the key\n */\nexport function nativeStoreGet(key: string): string | null {\n if (Platform.OS === 'web') {\n if (typeof localStorage === 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(ssrUnsupportedWarning);\n return null;\n }\n return localStorage.getItem(key);\n }\n return GtReactNative.nativeStoreGet(key);\n}\n\n/**\n * Set a value in the native store\n * @param key - The key to set the value for\n * @param value - The value to set\n */\nexport function nativeStoreSet(key: string, value: string): void {\n if (Platform.OS === 'web') {\n if (typeof localStorage === 'undefined') {\n // eslint-disable-next-line no-console\n console.warn(ssrUnsupportedWarning);\n return;\n }\n localStorage.setItem(key, value);\n return;\n }\n GtReactNative.nativeStoreSet(key, value);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAgB,yBACd,OAAA,GAAA,oCAAA,gBAAqB,CAAC,qBAAqB,EAC5B;AACf,QAAO,eAAe,IAAI;;;;;;;AAQ5B,SAAgB,eAAe,KAA4B;AACzD,KAAIA,aAAAA,SAAS,OAAO,OAAO;AACzB,MAAI,OAAO,iBAAiB,aAAa;AAEvC,WAAQ,KAAKC,4BAAAA,sBAAsB;AACnC,UAAO;;AAET,SAAO,aAAa,QAAQ,IAAI;;AAElC,QAAOC,4BAAAA,cAAc,eAAe,IAAI;;;;;;;AAQ1C,SAAgB,eAAe,KAAa,OAAqB;AAC/D,KAAIF,aAAAA,SAAS,OAAO,OAAO;AACzB,MAAI,OAAO,iBAAiB,aAAa;AAEvC,WAAQ,KAAKC,4BAAAA,sBAAsB;AACnC;;AAEF,eAAa,QAAQ,KAAK,MAAM;AAChC;;AAEF,6BAAA,cAAc,eAAe,KAAK,MAAM"}
|
|
@@ -3,8 +3,7 @@ require("../_virtual/_rolldown/runtime.js");
|
|
|
3
3
|
let gt_i18n_internal = require("gt-i18n/internal");
|
|
4
4
|
//#region src/utils/resolveLocale.ts
|
|
5
5
|
function resolveLocale(candidates) {
|
|
6
|
-
|
|
7
|
-
return i18nConfig.determineLocale(candidates ?? void 0) || i18nConfig.getDefaultLocale();
|
|
6
|
+
return (0, gt_i18n_internal.getI18nConfig)().resolveSupportedLocale(candidates ?? void 0);
|
|
8
7
|
}
|
|
9
8
|
//#endregion
|
|
10
9
|
exports.resolveLocale = resolveLocale;
|