gt-react-native 11.0.0-odysseus.9 → 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/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 +34 -9
- package/dist/commonjs/provider/GTProvider.js +32 -21
- package/dist/commonjs/provider/GTProvider.js.map +1 -1
- package/dist/commonjs/provider/NativeGTProvider.js +0 -3
- 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/nativeStore.js +2 -2
- 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/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 -11
- 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 +2 -3
- package/dist/module/index.d.ts.map +1 -1
- package/dist/module/index.js +3 -4
- 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 +0 -3
- 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/nativeStore.d.ts +1 -1
- package/dist/module/utils/nativeStore.d.ts.map +1 -1
- package/dist/module/utils/nativeStore.js +3 -3
- 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/condition-store/NativeConditionStore.ts +21 -40
- package/src/hooks/selectors.ts +17 -3
- package/src/index.tsx +5 -2
- 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/nativeStore.ts +3 -3
- 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/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/src/hooks/utils.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeConditionStore.js","names":[
|
|
1
|
+
{"version":3,"file":"NativeConditionStore.js","names":[],"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,UAAU,WAAW,CAAC;EAC/C,MAAM,SAAS,iBAAiB,EAC9B,QAAQ,OAAO,QAChB,CAAC;AACF,MAAI,WAAW,KAAA,EACb,MAAK,aAAa,OAAO;AAE3B,OAAK,iBACH,qBAAqB,EACnB,YAAY,OAAO,YACpB,CAAC,CACH;;CAGH,kBAA0B;AACxB,SAAO,WAAW;;CAGpB,aAAa,WAAmC;EAC9C,MAAM,aAAa,cAAc,OAAO;AACxC,iBAAe,mBAAmB,EAAE,WAAW;AAC/C,OAAK,OAAO,EAAE,QAAQ,YAAY,CAAC;;CAGrC,kBAAsC;AACpC,SAAO,eAAe,mBAAmB,CAAC,IAAI,KAAA;;CAGhD,aAAa,WAAqC;AAChD,OAAK,aAAa,OAAO;AACzB,OAAK,OAAO,EAAE,QAAQ,CAAC;;CAGzB,sBAA+B;AAC7B,SAAO,eAAe,uBAAuB,CAAC,KAAK;;CAGrD,iBAAiB,eAA8B;AAC7C,OAAK,iBAAiB,WAAW;AACjC,OAAK,OAAO,EAAE,YAAY,CAAC;;CAG7B,gBAAgB,WAAmC;AACjD,iBAAe,mBAAmB,EAAE,cAAc,OAAO,CAAC;;CAG5D,gBAAgB,WAAqC;AACnD,iBAAe,mBAAmB,EAAE,UAAU,GAAG;;CAGnD,oBAAoB,eAA8B;AAChD,iBAAe,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,QAAO,eAAe,CAAC,qBAAqB;;AAG9C,SAAS,oBAA4B;AACnC,QAAO,eAAe,CAAC,qBAAqB;;AAG9C,SAAS,wBAAgC;AACvC,QAAO,eAAe,CAAC,yBAAyB"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import type { InternalRegionSelectorOptions } from '@generaltranslation/react-core/hooks';
|
|
2
|
-
export declare function useLocaleSelector(locales?: string[]): {
|
|
3
|
-
locale: string;
|
|
4
|
-
locales: string[];
|
|
5
|
-
getLocaleProperties: (locale: string) => import("generaltranslation/internal").LocaleProperties;
|
|
1
|
+
import type { InternalLocaleSelectorResult, InternalRegionSelectorOptions, InternalRegionSelectorResult } from '@generaltranslation/react-core/hooks';
|
|
2
|
+
export declare function useLocaleSelector(locales?: string[]): InternalLocaleSelectorResult & {
|
|
6
3
|
setLocale: (locale: string) => void;
|
|
7
4
|
};
|
|
8
|
-
export declare function useRegionSelector(options?: InternalRegionSelectorOptions): {
|
|
9
|
-
region: string | undefined;
|
|
10
|
-
regions: string[];
|
|
11
|
-
regionData: Map<string, import("@generaltranslation/react-core/hooks").RegionData>;
|
|
12
|
-
locale: string;
|
|
13
|
-
localeRegion: string;
|
|
5
|
+
export declare function useRegionSelector(options?: InternalRegionSelectorOptions): InternalRegionSelectorResult & {
|
|
14
6
|
setLocale: (locale: string) => void;
|
|
15
7
|
setRegion: (region: string | undefined) => void;
|
|
16
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/hooks/selectors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/hooks/selectors.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAK9C,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,4BAA4B,GAAG;IAAE,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAGxE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,CAAC,EAAE,6BAA6B,GACtC,4BAA4B,GAAG;IAChC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACjD,CAIA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","names":[],"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":[],"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,WADS,cACA;EAAE,GAAG,0BAA0B,QAAQ;EAAE;;AAG7D,SAAgB,kBACd,SAIA;AAGA,QAAO;EAAE,WAFS,cAEA;EAAE,WADF,cACW;EAAE,GAAG,0BAA0B,QAAQ;EAAE"}
|
package/dist/module/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { Branch, Currency, DateTime, Derive, Num, Plural, RelativeTime, T, Var, } from '@generaltranslation/react-core/components';
|
|
2
2
|
export { GTProvider } from './provider/GTProvider';
|
|
3
|
-
export { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT,
|
|
3
|
+
export { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations, } from '@generaltranslation/react-core/hooks';
|
|
4
4
|
export { useSetLocale, useSetRegion, useSetEnableI18n, } from './hooks/condition-store';
|
|
5
5
|
export { useLocaleSelector, useRegionSelector } from './hooks/selectors';
|
|
6
|
-
export {
|
|
7
|
-
export { createRenderPipeline, decodeMsg, decodeOptions, decodeVars, declareVar, derive, getFormatLocales, getReactI18nCache, getTranslationsSnapshot, gtFallback, mFallback, msg, setReactI18nCache, } from '@generaltranslation/react-core/pure';
|
|
6
|
+
export { createRenderPipeline, decodeMsg, decodeOptions, decodeVars, declareVar, derive, getDefaultLocale, getFormatLocales, getLocales, resolveCanonicalLocale, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, setReactI18nCache, } from '@generaltranslation/react-core/pure';
|
|
8
7
|
export { getLocaleFromNativeStore } from './utils/nativeStore';
|
|
9
8
|
export { getLocale } from './utils/getLocale';
|
|
10
9
|
export { initializeGT } from './setup/initializeGT';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,GAAG,EACH,MAAM,EACN,YAAY,EACZ,CAAC,EACD,GAAG,GACJ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,GAAG,EACH,MAAM,EACN,YAAY,EACZ,CAAC,EACD,GAAG,GACJ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,SAAS,EACT,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,UAAU,EACV,SAAS,EACT,GAAG,EACH,iBAAiB,GAClB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,cAAc,EACd,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/module/index.js
CHANGED
|
@@ -3,9 +3,8 @@ import { getLocale } from "./utils/getLocale.js";
|
|
|
3
3
|
import { GTProvider } from "./provider/GTProvider.js";
|
|
4
4
|
import { useSetEnableI18n, useSetLocale, useSetRegion } from "./hooks/condition-store.js";
|
|
5
5
|
import { useLocaleSelector, useRegionSelector } from "./hooks/selectors.js";
|
|
6
|
-
import { useLocaleDirection, useVersionId } from "./hooks/utils.js";
|
|
7
6
|
import { initializeGT } from "./setup/initializeGT.js";
|
|
8
7
|
import { Branch, Currency, DateTime, Derive, Num, Plural, RelativeTime, T, Var } from "@generaltranslation/react-core/components";
|
|
9
|
-
import { createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getFormatLocales, getReactI18nCache, getTranslationsSnapshot, gtFallback, mFallback, msg, setReactI18nCache } from "@generaltranslation/react-core/pure";
|
|
10
|
-
import { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT,
|
|
11
|
-
export { Branch, Currency, DateTime, Derive, GTProvider, Num, Plural, RelativeTime, T, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getFormatLocales, getLocale, getLocaleFromNativeStore, getReactI18nCache, getTranslationsSnapshot, gtFallback, initializeGT, mFallback, msg, setReactI18nCache, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT,
|
|
8
|
+
import { createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, mFallback, msg, resolveCanonicalLocale, setReactI18nCache } from "@generaltranslation/react-core/pure";
|
|
9
|
+
import { useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocales, useMessages, useRegion, useTranslations } from "@generaltranslation/react-core/hooks";
|
|
10
|
+
export { Branch, Currency, DateTime, Derive, GTProvider, Num, Plural, RelativeTime, T, Var, createRenderPipeline, declareVar, decodeMsg, decodeOptions, decodeVars, derive, getDefaultLocale, getFormatLocales, getLocale, getLocaleFromNativeStore, getLocales, getReactI18nCache, getTranslationsSnapshot, getVersionId, gtFallback, initializeGT, mFallback, msg, resolveCanonicalLocale, setReactI18nCache, useCustomMapping, useDefaultLocale, useEnableI18n, useFormatLocales, useGT, useLocale, useLocaleDirection, useLocaleProperties, useLocaleSelector, useLocales, useMessages, useRegion, useRegionSelector, useSetEnableI18n, useSetLocale, useSetRegion, useTranslations };
|
|
@@ -5,7 +5,7 @@ import type { NativeConditionStoreParams } from '../condition-store/NativeCondit
|
|
|
5
5
|
export type GTProviderProps = Omit<InternalGTProviderProps, 'conditionStore' | 'i18nStore' | 'translations'> & Omit<NativeConditionStoreParams, 'locale' | '_reload'> & {
|
|
6
6
|
children?: ReactNode;
|
|
7
7
|
locale?: LocaleCandidates;
|
|
8
|
-
|
|
8
|
+
fallback?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export declare function GTProvider(props: GTProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
//# sourceMappingURL=GTProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"GTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/GTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAU,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAE3B,MAAM,yCAAyC,CAAC;AAajD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,GAAG,cAAc,CAChD,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,GAAG,SAAS,CAAC,GAAG;IACvD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAKJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,2CAEhD"}
|
|
@@ -8,34 +8,25 @@ import { Suspense, use, useCallback, useMemo, useState } from "react";
|
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
//#region src/provider/GTProvider.tsx
|
|
10
10
|
function GTProvider(props) {
|
|
11
|
-
|
|
12
|
-
return /* @__PURE__ */ jsx(Suspense, {
|
|
13
|
-
fallback: loadingFallback ?? /* @__PURE__ */ jsx(DefaultLoadingFallback, {}),
|
|
14
|
-
children: /* @__PURE__ */ jsx(LoadableGTProvider, { ...providerProps })
|
|
15
|
-
});
|
|
11
|
+
return /* @__PURE__ */ jsx(LoadableGTProvider, { ...props });
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
14
|
* This wrapper takes the place of a loader that would be present in
|
|
19
15
|
* SSR style applications.
|
|
20
16
|
*/
|
|
21
17
|
function LoadableGTProvider(props) {
|
|
22
|
-
const {
|
|
18
|
+
const { fallback, ...providerProps } = props;
|
|
19
|
+
const renderedFallback = fallback ?? /* @__PURE__ */ jsx(DefaultLoadingFallback, {});
|
|
20
|
+
const { locale, region, enableI18n } = providerProps;
|
|
23
21
|
const [nativeConditions, setNativeConditions] = useState(() => ({
|
|
24
|
-
locale: getLocale(
|
|
25
|
-
region: getInitialRegion({
|
|
26
|
-
|
|
27
|
-
regionStoreKey
|
|
28
|
-
}),
|
|
29
|
-
enableI18n: getInitialEnableI18n({
|
|
30
|
-
enableI18n,
|
|
31
|
-
enableI18nStoreKey
|
|
32
|
-
})
|
|
22
|
+
locale: getLocale(),
|
|
23
|
+
region: getInitialRegion({ region }),
|
|
24
|
+
enableI18n: getInitialEnableI18n({ enableI18n })
|
|
33
25
|
}));
|
|
34
26
|
const activeLocale = resolveLocale(locale ?? nativeConditions.locale);
|
|
35
27
|
const activeRegion = region ?? nativeConditions.region;
|
|
36
28
|
const activeEnableI18n = enableI18n ?? nativeConditions.enableI18n;
|
|
37
|
-
const
|
|
38
|
-
const translations = useMemo(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
29
|
+
const fallbackTranslations = useMemo(() => ({ [activeLocale]: {} }), [activeLocale]);
|
|
39
30
|
const reload = useCallback((state) => {
|
|
40
31
|
setNativeConditions((previousState) => ({
|
|
41
32
|
locale: locale === void 0 ? state.locale : previousState.locale,
|
|
@@ -47,13 +38,33 @@ function LoadableGTProvider(props) {
|
|
|
47
38
|
locale,
|
|
48
39
|
region
|
|
49
40
|
]);
|
|
41
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
42
|
+
fallback: /* @__PURE__ */ jsx(NativeGTProvider, {
|
|
43
|
+
...providerProps,
|
|
44
|
+
locale: activeLocale,
|
|
45
|
+
region: activeRegion,
|
|
46
|
+
enableI18n: activeEnableI18n,
|
|
47
|
+
translations: fallbackTranslations,
|
|
48
|
+
_reload: reload,
|
|
49
|
+
children: renderedFallback
|
|
50
|
+
}),
|
|
51
|
+
children: /* @__PURE__ */ jsx(LoadedGTProvider, {
|
|
52
|
+
...providerProps,
|
|
53
|
+
locale: activeLocale,
|
|
54
|
+
region: activeRegion,
|
|
55
|
+
enableI18n: activeEnableI18n,
|
|
56
|
+
_reload: reload
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function LoadedGTProvider(props) {
|
|
61
|
+
const activeLocale = resolveLocale(props.locale);
|
|
62
|
+
const localeTranslations = use(loadTranslations(activeLocale));
|
|
63
|
+
const translations = useMemo(() => ({ [activeLocale]: localeTranslations }), [activeLocale, localeTranslations]);
|
|
50
64
|
return /* @__PURE__ */ jsx(NativeGTProvider, {
|
|
51
65
|
...props,
|
|
52
66
|
locale: activeLocale,
|
|
53
|
-
|
|
54
|
-
enableI18n: activeEnableI18n,
|
|
55
|
-
translations,
|
|
56
|
-
_reload: reload
|
|
67
|
+
translations
|
|
57
68
|
});
|
|
58
69
|
}
|
|
59
70
|
function DefaultLoadingFallback() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GTProvider.js","names":[],"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 {
|
|
1
|
+
{"version":3,"file":"GTProvider.js","names":[],"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,oBAAC,oBAAD,EAAoB,GAAI,OAAS,CAAA;;;;;;AAO1C,SAAS,mBAAmB,OAAwB;CAClD,MAAM,EAAE,UAAU,GAAG,kBAAkB;CACvC,MAAM,mBAAmB,YAAY,oBAAC,wBAAD,EAA0B,CAAA;CAC/D,MAAM,EAAE,QAAQ,QAAQ,eAAe;CAEvC,MAAM,CAAC,kBAAkB,uBACvB,gBAA2C;EACzC,QAAQ,WAAW;EACnB,QAAQ,iBAAiB,EAAE,QAAQ,CAAC;EACpC,YAAY,qBAAqB,EAAE,YAAY,CAAC;EACjD,EAAE;CACL,MAAM,eAAe,cAAc,UAAU,iBAAiB,OAAO;CACrE,MAAM,eAAe,UAAU,iBAAiB;CAChD,MAAM,mBAAmB,cAAc,iBAAiB;CACxD,MAAM,uBAAuB,eACpB,GAAG,eAAe,EAAE,EAAE,GAC7B,CAAC,aAAa,CACf;CACD,MAAM,SAAS,aACZ,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,oBAAC,UAAD;EACE,UACE,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,cAAc;GACd,SAAS;aAER;GACgB,CAAA;YAGrB,oBAAC,kBAAD;GACE,GAAI;GACJ,QAAQ;GACR,QAAQ;GACR,YAAY;GACZ,SAAS;GACT,CAAA;EACO,CAAA;;AAIf,SAAS,iBAAiB,OAA8B;CACtD,MAAM,eAAe,cAAc,MAAM,OAAO;CAChD,MAAM,qBAAqB,IAAI,iBAAiB,aAAa,CAAC;CAC9D,MAAM,eAAe,eACZ,GAAG,eAAe,oBAAoB,GAC7C,CAAC,cAAc,mBAAmB,CACnC;AAED,QACE,oBAAC,kBAAD;EACE,GAAI;EACJ,QAAQ;EACM;EACd,CAAA;;AAIN,SAAS,yBAAyB;AAChC,QACE,oBAAC,MAAD;EAAM,OAAO,OAAO;YAClB,oBAAC,mBAAD,EAAqB,CAAA;EAChB,CAAA;;AAIX,MAAM,SAAS,WAAW,OAAO,EAC/B,kBAAkB;CAChB,MAAM;CACN,YAAY;CACZ,gBAAgB;CACjB,EACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,CAC/B,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"NativeGTProvider.d.ts","sourceRoot":"","sources":["../../../src/provider/NativeGTProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAG1F,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,uBAAuB,EACvB,gBAAgB,GAAG,WAAW,CAC/B,GACC,IAAI,CAAC,0BAA0B,EAAE,QAAQ,CAAC,GAAG;IAC3C,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,2CAiB5D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeGTProvider.js","names":[],"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":[],"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,iBAAiB,cAAc;AACnC,SAAO,IAAI,qBAAqB,MAAM;IACrC;EAAC,MAAM;EAAQ,MAAM;EAAQ,MAAM;EAAY,MAAM;EAAQ,CAAC;CAEjE,MAAM,eAAe,OAAyB,KAAK;AACnD,KAAI,aAAa,WAAW,KAC1B,cAAa,UAAU,IAAI,WAAW;AAGxC,QACE,oBAAC,oBAAD;EACE,GAAI;EACY;EAChB,WAAW,aAAa;EACxB,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { ReactI18nCacheParams } from '@generaltranslation/react-core/pure';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export declare function initializeGT(config: InitializeGTParams): void;
|
|
1
|
+
import type { I18nConfigParams, ReactI18nCacheParams } from '@generaltranslation/react-core/pure';
|
|
2
|
+
export type InitializeGTParams = I18nConfigParams & ReactI18nCacheParams;
|
|
3
|
+
export { internalInitializeGTSRA as initializeGT } from '@generaltranslation/react-core/pure';
|
|
5
4
|
//# sourceMappingURL=initializeGT.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeGT.d.ts","sourceRoot":"","sources":["../../../src/setup/initializeGT.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializeGT.d.ts","sourceRoot":"","sources":["../../../src/setup/initializeGT.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,qCAAqC,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AAKzE,OAAO,EAAE,uBAAuB,IAAI,YAAY,EAAE,MAAM,qCAAqC,CAAC"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { setupGTServicesEnabled } from "gt-i18n/internal";
|
|
3
|
-
//#region src/setup/initializeGT.ts
|
|
4
|
-
function initializeGT(config) {
|
|
5
|
-
setupGTServicesEnabled(config);
|
|
6
|
-
initializeI18nConfig(config, "server-render");
|
|
7
|
-
setReactI18nCache(new ReactI18nCache(config));
|
|
8
|
-
}
|
|
9
|
-
//#endregion
|
|
1
|
+
import { internalInitializeGTSRA as initializeGT } from "@generaltranslation/react-core/pure";
|
|
10
2
|
export { initializeGT };
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=initializeGT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInitialNativeConditions.d.ts","sourceRoot":"","sources":["../../../src/utils/getInitialNativeConditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"getInitialNativeConditions.d.ts","sourceRoot":"","sources":["../../../src/utils/getInitialNativeConditions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAI3E,KAAK,mBAAmB,GAAG,IAAI,CAAC,4BAA4B,EAAE,QAAQ,CAAC,GAAG;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,KAAK,uBAAuB,GAAG,IAAI,CACjC,4BAA4B,EAC5B,YAAY,CACb,GAAG;IACF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,cAAsD,GACvD,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAG1C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,UAAU,EACV,kBAA8D,GAC/D,EAAE,uBAAuB,GAAG,OAAO,CAKnC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { nativeStoreGet } from "./nativeStore.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getI18nConfig } from "@generaltranslation/react-core/pure";
|
|
3
3
|
//#region src/utils/getInitialNativeConditions.ts
|
|
4
|
-
function getInitialRegion({ region, regionStoreKey =
|
|
4
|
+
function getInitialRegion({ region, regionStoreKey = getI18nConfig().getRegionCookieName() }) {
|
|
5
5
|
if (region !== void 0) return region;
|
|
6
6
|
return nativeStoreGet(regionStoreKey) || void 0;
|
|
7
7
|
}
|
|
8
|
-
function getInitialEnableI18n({ enableI18n, enableI18nStoreKey =
|
|
8
|
+
function getInitialEnableI18n({ enableI18n, enableI18nStoreKey = getI18nConfig().getEnableI18nCookieName() }) {
|
|
9
9
|
if (enableI18n !== void 0) return enableI18n;
|
|
10
10
|
const storedEnableI18n = nativeStoreGet(enableI18nStoreKey);
|
|
11
11
|
if (storedEnableI18n === null) return true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInitialNativeConditions.js","names":[
|
|
1
|
+
{"version":3,"file":"getInitialNativeConditions.js","names":[],"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,iBAAiB,eAAe,CAAC,qBAAqB,IACZ;AAC1C,KAAI,WAAW,KAAA,EAAW,QAAO;AACjC,QAAO,eAAe,eAAe,IAAI,KAAA;;AAG3C,SAAgB,qBAAqB,EACnC,YACA,qBAAqB,eAAe,CAAC,yBAAyB,IAC3B;AACnC,KAAI,eAAe,KAAA,EAAW,QAAO;CACrC,MAAM,mBAAmB,eAAe,mBAAmB;AAC3D,KAAI,qBAAqB,KAAM,QAAO;AACtC,QAAO,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.d.ts","sourceRoot":"","sources":["../../../src/utils/getLocale.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,
|
|
1
|
+
{"version":3,"file":"getLocale.d.ts","sourceRoot":"","sources":["../../../src/utils/getLocale.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,EACxB,cAAsD,GACvD,GAAE,eAAoB,GAAG,MAAM,CAM/B"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getNativeLocales } from "./getNativeLocales.js";
|
|
2
2
|
import { nativeStoreGet } from "./nativeStore.js";
|
|
3
3
|
import { resolveLocale } from "./resolveLocale.js";
|
|
4
|
-
import {
|
|
4
|
+
import { getI18nConfig } from "@generaltranslation/react-core/pure";
|
|
5
5
|
//#region src/utils/getLocale.ts
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
8
8
|
*/
|
|
9
|
-
function getLocale({ localeStoreKey =
|
|
9
|
+
function getLocale({ localeStoreKey = getI18nConfig().getLocaleCookieName() } = {}) {
|
|
10
10
|
const candidates = [];
|
|
11
11
|
pushLocaleCandidates(candidates, nativeStoreGet(localeStoreKey));
|
|
12
12
|
candidates.push(...getNativeLocales());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocale.js","names":[
|
|
1
|
+
{"version":3,"file":"getLocale.js","names":[],"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,iBAAiB,eAAe,CAAC,qBAAqB,KACnC,EAAE,EAAU;CAC/B,MAAM,aAAuB,EAAE;AAC/B,sBAAqB,YAAY,eAAe,eAAe,CAAC;AAChE,YAAW,KAAK,GAAG,kBAAkB,CAAC;AAEtC,QAAO,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"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This reads persisted native storage directly, so it can temporarily be out of
|
|
5
5
|
* sync with React state while a locale change is in progress.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Defaults to the store key configured through initializeGT().
|
|
8
8
|
*
|
|
9
9
|
* @param key - The key to get the locale from
|
|
10
10
|
* @returns The locale from the native store
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeStore.d.ts","sourceRoot":"","sources":["../../../src/utils/nativeStore.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,
|
|
1
|
+
{"version":3,"file":"nativeStore.d.ts","sourceRoot":"","sources":["../../../src/utils/nativeStore.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,SAAwC,GAC1C,MAAM,GAAG,IAAI,CAEf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUzD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAW/D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GtReactNative } from "../NativeGtReactNative.js";
|
|
2
2
|
import { ssrUnsupportedWarning } from "../errors-dir/warnings.js";
|
|
3
3
|
import { Platform } from "react-native";
|
|
4
|
-
import {
|
|
4
|
+
import { getI18nConfig } from "@generaltranslation/react-core/pure";
|
|
5
5
|
//#region src/utils/nativeStore.ts
|
|
6
6
|
/**
|
|
7
7
|
* Get the locale from the native store.
|
|
@@ -9,12 +9,12 @@ import { defaultLocaleCookieName } from "@generaltranslation/react-core/pure";
|
|
|
9
9
|
* This reads persisted native storage directly, so it can temporarily be out of
|
|
10
10
|
* sync with React state while a locale change is in progress.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Defaults to the store key configured through initializeGT().
|
|
13
13
|
*
|
|
14
14
|
* @param key - The key to get the locale from
|
|
15
15
|
* @returns The locale from the native store
|
|
16
16
|
*/
|
|
17
|
-
function getLocaleFromNativeStore(key =
|
|
17
|
+
function getLocaleFromNativeStore(key = getI18nConfig().getLocaleCookieName()) {
|
|
18
18
|
return nativeStoreGet(key);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeStore.js","names":[
|
|
1
|
+
{"version":3,"file":"nativeStore.js","names":[],"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,MAAM,eAAe,CAAC,qBAAqB,EAC5B;AACf,QAAO,eAAe,IAAI;;;;;;;AAQ5B,SAAgB,eAAe,KAA4B;AACzD,KAAI,SAAS,OAAO,OAAO;AACzB,MAAI,OAAO,iBAAiB,aAAa;AAEvC,WAAQ,KAAK,sBAAsB;AACnC,UAAO;;AAET,SAAO,aAAa,QAAQ,IAAI;;AAElC,QAAO,cAAc,eAAe,IAAI;;;;;;;AAQ1C,SAAgB,eAAe,KAAa,OAAqB;AAC/D,KAAI,SAAS,OAAO,OAAO;AACzB,MAAI,OAAO,iBAAiB,aAAa;AAEvC,WAAQ,KAAK,sBAAsB;AACnC;;AAEF,eAAa,QAAQ,KAAK,MAAM;AAChC;;AAEF,eAAc,eAAe,KAAK,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLocale.d.ts","sourceRoot":"","sources":["../../../src/utils/resolveLocale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"resolveLocale.d.ts","sourceRoot":"","sources":["../../../src/utils/resolveLocale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,wBAAgB,aAAa,CAAC,UAAU,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,MAAM,CAE1E"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { getI18nConfig } from "gt-i18n/internal";
|
|
2
2
|
//#region src/utils/resolveLocale.ts
|
|
3
3
|
function resolveLocale(candidates) {
|
|
4
|
-
|
|
5
|
-
return i18nConfig.determineLocale(candidates ?? void 0) || i18nConfig.getDefaultLocale();
|
|
4
|
+
return getI18nConfig().resolveSupportedLocale(candidates ?? void 0);
|
|
6
5
|
}
|
|
7
6
|
//#endregion
|
|
8
7
|
export { resolveLocale };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLocale.js","names":[],"sources":["../../../src/utils/resolveLocale.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\n\nexport function resolveLocale(candidates?: LocaleCandidates | null): string {\n
|
|
1
|
+
{"version":3,"file":"resolveLocale.js","names":[],"sources":["../../../src/utils/resolveLocale.ts"],"sourcesContent":["import { getI18nConfig } from 'gt-i18n/internal';\nimport type { LocaleCandidates } from 'gt-i18n/internal/types';\n\nexport function resolveLocale(candidates?: LocaleCandidates | null): string {\n return getI18nConfig().resolveSupportedLocale(candidates ?? undefined);\n}\n"],"mappings":";;AAGA,SAAgB,cAAc,YAA8C;AAC1E,QAAO,eAAe,CAAC,uBAAuB,cAAc,KAAA,EAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gt-react-native",
|
|
3
|
-
"version": "11.0.0
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "An i18n package for React Native",
|
|
5
5
|
"main": "./dist/commonjs/index.js",
|
|
6
6
|
"module": "./dist/module/index.js",
|
|
@@ -92,11 +92,11 @@
|
|
|
92
92
|
"@formatjs/intl-numberformat": "^8.15.6",
|
|
93
93
|
"@formatjs/intl-pluralrules": "^5.4.6",
|
|
94
94
|
"@formatjs/intl-relativetimeformat": "^11.4.13",
|
|
95
|
-
"@generaltranslation/format": "0.1.2
|
|
96
|
-
"@generaltranslation/react-core": "11.0.0
|
|
97
|
-
"@generaltranslation/supported-locales": "2.1.2
|
|
98
|
-
"generaltranslation": "9.0.0
|
|
99
|
-
"gt-i18n": "1.0.0
|
|
95
|
+
"@generaltranslation/format": "0.1.2",
|
|
96
|
+
"@generaltranslation/react-core": "11.0.0",
|
|
97
|
+
"@generaltranslation/supported-locales": "2.1.2",
|
|
98
|
+
"generaltranslation": "9.0.0",
|
|
99
|
+
"gt-i18n": "1.0.0"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
102
|
"@babel/core": "^7.28.4",
|
|
@@ -3,11 +3,7 @@ import type {
|
|
|
3
3
|
WritableConditionStoreInterface,
|
|
4
4
|
WritableConditionStoreParams,
|
|
5
5
|
} from 'gt-i18n/internal/types';
|
|
6
|
-
import {
|
|
7
|
-
defaultEnableI18nCookieName as defaultEnableI18nStoreKey,
|
|
8
|
-
defaultLocaleCookieName as defaultLocaleStoreKey,
|
|
9
|
-
defaultRegionCookieName as defaultRegionStoreKey,
|
|
10
|
-
} from '@generaltranslation/react-core/pure';
|
|
6
|
+
import { getI18nConfig } from '@generaltranslation/react-core/pure';
|
|
11
7
|
import { getLocale } from '../utils/getLocale';
|
|
12
8
|
import {
|
|
13
9
|
getInitialEnableI18n,
|
|
@@ -17,9 +13,6 @@ import { nativeStoreGet, nativeStoreSet } from '../utils/nativeStore';
|
|
|
17
13
|
import { resolveLocale } from '../utils/resolveLocale';
|
|
18
14
|
|
|
19
15
|
export type NativeConditionStoreParams = WritableConditionStoreParams & {
|
|
20
|
-
localeStoreKey?: string;
|
|
21
|
-
regionStoreKey?: string;
|
|
22
|
-
enableI18nStoreKey?: string;
|
|
23
16
|
_reload?: ReloadType;
|
|
24
17
|
};
|
|
25
18
|
|
|
@@ -35,24 +28,14 @@ export type ReloadType = (state: NativeConditionStoreState) => void;
|
|
|
35
28
|
* Condition store implementation for React Native.
|
|
36
29
|
*/
|
|
37
30
|
export class NativeConditionStore implements WritableConditionStoreInterface {
|
|
38
|
-
private localeStoreKey: string;
|
|
39
|
-
private regionStoreKey: string;
|
|
40
|
-
private enableI18nStoreKey: string;
|
|
41
31
|
private customReload: ReloadType;
|
|
42
32
|
|
|
43
33
|
constructor(config: NativeConditionStoreParams) {
|
|
44
34
|
this.customReload = config._reload ?? (() => undefined);
|
|
45
|
-
this.localeStoreKey = config.localeStoreKey ?? defaultLocaleStoreKey;
|
|
46
|
-
this.regionStoreKey = config.regionStoreKey ?? defaultRegionStoreKey;
|
|
47
|
-
this.enableI18nStoreKey =
|
|
48
|
-
config.enableI18nStoreKey ?? defaultEnableI18nStoreKey;
|
|
49
35
|
|
|
50
|
-
this.updateLocale(
|
|
51
|
-
config.locale ?? getLocale({ localeStoreKey: this.localeStoreKey })
|
|
52
|
-
);
|
|
36
|
+
this.updateLocale(config.locale ?? getLocale());
|
|
53
37
|
const region = getInitialRegion({
|
|
54
38
|
region: config.region,
|
|
55
|
-
regionStoreKey: this.regionStoreKey,
|
|
56
39
|
});
|
|
57
40
|
if (region !== undefined) {
|
|
58
41
|
this.updateRegion(region);
|
|
@@ -60,36 +43,22 @@ export class NativeConditionStore implements WritableConditionStoreInterface {
|
|
|
60
43
|
this.updateEnableI18n(
|
|
61
44
|
getInitialEnableI18n({
|
|
62
45
|
enableI18n: config.enableI18n,
|
|
63
|
-
enableI18nStoreKey: this.enableI18nStoreKey,
|
|
64
46
|
})
|
|
65
47
|
);
|
|
66
48
|
}
|
|
67
49
|
|
|
68
|
-
updateConfig = ({
|
|
69
|
-
localeStoreKey,
|
|
70
|
-
regionStoreKey,
|
|
71
|
-
enableI18nStoreKey,
|
|
72
|
-
}: Pick<
|
|
73
|
-
NativeConditionStoreParams,
|
|
74
|
-
'localeStoreKey' | 'regionStoreKey' | 'enableI18nStoreKey'
|
|
75
|
-
>): void => {
|
|
76
|
-
this.localeStoreKey = localeStoreKey ?? defaultLocaleStoreKey;
|
|
77
|
-
this.regionStoreKey = regionStoreKey ?? defaultRegionStoreKey;
|
|
78
|
-
this.enableI18nStoreKey = enableI18nStoreKey ?? defaultEnableI18nStoreKey;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
50
|
getLocale = (): string => {
|
|
82
|
-
return getLocale(
|
|
51
|
+
return getLocale();
|
|
83
52
|
};
|
|
84
53
|
|
|
85
54
|
setLocale = (locale: LocaleCandidates): void => {
|
|
86
55
|
const nextLocale = resolveLocale(locale);
|
|
87
|
-
nativeStoreSet(
|
|
56
|
+
nativeStoreSet(getLocaleStoreKey(), nextLocale);
|
|
88
57
|
this.reload({ locale: nextLocale });
|
|
89
58
|
};
|
|
90
59
|
|
|
91
60
|
getRegion = (): string | undefined => {
|
|
92
|
-
return nativeStoreGet(
|
|
61
|
+
return nativeStoreGet(getRegionStoreKey()) || undefined;
|
|
93
62
|
};
|
|
94
63
|
|
|
95
64
|
setRegion = (region: string | undefined): void => {
|
|
@@ -98,7 +67,7 @@ export class NativeConditionStore implements WritableConditionStoreInterface {
|
|
|
98
67
|
};
|
|
99
68
|
|
|
100
69
|
getEnableI18n = (): boolean => {
|
|
101
|
-
return nativeStoreGet(
|
|
70
|
+
return nativeStoreGet(getEnableI18nStoreKey()) !== 'false';
|
|
102
71
|
};
|
|
103
72
|
|
|
104
73
|
setEnableI18n = (enableI18n: boolean): void => {
|
|
@@ -107,15 +76,15 @@ export class NativeConditionStore implements WritableConditionStoreInterface {
|
|
|
107
76
|
};
|
|
108
77
|
|
|
109
78
|
updateLocale = (locale: LocaleCandidates): void => {
|
|
110
|
-
nativeStoreSet(
|
|
79
|
+
nativeStoreSet(getLocaleStoreKey(), resolveLocale(locale));
|
|
111
80
|
};
|
|
112
81
|
|
|
113
82
|
updateRegion = (region: string | undefined): void => {
|
|
114
|
-
nativeStoreSet(
|
|
83
|
+
nativeStoreSet(getRegionStoreKey(), region ?? '');
|
|
115
84
|
};
|
|
116
85
|
|
|
117
86
|
updateEnableI18n = (enableI18n: boolean): void => {
|
|
118
|
-
nativeStoreSet(
|
|
87
|
+
nativeStoreSet(getEnableI18nStoreKey(), enableI18n ? 'true' : 'false');
|
|
119
88
|
};
|
|
120
89
|
|
|
121
90
|
reload = (state: Partial<NativeConditionStoreState> = {}): void => {
|
|
@@ -126,3 +95,15 @@ export class NativeConditionStore implements WritableConditionStoreInterface {
|
|
|
126
95
|
});
|
|
127
96
|
};
|
|
128
97
|
}
|
|
98
|
+
|
|
99
|
+
function getLocaleStoreKey(): string {
|
|
100
|
+
return getI18nConfig().getLocaleCookieName();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function getRegionStoreKey(): string {
|
|
104
|
+
return getI18nConfig().getRegionCookieName();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getEnableI18nStoreKey(): string {
|
|
108
|
+
return getI18nConfig().getEnableI18nCookieName();
|
|
109
|
+
}
|