react-intlayer 9.5.0 → 9.5.1
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/cjs/client/useLocale.cjs +16 -15
- package/dist/cjs/client/useLocale.cjs.map +1 -1
- package/dist/cjs/server/useLocale.cjs +1 -1
- package/dist/cjs/server/useLocale.cjs.map +1 -1
- package/dist/esm/client/useLocale.mjs +16 -15
- package/dist/esm/client/useLocale.mjs.map +1 -1
- package/dist/esm/server/useLocale.mjs +1 -1
- package/dist/esm/server/useLocale.mjs.map +1 -1
- package/dist/types/client/useLocale.d.ts.map +1 -1
- package/dist/types/client/useLocaleBase.d.ts +2 -2
- package/dist/types/server/useLocale.d.ts.map +1 -1
- package/package.json +8 -8
|
@@ -7,6 +7,7 @@ let _intlayer_config_built = require("@intlayer/config/built");
|
|
|
7
7
|
let react = require("react");
|
|
8
8
|
|
|
9
9
|
//#region src/client/useLocale.ts
|
|
10
|
+
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
10
11
|
/**
|
|
11
12
|
* Client-side hook to get the current locale and related locale management functions.
|
|
12
13
|
*
|
|
@@ -31,26 +32,26 @@ let react = require("react");
|
|
|
31
32
|
* ```
|
|
32
33
|
*/
|
|
33
34
|
const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
34
|
-
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
35
35
|
const { locale, setLocale: setLocaleState, isCookieEnabled: isCookieEnabledContext } = (0, react.useContext)(require_client_IntlayerProvider.IntlayerClientContext) ?? {};
|
|
36
|
+
const setLocale = (0, react.useCallback)((locale) => {
|
|
37
|
+
if (!availableLocales?.map(String).includes(locale)) {
|
|
38
|
+
console.error(`Locale ${locale} is not available`);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
setLocaleState(locale);
|
|
42
|
+
require_client_useLocaleStorage.setLocaleInStorage(locale, isCookieEnabled ?? isCookieEnabledContext ?? true);
|
|
43
|
+
onLocaleChange?.(locale);
|
|
44
|
+
}, [
|
|
45
|
+
availableLocales,
|
|
46
|
+
onLocaleChange,
|
|
47
|
+
setLocaleState,
|
|
48
|
+
isCookieEnabled
|
|
49
|
+
]);
|
|
36
50
|
return {
|
|
37
51
|
locale,
|
|
38
52
|
defaultLocale,
|
|
39
53
|
availableLocales,
|
|
40
|
-
setLocale
|
|
41
|
-
if (!availableLocales?.map(String).includes(locale)) {
|
|
42
|
-
console.error(`Locale ${locale} is not available`);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
setLocaleState(locale);
|
|
46
|
-
require_client_useLocaleStorage.setLocaleInStorage(locale, isCookieEnabled ?? isCookieEnabledContext ?? true);
|
|
47
|
-
onLocaleChange?.(locale);
|
|
48
|
-
}, [
|
|
49
|
-
availableLocales,
|
|
50
|
-
onLocaleChange,
|
|
51
|
-
setLocaleState,
|
|
52
|
-
isCookieEnabled
|
|
53
|
-
])
|
|
54
|
+
setLocale
|
|
54
55
|
};
|
|
55
56
|
};
|
|
56
57
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.cjs","names":["internationalization","useContext","IntlayerClientContext","useCallback"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useCallback, useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Client-side hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'react-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {
|
|
1
|
+
{"version":3,"file":"useLocale.cjs","names":["internationalization","useContext","IntlayerClientContext","useCallback"],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useCallback, useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * Client-side hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'react-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext) ?? {};\n\n const setLocale = useCallback(\n (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n onLocaleChange?.(locale as DeclaredLocales);\n },\n [availableLocales, onLocaleChange, setLocaleState, isCookieEnabled]\n );\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;;AAuBA,MAAM,EAAE,eAAe,SAAS,qBAAqBA,+CAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,MAAa,aAAa,EACxB,iBACA,mBACkB,CAAC,MAAuB;CAC1C,MAAM,EACJ,QACA,WAAW,gBACX,iBAAiB,+BACfC,kBAAWC,qDAAqB,KAAK,CAAC;CAE1C,MAAM,gBAAYC,oBACf,WAA0B;EACzB,IAAI,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG;GACnD,QAAQ,MAAM,UAAU,OAAO,kBAAkB;GACjD;EACF;EAEA,eAAe,MAAM;EACrB,mDACE,QACA,mBAAmB,0BAA0B,IAC/C;EACA,iBAAiB,MAAyB;CAC5C,GACA;EAAC;EAAkB;EAAgB;EAAgB;CAAe,CACpE;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -4,13 +4,13 @@ const require_server_IntlayerServerProvider = require('./IntlayerServerProvider.
|
|
|
4
4
|
let _intlayer_config_built = require("@intlayer/config/built");
|
|
5
5
|
|
|
6
6
|
//#region src/server/useLocale.ts
|
|
7
|
+
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
7
8
|
/**
|
|
8
9
|
* On the server side, Hook that picking one dictionary by its key and return the content
|
|
9
10
|
*
|
|
10
11
|
* If the locale is not provided, it will use the locale from the server context
|
|
11
12
|
*/
|
|
12
13
|
const useLocale = () => {
|
|
13
|
-
const { defaultLocale, locales: availableLocales } = _intlayer_config_built.internationalization ?? {};
|
|
14
14
|
return {
|
|
15
15
|
locale: require_server_serverContext.getServerContext(require_server_IntlayerServerProvider.IntlayerServerContext) ?? defaultLocale,
|
|
16
16
|
defaultLocale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.cjs","names":["internationalization","getServerContext","IntlayerServerContext"],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n};\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = (): UseLocaleResult => {\n const
|
|
1
|
+
{"version":3,"file":"useLocale.cjs","names":["internationalization","getServerContext","IntlayerServerContext"],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = (): UseLocaleResult => {\n const locale = (getServerContext(IntlayerServerContext) ??\n defaultLocale) as DeclaredLocales;\n\n return { locale, defaultLocale, availableLocales };\n};\n"],"mappings":";;;;;;AAWA,MAAM,EAAE,eAAe,SAAS,qBAAqBA,+CAAwB,CAAC;;;;;;AAO9E,MAAa,kBAAmC;CAI9C,OAAO;EAAE,QAHOC,8CAAiBC,2DAAqB,KACpD;EAEe;EAAe;CAAiB;AACnD"}
|
|
@@ -6,6 +6,7 @@ import { internationalization } from "@intlayer/config/built";
|
|
|
6
6
|
import { useCallback, useContext } from "react";
|
|
7
7
|
|
|
8
8
|
//#region src/client/useLocale.ts
|
|
9
|
+
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
9
10
|
/**
|
|
10
11
|
* Client-side hook to get the current locale and related locale management functions.
|
|
11
12
|
*
|
|
@@ -30,26 +31,26 @@ import { useCallback, useContext } from "react";
|
|
|
30
31
|
* ```
|
|
31
32
|
*/
|
|
32
33
|
const useLocale = ({ isCookieEnabled, onLocaleChange } = {}) => {
|
|
33
|
-
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
34
34
|
const { locale, setLocale: setLocaleState, isCookieEnabled: isCookieEnabledContext } = useContext(IntlayerClientContext) ?? {};
|
|
35
|
+
const setLocale = useCallback((locale) => {
|
|
36
|
+
if (!availableLocales?.map(String).includes(locale)) {
|
|
37
|
+
console.error(`Locale ${locale} is not available`);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
setLocaleState(locale);
|
|
41
|
+
setLocaleInStorage(locale, isCookieEnabled ?? isCookieEnabledContext ?? true);
|
|
42
|
+
onLocaleChange?.(locale);
|
|
43
|
+
}, [
|
|
44
|
+
availableLocales,
|
|
45
|
+
onLocaleChange,
|
|
46
|
+
setLocaleState,
|
|
47
|
+
isCookieEnabled
|
|
48
|
+
]);
|
|
35
49
|
return {
|
|
36
50
|
locale,
|
|
37
51
|
defaultLocale,
|
|
38
52
|
availableLocales,
|
|
39
|
-
setLocale
|
|
40
|
-
if (!availableLocales?.map(String).includes(locale)) {
|
|
41
|
-
console.error(`Locale ${locale} is not available`);
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
setLocaleState(locale);
|
|
45
|
-
setLocaleInStorage(locale, isCookieEnabled ?? isCookieEnabledContext ?? true);
|
|
46
|
-
onLocaleChange?.(locale);
|
|
47
|
-
}, [
|
|
48
|
-
availableLocales,
|
|
49
|
-
onLocaleChange,
|
|
50
|
-
setLocaleState,
|
|
51
|
-
isCookieEnabled
|
|
52
|
-
])
|
|
53
|
+
setLocale
|
|
53
54
|
};
|
|
54
55
|
};
|
|
55
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useCallback, useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\n/**\n * Client-side hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'react-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {
|
|
1
|
+
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/client/useLocale.ts"],"sourcesContent":["'use client';\n\nimport { internationalization } from '@intlayer/config/built';\nimport type {\n DeclaredLocales,\n LocalesValues,\n} from '@intlayer/types/module_augmentation';\nimport { useCallback, useContext } from 'react';\nimport { IntlayerClientContext } from './IntlayerProvider';\nimport { setLocaleInStorage } from './useLocaleStorage';\n\nexport type UseLocaleProps = {\n isCookieEnabled?: boolean;\n onLocaleChange?: (locale: DeclaredLocales) => void;\n};\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n setLocale: (locale: LocalesValues) => void;\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * Client-side hook to get the current locale and related locale management functions.\n *\n * @param props - Optional properties for the hook.\n * @returns An object containing the current locale, default locale, available locales, and a function to update the locale.\n *\n * @example\n * ```tsx\n * import { useLocale } from 'react-intlayer';\n *\n * const LocaleSwitcher = () => {\n * const { locale, setLocale, availableLocales } = useLocale();\n *\n * return (\n * <select value={locale} onChange={(e) => setLocale(e.target.value)}>\n * {availableLocales.map((loc) => (\n * <option key={loc} value={loc}>{loc}</option>\n * ))}\n * </select>\n * );\n * };\n * ```\n */\nexport const useLocale = ({\n isCookieEnabled,\n onLocaleChange,\n}: UseLocaleProps = {}): UseLocaleResult => {\n const {\n locale,\n setLocale: setLocaleState,\n isCookieEnabled: isCookieEnabledContext,\n } = useContext(IntlayerClientContext) ?? {};\n\n const setLocale = useCallback(\n (locale: LocalesValues) => {\n if (!availableLocales?.map(String).includes(locale)) {\n console.error(`Locale ${locale} is not available`);\n return;\n }\n\n setLocaleState(locale);\n setLocaleInStorage(\n locale,\n isCookieEnabled ?? isCookieEnabledContext ?? true\n );\n onLocaleChange?.(locale as DeclaredLocales);\n },\n [availableLocales, onLocaleChange, setLocaleState, isCookieEnabled]\n );\n\n return {\n locale, // Current locale\n defaultLocale, // Principal locale defined in config\n availableLocales, // List of the available locales defined in config\n setLocale, // Function to set the locale\n } as UseLocaleResult;\n};\n"],"mappings":";;;;;;;;AAuBA,MAAM,EAAE,eAAe,SAAS,qBAAqB,wBAAwB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AAyB9E,MAAa,aAAa,EACxB,iBACA,mBACkB,CAAC,MAAuB;CAC1C,MAAM,EACJ,QACA,WAAW,gBACX,iBAAiB,2BACf,WAAW,qBAAqB,KAAK,CAAC;CAE1C,MAAM,YAAY,aACf,WAA0B;EACzB,IAAI,CAAC,kBAAkB,IAAI,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG;GACnD,QAAQ,MAAM,UAAU,OAAO,kBAAkB;GACjD;EACF;EAEA,eAAe,MAAM;EACrB,mBACE,QACA,mBAAmB,0BAA0B,IAC/C;EACA,iBAAiB,MAAyB;CAC5C,GACA;EAAC;EAAkB;EAAgB;EAAgB;CAAe,CACpE;CAEA,OAAO;EACL;EACA;EACA;EACA;CACF;AACF"}
|
|
@@ -3,13 +3,13 @@ import { IntlayerServerContext } from "./IntlayerServerProvider.mjs";
|
|
|
3
3
|
import { internationalization } from "@intlayer/config/built";
|
|
4
4
|
|
|
5
5
|
//#region src/server/useLocale.ts
|
|
6
|
+
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
6
7
|
/**
|
|
7
8
|
* On the server side, Hook that picking one dictionary by its key and return the content
|
|
8
9
|
*
|
|
9
10
|
* If the locale is not provided, it will use the locale from the server context
|
|
10
11
|
*/
|
|
11
12
|
const useLocale = () => {
|
|
12
|
-
const { defaultLocale, locales: availableLocales } = internationalization ?? {};
|
|
13
13
|
return {
|
|
14
14
|
locale: getServerContext(IntlayerServerContext) ?? defaultLocale,
|
|
15
15
|
defaultLocale,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n};\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = (): UseLocaleResult => {\n const
|
|
1
|
+
{"version":3,"file":"useLocale.mjs","names":[],"sources":["../../../src/server/useLocale.ts"],"sourcesContent":["import { internationalization } from '@intlayer/config/built';\nimport type { DeclaredLocales } from '@intlayer/types/module_augmentation';\nimport { IntlayerServerContext } from './IntlayerServerProvider';\nimport { getServerContext } from './serverContext';\n\nexport type UseLocaleResult = {\n locale: DeclaredLocales;\n defaultLocale: DeclaredLocales;\n availableLocales: DeclaredLocales[];\n};\n\nconst { defaultLocale, locales: availableLocales } = internationalization ?? {};\n\n/**\n * On the server side, Hook that picking one dictionary by its key and return the content\n *\n * If the locale is not provided, it will use the locale from the server context\n */\nexport const useLocale = (): UseLocaleResult => {\n const locale = (getServerContext(IntlayerServerContext) ??\n defaultLocale) as DeclaredLocales;\n\n return { locale, defaultLocale, availableLocales };\n};\n"],"mappings":";;;;;AAWA,MAAM,EAAE,eAAe,SAAS,qBAAqB,wBAAwB,CAAC;;;;;;AAO9E,MAAa,kBAAmC;CAI9C,OAAO;EAAE,QAHO,iBAAiB,qBAAqB,KACpD;EAEe;EAAe;CAAiB;AACnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;YAWY;EACV;EACA,kBAAkB,QAAQ;;YAGhB;EACV,QAAQ;EACR,eAAe;EACf,kBAAkB;EAClB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/client/useLocale.ts"],"mappings":";;YAWY;EACV;EACA,kBAAkB,QAAQ;;YAGhB;EACV,QAAQ;EACR,eAAe;EACf,kBAAkB;EAClB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBA4BT,cAAS,iBAAA,mBAGnB,mBAAsB"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const useLocaleBase: () => {
|
|
6
6
|
locale: import("@intlayer/types").LocalesValues;
|
|
7
|
-
defaultLocale:
|
|
8
|
-
availableLocales:
|
|
7
|
+
defaultLocale: import("@intlayer/types").Locale;
|
|
8
|
+
availableLocales: import("@intlayer/types").Locale[];
|
|
9
9
|
setLocale: (newLocale: import("@intlayer/types").LocalesValues) => void;
|
|
10
10
|
};
|
|
11
11
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/server/useLocale.ts"],"mappings":";;YAKY;EACV,QAAQ;EACR,eAAe;EACf,kBAAkB;;;;;;;
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","names":[],"sources":["../../../src/server/useLocale.ts"],"mappings":";;YAKY;EACV,QAAQ;EACR,eAAe;EACf,kBAAkB;;;;;;;qBAUP,iBAAgB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-intlayer",
|
|
3
|
-
"version": "9.5.
|
|
3
|
+
"version": "9.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your React applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -132,12 +132,12 @@
|
|
|
132
132
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@intlayer/api": "9.5.
|
|
136
|
-
"@intlayer/config": "9.5.
|
|
137
|
-
"@intlayer/core": "9.5.
|
|
138
|
-
"@intlayer/dictionaries-entry": "9.5.
|
|
139
|
-
"@intlayer/editor": "9.5.
|
|
140
|
-
"@intlayer/types": "9.5.
|
|
135
|
+
"@intlayer/api": "9.5.1",
|
|
136
|
+
"@intlayer/config": "9.5.1",
|
|
137
|
+
"@intlayer/core": "9.5.1",
|
|
138
|
+
"@intlayer/dictionaries-entry": "9.5.1",
|
|
139
|
+
"@intlayer/editor": "9.5.1",
|
|
140
|
+
"@intlayer/types": "9.5.1"
|
|
141
141
|
},
|
|
142
142
|
"devDependencies": {
|
|
143
143
|
"@craco/types": "7.1.0",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"react-dom": ">=16.0.0"
|
|
159
159
|
},
|
|
160
160
|
"optionalDependencies": {
|
|
161
|
-
"@intlayer/analytics": "9.5.
|
|
161
|
+
"@intlayer/analytics": "9.5.1"
|
|
162
162
|
},
|
|
163
163
|
"engines": {
|
|
164
164
|
"node": ">=14.18"
|