@intlayer/react-i18next 9.7.0 → 9.7.2
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/esm/I18nextProvider.mjs +1 -2
- package/dist/esm/Trans.mjs +2 -3
- package/dist/esm/createTranslationApi.mjs +1 -2
- package/dist/esm/helpers.mjs +1 -2
- package/dist/esm/index.mjs +4 -5
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/initReactI18next.mjs +1 -2
- package/dist/esm/plugin/index.mjs +1 -2
- package/dist/esm/useDictionary.mjs +1 -2
- package/dist/esm/useDictionaryDynamic.mjs +1 -2
- package/dist/esm/useTranslation.mjs +1 -2
- package/dist/esm/withTranslation.mjs +1 -2
- package/dist/types/I18nextProvider.d.ts +0 -2
- package/dist/types/I18nextProvider.d.ts.map +1 -1
- package/dist/types/Trans.d.ts +3 -4
- package/dist/types/Trans.d.ts.map +1 -1
- package/dist/types/createTranslationApi.d.ts +1 -3
- package/dist/types/createTranslationApi.d.ts.map +1 -1
- package/dist/types/helpers.d.ts +1 -3
- package/dist/types/helpers.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/initReactI18next.d.ts +0 -2
- package/dist/types/initReactI18next.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts +0 -2
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/useDictionary.d.ts +3 -4
- package/dist/types/useDictionary.d.ts.map +1 -1
- package/dist/types/useDictionaryDynamic.d.ts +3 -4
- package/dist/types/useDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/useTranslation.d.ts +3 -4
- package/dist/types/useTranslation.d.ts.map +1 -1
- package/dist/types/withTranslation.d.ts +0 -2
- package/dist/types/withTranslation.d.ts.map +1 -1
- package/package.json +41 -41
|
@@ -6,7 +6,7 @@ import { log } from "@intlayer/config/built";
|
|
|
6
6
|
import { CYAN } from "@intlayer/config/colors";
|
|
7
7
|
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/I18nextProvider.tsx
|
|
10
10
|
/**
|
|
11
11
|
* Drop-in for react-i18next's `I18nextProvider`.
|
|
12
12
|
* The `i18n` prop is accepted for API compatibility but has no effect —
|
|
@@ -18,6 +18,5 @@ const I18nextProvider = ({ children, i18n: _i18n }) => {
|
|
|
18
18
|
return /* @__PURE__ */ jsx(IntlayerProvider, { children });
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { I18nextProvider };
|
|
23
22
|
//# sourceMappingURL=I18nextProvider.mjs.map
|
package/dist/esm/Trans.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useTranslationLoose } from "./useTranslation.mjs";
|
|
4
|
-
import { parseTaggedMessage } from "@intlayer/core/messageFormat";
|
|
5
4
|
import { Children, Fragment, cloneElement, isValidElement } from "react";
|
|
5
|
+
import { parseTaggedMessage } from "@intlayer/core/messageFormat";
|
|
6
6
|
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/Trans.tsx
|
|
9
9
|
/**
|
|
10
10
|
* Renders parsed message tokens to React nodes, mapping tags to the
|
|
11
11
|
* `components` prop (object or array form) or to the JSX children
|
|
@@ -57,6 +57,5 @@ const Trans = function Trans({ i18nKey, ns, values, count, context, defaults, co
|
|
|
57
57
|
return /* @__PURE__ */ jsx(Fragment$1, { children: renderTokens(tokens, components ?? {}, childrenArray) });
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { Trans };
|
|
62
61
|
//# sourceMappingURL=Trans.mjs.map
|
|
@@ -2,7 +2,7 @@ import { getHTMLTextDir } from "@intlayer/core/localization";
|
|
|
2
2
|
import { resolveMessageNodeToString } from "@intlayer/core/messageFormat";
|
|
3
3
|
import { getInterpolationValues, resolveTranslation } from "@intlayer/i18next";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/createTranslationApi.ts
|
|
6
6
|
/**
|
|
7
7
|
* Builds the `{ t, i18n }` pair shared by `useTranslation` (runtime
|
|
8
8
|
* registry lookup) and `useDictionary` / `useDictionaryDynamic`
|
|
@@ -71,6 +71,5 @@ const createTranslationApi = ({ locale, setLocale, availableLocales, namespace,
|
|
|
71
71
|
};
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
//#endregion
|
|
75
74
|
export { createTranslationApi };
|
|
76
75
|
//# sourceMappingURL=createTranslationApi.mjs.map
|
package/dist/esm/helpers.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { useTranslationLoose } from "./useTranslation.mjs";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/helpers.tsx
|
|
6
6
|
const I18nContext = React.createContext({ i18n: null });
|
|
7
7
|
const Translation = ({ children, ns, keyPrefix }) => {
|
|
8
8
|
const { t, i18n } = useTranslationLoose(ns, { keyPrefix });
|
|
@@ -49,6 +49,5 @@ const getInitialProps = () => ({
|
|
|
49
49
|
initialLanguage: "en"
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
export { I18nContext, Translation, composeInitialProps, getDefaults, getI18n, getInitialProps, nodesToString, setDefaults, setI18n, useSSR, withSSR };
|
|
54
53
|
//# sourceMappingURL=helpers.mjs.map
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nContext as I18nContext$1, Translation as Translation$1, composeInitialProps as composeInitialProps$1, getDefaults as getDefaults$1, getI18n as getI18n$1, getInitialProps as getInitialProps$1, nodesToString as nodesToString$1, setDefaults as setDefaults$1, setI18n as setI18n$1, useSSR as useSSR$1, withSSR as withSSR$1 } from "./helpers.mjs";
|
|
2
2
|
import { Trans } from "./Trans.mjs";
|
|
3
3
|
import { I18nextProvider } from "./I18nextProvider.mjs";
|
|
4
|
-
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
5
|
-
import { I18nContext as I18nContext$1, Translation as Translation$1, composeInitialProps as composeInitialProps$1, getDefaults as getDefaults$1, getI18n as getI18n$1, getInitialProps as getInitialProps$1, nodesToString as nodesToString$1, setDefaults as setDefaults$1, setI18n as setI18n$1, useSSR as useSSR$1, withSSR as withSSR$1 } from "./helpers.mjs";
|
|
6
4
|
import { initReactI18next } from "./initReactI18next.mjs";
|
|
7
5
|
import { useDictionary } from "./useDictionary.mjs";
|
|
6
|
+
import { useDictionaryDynamic } from "./useDictionaryDynamic.mjs";
|
|
7
|
+
import { useTranslation } from "./useTranslation.mjs";
|
|
8
8
|
import { withTranslation } from "./withTranslation.mjs";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/index.ts
|
|
11
11
|
const nodesToString = nodesToString$1;
|
|
12
12
|
const setDefaults = setDefaults$1;
|
|
13
13
|
const getDefaults = getDefaults$1;
|
|
@@ -23,6 +23,5 @@ const TransWithoutContext = Trans;
|
|
|
23
23
|
const IcuTrans = Trans;
|
|
24
24
|
const IcuTransWithoutContext = Trans;
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { I18nContext, I18nextProvider, IcuTrans, IcuTransWithoutContext, Trans, TransWithoutContext, Translation, composeInitialProps, getDefaults, getI18n, getInitialProps, initReactI18next, nodesToString, setDefaults, setI18n, useDictionary, useDictionaryDynamic, useSSR, useTranslation, withSSR, withTranslation };
|
|
28
27
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["nodesToStringImpl","setDefaultsImpl","getDefaultsImpl","setI18nImpl","getI18nImpl","composeInitialPropsImpl","getInitialPropsImpl","useSSRImpl","withSSRImpl","TranslationImpl","I18nContextImpl"],"sources":["../../src/index.ts"],"sourcesContent":["import type {\n composeInitialProps as _composeInitialProps,\n getDefaults as _getDefaults,\n getI18n as _getI18n,\n getInitialProps as _getInitialProps,\n I18nContext as _I18nContext,\n setDefaults as _setDefaults,\n setI18n as _setI18n,\n Trans as _Trans,\n Translation as _Translation,\n TransWithoutContext as _TransWithoutContext,\n useSSR as _useSSR,\n withSSR as _withSSR,\n} from 'react-i18next';\
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["nodesToStringImpl","setDefaultsImpl","getDefaultsImpl","setI18nImpl","getI18nImpl","composeInitialPropsImpl","getInitialPropsImpl","useSSRImpl","withSSRImpl","TranslationImpl","I18nContextImpl"],"sources":["../../src/index.ts"],"sourcesContent":["import type {\n composeInitialProps as _composeInitialProps,\n getDefaults as _getDefaults,\n getI18n as _getI18n,\n getInitialProps as _getInitialProps,\n I18nContext as _I18nContext,\n setDefaults as _setDefaults,\n setI18n as _setI18n,\n Trans as _Trans,\n Translation as _Translation,\n TransWithoutContext as _TransWithoutContext,\n useSSR as _useSSR,\n withSSR as _withSSR,\n} from 'react-i18next';\nimport {\n composeInitialProps as composeInitialPropsImpl,\n getDefaults as getDefaultsImpl,\n getI18n as getI18nImpl,\n getInitialProps as getInitialPropsImpl,\n I18nContext as I18nContextImpl,\n nodesToString as nodesToStringImpl,\n setDefaults as setDefaultsImpl,\n setI18n as setI18nImpl,\n Translation as TranslationImpl,\n useSSR as useSSRImpl,\n withSSR as withSSRImpl,\n} from './helpers';\nimport { Trans } from './Trans';\n\n// Re-export common types from react-i18next so consumers don't need both packages\nexport type {\n I18nextProviderProps,\n TransProps,\n UseTranslationOptions,\n UseTranslationResponse,\n WithTranslation,\n WithTranslationProps,\n} from 'react-i18next';\nexport { I18nextProvider } from './I18nextProvider';\nexport { initReactI18next } from './initReactI18next';\nexport { useDictionary } from './useDictionary';\nexport { useDictionaryDynamic } from './useDictionaryDynamic';\nexport { useTranslation } from './useTranslation';\nexport { withTranslation } from './withTranslation';\nexport { Trans };\n\n// Wrap and export all implementation functions.\n// `nodesToString` is not part of react-i18next's public type surface in all\n// supported versions, so the local implementation's inferred type is exposed.\nexport const nodesToString = nodesToStringImpl;\nexport const setDefaults = setDefaultsImpl as typeof _setDefaults;\nexport const getDefaults = getDefaultsImpl as typeof _getDefaults;\nexport const setI18n = setI18nImpl as typeof _setI18n;\nexport const getI18n = getI18nImpl as typeof _getI18n;\nexport const composeInitialProps =\n composeInitialPropsImpl as typeof _composeInitialProps;\nexport const getInitialProps = getInitialPropsImpl as typeof _getInitialProps;\nexport const useSSR = useSSRImpl as typeof _useSSR;\nexport const withSSR = withSSRImpl as typeof _withSSR;\nexport const Translation = TranslationImpl as typeof _Translation;\nexport const I18nContext = I18nContextImpl as typeof _I18nContext;\n\nexport const TransWithoutContext = Trans as typeof _TransWithoutContext;\n// `IcuTrans` / `IcuTransWithoutContext` are aliases for the standard `Trans`\n// component (they only differ by interpolation engine, which the compat shim\n// does not distinguish). They are typed against `Trans` for broad version\n// compatibility, since the dedicated ICU exports are not present in every\n// supported react-i18next release.\nexport const IcuTrans = Trans as typeof _Trans;\nexport const IcuTransWithoutContext = Trans as typeof _Trans;\n"],"mappings":";;;;;;;;;;AAiDA,MAAa,gBAAgBA;AAC7B,MAAa,cAAcC;AAC3B,MAAa,cAAcC;AAC3B,MAAa,UAAUC;AACvB,MAAa,UAAUC;AACvB,MAAa,sBACXC;AACF,MAAa,kBAAkBC;AAC/B,MAAa,SAASC;AACtB,MAAa,UAAUC;AACvB,MAAa,cAAcC;AAC3B,MAAa,cAAcC;AAE3B,MAAa,sBAAsB;AAMnC,MAAa,WAAW;AACxB,MAAa,yBAAyB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setDefaults, setI18n } from "./helpers.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/initReactI18next.ts
|
|
4
4
|
/**
|
|
5
5
|
* Drop-in for react-i18next's `initReactI18next` plugin.
|
|
6
6
|
*
|
|
@@ -18,6 +18,5 @@ const initReactI18next = {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { initReactI18next };
|
|
23
22
|
//# sourceMappingURL=initReactI18next.mjs.map
|
|
@@ -6,7 +6,7 @@ import { getConfiguration } from "@intlayer/config/node";
|
|
|
6
6
|
import { runOnce } from "@intlayer/engine/utils";
|
|
7
7
|
import { intlayer } from "vite-intlayer";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/plugin/index.ts
|
|
10
10
|
/**
|
|
11
11
|
* A Vite plugin for react-i18next compat that wraps vite-intlayer
|
|
12
12
|
* and configures resolve aliases for react-i18next and i18next.
|
|
@@ -33,6 +33,5 @@ const reactI18nextVitePlugin = (options) => {
|
|
|
33
33
|
return [...Array.isArray(basePlugins) ? basePlugins : [basePlugins], compatPlugin];
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//#endregion
|
|
37
36
|
export { reactI18nextVitePlugin as default, reactI18nextVitePlugin };
|
|
38
37
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -4,7 +4,7 @@ import { createTranslationApi } from "./createTranslationApi.mjs";
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { useDictionary as useDictionary$1, useLocale } from "react-intlayer";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/useDictionary.ts
|
|
8
8
|
/**
|
|
9
9
|
* Dictionary-accepting variant of `useTranslation`.
|
|
10
10
|
*
|
|
@@ -49,6 +49,5 @@ const useDictionary = ((dictionary, keyPrefix, options) => {
|
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
export { useDictionary };
|
|
54
53
|
//# sourceMappingURL=useDictionary.mjs.map
|
|
@@ -4,7 +4,7 @@ import { createTranslationApi } from "./createTranslationApi.mjs";
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { useDictionaryDynamic as useDictionaryDynamic$1, useLocale } from "react-intlayer";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/useDictionaryDynamic.ts
|
|
8
8
|
/**
|
|
9
9
|
* Dynamic dictionary-accepting variant of `useTranslation`.
|
|
10
10
|
*
|
|
@@ -38,6 +38,5 @@ const useDictionaryDynamic = ((dictionaryPromise, key, keyPrefix, options) => {
|
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
export { useDictionaryDynamic };
|
|
43
42
|
//# sourceMappingURL=useDictionaryDynamic.mjs.map
|
|
@@ -4,7 +4,7 @@ import { createTranslationApi } from "./createTranslationApi.mjs";
|
|
|
4
4
|
import { useMemo } from "react";
|
|
5
5
|
import { useLocale } from "react-intlayer";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/useTranslation.ts
|
|
8
8
|
/**
|
|
9
9
|
* Drop-in for react-i18next's `useTranslation`.
|
|
10
10
|
*
|
|
@@ -57,6 +57,5 @@ const useTranslation = useTranslationImplementation;
|
|
|
57
57
|
*/
|
|
58
58
|
const useTranslationLoose = useTranslationImplementation;
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
60
|
export { useTranslation, useTranslationLoose };
|
|
62
61
|
//# sourceMappingURL=useTranslation.mjs.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useTranslationLoose } from "./useTranslation.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/withTranslation.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Drop-in for react-i18next's `withTranslation` HOC.
|
|
9
9
|
*/
|
|
@@ -21,6 +21,5 @@ const withTranslation = ((ns, options) => (WrappedComponent) => {
|
|
|
21
21
|
return WithTranslation;
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
//#endregion
|
|
25
24
|
export { withTranslation };
|
|
26
25
|
//# sourceMappingURL=withTranslation.mjs.map
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { I18nextProvider as I18nextProvider$1 } from "react-i18next";
|
|
2
|
-
//#region src/I18nextProvider.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-i18next's `I18nextProvider`.
|
|
5
4
|
* The `i18n` prop is accepted for API compatibility but has no effect —
|
|
@@ -7,5 +6,4 @@ import { I18nextProvider as I18nextProvider$1 } from "react-i18next";
|
|
|
7
6
|
* the `i18n` prop is provided so consumers know to remove it.
|
|
8
7
|
*/
|
|
9
8
|
export declare const I18nextProvider: typeof I18nextProvider$1;
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=I18nextProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nextProvider.d.ts","names":[],"sources":["../../src/I18nextProvider.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"I18nextProvider.d.ts","names":["_I18nextProvider"],"sources":["../../src/I18nextProvider.tsx"],"mappings":";;;;;;;qBAiBa,wBAAwBA"}
|
package/dist/types/Trans.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { TransProps } from "react-i18next";
|
|
2
|
-
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
3
1
|
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
2
|
+
import { TransProps } from "react-i18next";
|
|
4
3
|
import { ReactElement } from "react";
|
|
5
|
-
|
|
4
|
+
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
6
5
|
/**
|
|
7
6
|
* `<Trans>` props for a known dictionary namespace: `i18nKey` is validated
|
|
8
7
|
* against the dictionary's dot-paths, matching the strength of `useIntlayer`.
|
|
@@ -40,5 +39,5 @@ type TypedTrans = {
|
|
|
40
39
|
* ```
|
|
41
40
|
*/
|
|
42
41
|
export declare const Trans: TypedTrans;
|
|
43
|
-
|
|
42
|
+
export {};
|
|
44
43
|
//# sourceMappingURL=Trans.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trans.d.ts","names":[],"sources":["../../src/Trans.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Trans.d.ts","names":[],"sources":["../../src/Trans.tsx"],"mappings":";;;;;;;;KAwBK,gBAAgB,UAAU,gBAAgB,oBAAoB,KACjE;;EAIA,IAAI,aAAa;;EAEjB,SAAS;;;;;;;KAQN;GACF,UAAU,gBAAgB,UAAU,iBAAiB,IACpD,OAAO,gBAAgB,GAAG,KACzB;GACF,OAAO;IAAuB;MAAmB;;;;;;;;;;;;;;;;;qBAsEvC,OAuDR"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { DictionaryKeys, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
2
1
|
import { TypedTFunction } from "@intlayer/i18next";
|
|
2
|
+
import { DictionaryKeys, LocalesValues } from "@intlayer/types/module_augmentation";
|
|
3
3
|
import { TOptions } from "i18next";
|
|
4
|
-
//#region src/createTranslationApi.d.ts
|
|
5
4
|
/** Untyped runtime `t()` produced by {@link createTranslationApi}. */
|
|
6
5
|
export type TranslateFunction = (key: string | string[], optionsOrDefaultValue?: TOptions | string, extraOptions?: TOptions) => string;
|
|
7
6
|
/**
|
|
@@ -68,5 +67,4 @@ export declare const createTranslationApi: ({ locale, setLocale, availableLocale
|
|
|
68
67
|
translate: TranslateFunction;
|
|
69
68
|
i18n: I18nFacade;
|
|
70
69
|
};
|
|
71
|
-
//#endregion
|
|
72
70
|
//# sourceMappingURL=createTranslationApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTranslationApi.d.ts","names":[],"sources":["../../src/createTranslationApi.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createTranslationApi.d.ts","names":[],"sources":["../../src/createTranslationApi.ts"],"mappings":";;;;YAcY,qBACV,wBACA,wBAAwB,mBACxB,eAAe;;;;;;;YASL,gBAAgB,MAAM,qBAAqB,KACrD;EAGA,GAAG;EACH;KACG,UAAU,gBACT,qCACA,gBAAgB,IACf,eAAe;KACjB,0BAA0B,wBAAwB;;;;YAK3C,uBAAuB,MAAM;EACvC,GAAG;EACH,MAAM,gBAAgB;EACtB;;;YAIU;EACV;EACA;EACA;EACA;EACA,iBAAiB,wBAAwB;EACzC,MAAM;EACN,SAAS,aAAa,gBAAgB;EACtC,GAAG;EACH,YACE,0BACA,oCACI,aAAa,eAAe;;YAGxB;;EAEV,QAAQ;;EAER,YAAY,WAAW;;EAEvB,kBAAkB;;EAElB;;EAEA;;;;;;EAMA;;;;;;;;;;;;;qBAcW,yBAAoB,QAAA,WAAA,kBAAA,WAAA,WAAA,qBAO9B;EACD,WAAW;EACX,MAAM"}
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import { TFunction, i18n } from "i18next";
|
|
3
|
-
|
|
2
|
+
import * as React from "react";
|
|
4
3
|
export declare const I18nContext: React.Context<{
|
|
5
4
|
i18n: i18n;
|
|
6
5
|
}>;
|
|
@@ -25,5 +24,4 @@ export declare const getInitialProps: () => {
|
|
|
25
24
|
initialI18nStore: {};
|
|
26
25
|
initialLanguage: string;
|
|
27
26
|
};
|
|
28
|
-
//#endregion
|
|
29
27
|
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","names":[],"sources":["../../src/helpers.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","names":[],"sources":["../../src/helpers.tsx"],"mappings":";;qBAKa,aAAW,MAAA;EAA+B,MAAA;;iBAItC;EACf,WACE,GAAG,WACH;IAAW,MAAM;IAAM;KACvB,mBACG,MAAM;EACX;EACA;;qBAIW,gBAAW,UAAA,IAAA,aAIrB,qBAAmB,MAAM;qBAUf,gBAAa,UACd,MAAM,WAAS,wBACH,iBACP;qBAyBJ,UAAO,UAAc;qBAIrB,eAAc;qBAId,cAAW;qBAIX;qBAKA,SAAM,4BACS;qBAIf,gBACE,kBAAgB,kBACT,MAAM,cAAc,OACrC,MAAM,cAAc;qBAWZ,sBAAmB,4BACP,kBAAyB;qBAErC;EACX;EACA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { I18nextProvider } from "./I18nextProvider.js";
|
|
2
|
-
import { Trans } from "./Trans.js";
|
|
3
1
|
import { nodesToString as nodesToString$1 } from "./helpers.js";
|
|
2
|
+
import { Trans } from "./Trans.js";
|
|
3
|
+
import { I18nextProvider } from "./I18nextProvider.js";
|
|
4
4
|
import { initReactI18next } from "./initReactI18next.js";
|
|
5
5
|
import { useDictionary } from "./useDictionary.js";
|
|
6
6
|
import { useDictionaryDynamic } from "./useDictionaryDynamic.js";
|
|
7
7
|
import { useTranslation } from "./useTranslation.js";
|
|
8
8
|
import { withTranslation } from "./withTranslation.js";
|
|
9
9
|
import { I18nContext as I18nContext$1, I18nextProviderProps, Trans as Trans$1, TransProps, TransWithoutContext as TransWithoutContext$1, Translation as Translation$1, UseTranslationOptions, UseTranslationResponse, WithTranslation, WithTranslationProps, composeInitialProps as composeInitialProps$1, getDefaults as getDefaults$1, getI18n as getI18n$1, getInitialProps as getInitialProps$1, setDefaults as setDefaults$1, setI18n as setI18n$1, useSSR as useSSR$1, withSSR as withSSR$1 } from "react-i18next";
|
|
10
|
-
//#region src/index.d.ts
|
|
11
10
|
export declare const nodesToString: typeof nodesToString$1;
|
|
12
11
|
export declare const setDefaults: typeof setDefaults$1;
|
|
13
12
|
export declare const getDefaults: typeof getDefaults$1;
|
|
@@ -22,6 +21,5 @@ export declare const I18nContext: typeof I18nContext$1;
|
|
|
22
21
|
export declare const TransWithoutContext: typeof TransWithoutContext$1;
|
|
23
22
|
export declare const IcuTrans: typeof Trans$1;
|
|
24
23
|
export declare const IcuTransWithoutContext: typeof Trans$1;
|
|
25
|
-
//#endregion
|
|
26
24
|
export { I18nextProvider, type I18nextProviderProps, Trans, type TransProps, type UseTranslationOptions, type UseTranslationResponse, type WithTranslation, type WithTranslationProps, initReactI18next, useDictionary, useDictionaryDynamic, useTranslation, withTranslation };
|
|
27
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["nodesToStringImpl","_setDefaults","_getDefaults","_setI18n","_getI18n","_composeInitialProps","_getInitialProps","_useSSR","_withSSR","_Translation","_I18nContext","_TransWithoutContext","_Trans"],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;qBAiDa,sBAAaA;qBACb,oBAAwCC;qBACxC,oBAAwCC;qBACxC,gBAAgCC;qBAChC,gBAAgCC;qBAChC,4BACuBC;qBACvB,wBAAgDC;qBAChD,eAA8BC;qBAC9B,gBAAgCC;qBAChC,oBAAwCC;qBACxC,oBAAwCC;qBAExC,4BAAsCC;qBAMtC,iBAA2BC;qBAC3B,+BAAyCA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { initReactI18next as initReactI18next$1 } from "react-i18next";
|
|
2
|
-
//#region src/initReactI18next.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-i18next's `initReactI18next` plugin.
|
|
5
4
|
*
|
|
@@ -10,5 +9,4 @@ import { initReactI18next as initReactI18next$1 } from "react-i18next";
|
|
|
10
9
|
* helpers; actual translation is served by Intlayer.
|
|
11
10
|
*/
|
|
12
11
|
export declare const initReactI18next: typeof initReactI18next$1;
|
|
13
|
-
//#endregion
|
|
14
12
|
//# sourceMappingURL=initReactI18next.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initReactI18next.d.ts","names":[],"sources":["../../src/initReactI18next.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"initReactI18next.d.ts","names":["_initReactI18next"],"sources":["../../src/initReactI18next.ts"],"mappings":";;;;;;;;;;qBAYa,yBAAyBA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { PluginOption } from "vite";
|
|
2
2
|
import { intlayer } from "vite-intlayer";
|
|
3
|
-
//#region src/plugin/index.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* A Vite plugin for react-i18next compat that wraps vite-intlayer
|
|
6
5
|
* and configures resolve aliases for react-i18next and i18next.
|
|
7
6
|
*/
|
|
8
7
|
export declare const reactI18nextVitePlugin: (options?: Parameters<typeof intlayer>[0]) => PluginOption[];
|
|
9
|
-
//#endregion
|
|
10
8
|
export { reactI18nextVitePlugin as default };
|
|
11
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/plugin/index.ts"],"mappings":";;;;;;qBAaa,yBAAsB,UACvB,kBAAkB,iBAC3B"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TypedTranslationResult } from "./createTranslationApi.js";
|
|
2
|
-
import { UseTranslationOptions } from "react-i18next";
|
|
3
|
-
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
4
2
|
import { ScopedTFunction, TypedTFunction } from "@intlayer/i18next";
|
|
5
3
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
6
|
-
|
|
4
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
5
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
7
6
|
/**
|
|
8
7
|
* Overload set for {@link useDictionary}: without a key prefix the returned
|
|
9
8
|
* `t()` is typed against the dictionary's dot-paths; with a prefix (string or
|
|
@@ -34,5 +33,5 @@ type UseDictionary = {
|
|
|
34
33
|
* const { t } = useDictionary(_abc);
|
|
35
34
|
*/
|
|
36
35
|
export declare const useDictionary: UseDictionary;
|
|
37
|
-
|
|
36
|
+
export {};
|
|
38
37
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","names":[],"sources":["../../src/useDictionary.ts"],"mappings":";;;;;;;;;;KAqBK;GACF,UAAU,YACT,YAAY,GACZ,UAAU,mCACT,uBAAuB,eAAe,WAAW;GACnD,UAAU,YAAY,uBACrB,YAAY,GACZ,WAAW,UAAU,sBAAsB;IAAY,WAAW;MAClE,UAAU,sBAAsB,UAC/B,uBAAuB,gBAAgB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;qBAqB1D,eA2BP"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { TypedTranslationResult } from "./createTranslationApi.js";
|
|
2
|
-
import { UseTranslationOptions } from "react-i18next";
|
|
3
|
-
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
4
2
|
import { ScopedTFunction, TypedTFunction } from "@intlayer/i18next";
|
|
5
3
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
6
|
-
|
|
4
|
+
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
5
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
7
6
|
/**
|
|
8
7
|
* Overload set for {@link useDictionaryDynamic}: without a key prefix the
|
|
9
8
|
* returned `t()` is typed against the dictionary's dot-paths; with a prefix
|
|
@@ -23,5 +22,5 @@ type UseDictionaryDynamic = {
|
|
|
23
22
|
* plugin passes the key prefix (`'counter'`) as the third argument.
|
|
24
23
|
*/
|
|
25
24
|
export declare const useDictionaryDynamic: UseDictionaryDynamic;
|
|
26
|
-
|
|
25
|
+
export {};
|
|
27
26
|
//# sourceMappingURL=useDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../src/useDictionaryDynamic.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useDictionaryDynamic.d.ts","names":[],"sources":["../../src/useDictionaryDynamic.ts"],"mappings":";;;;;;;;;;KAyBK;GACF,UAAU,YAAY,UAAU,gBAC/B,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,UAAU,mCACT,uBAAuB,eAAe;GACxC,UAAU,YAAY,UAAU,gBAAgB,uBAC/C,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,WAAW,UAAU,sBAAsB;IAAY,WAAW;MAClE,UAAU,sBAAsB,UAC/B,uBAAuB,gBAAgB,GAAG;;;;;;;;;qBAUlC,sBA+BP"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TypedTranslationResult } from "./createTranslationApi.js";
|
|
2
|
-
import { UseTranslationOptions } from "react-i18next";
|
|
3
|
-
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
4
2
|
import { ScopedTFunction, TypedTFunction } from "@intlayer/i18next";
|
|
5
|
-
|
|
3
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
4
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
6
5
|
/**
|
|
7
6
|
* Overload set for {@link useTranslation}: with a `keyPrefix` option the
|
|
8
7
|
* returned `t()` accepts relative dot-paths under the prefix; otherwise keys
|
|
@@ -22,5 +21,5 @@ export declare const useTranslation: UseTranslation;
|
|
|
22
21
|
* consumer-typed surfaces.
|
|
23
22
|
*/
|
|
24
23
|
export declare const useTranslationLoose: (ns?: string | string[], options?: UseTranslationOptions<string>) => TypedTranslationResult;
|
|
25
|
-
|
|
24
|
+
export {};
|
|
26
25
|
//# sourceMappingURL=useTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslation.d.ts","names":[],"sources":["../../src/useTranslation.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTranslation.d.ts","names":[],"sources":["../../src/useTranslation.ts"],"mappings":";;;;;;;;;;KAqBK;GACF,UAAU,gBAAgB,uBACzB,IAAI,IAAI,KACR,SAAS,sBAAsB;IAAY,WAAW;MACrD,uBAAuB,gBAAgB,GAAG;GAC5C,UAAU,gBACT,KAAK,IAAI,KACT,UAAU,mCACT,uBAAuB,eAAe;;qBAmD9B,gBAAiD;;;;;;qBAOjD,sBACX,wBACA,UAAU,kCACP"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { withTranslation as withTranslation$1 } from "react-i18next";
|
|
2
|
-
//#region src/withTranslation.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Drop-in for react-i18next's `withTranslation` HOC.
|
|
5
4
|
*/
|
|
6
5
|
export declare const withTranslation: typeof withTranslation$1;
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=withTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withTranslation.d.ts","names":[],"sources":["../../src/withTranslation.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"withTranslation.d.ts","names":["_withTranslation"],"sources":["../../src/withTranslation.tsx"],"mappings":";;;;qBAYa,wBAAwBA"}
|
package/package.json
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/react-i18next",
|
|
3
|
-
"version": "9.7.
|
|
3
|
+
"version": "9.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "react-i18next API adapter for intlayer — useTranslation, Trans, withTranslation, I18nextProvider backed by react-intlayer",
|
|
6
6
|
"keywords": [
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"adapter",
|
|
8
|
+
"compatibility",
|
|
9
|
+
"i18n",
|
|
9
10
|
"i18next",
|
|
11
|
+
"intlayer",
|
|
10
12
|
"react",
|
|
11
|
-
"
|
|
12
|
-
"adapter",
|
|
13
|
-
"compatibility"
|
|
13
|
+
"react-i18next"
|
|
14
14
|
],
|
|
15
15
|
"homepage": "https://intlayer.org",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/aymericzip/intlayer/issues"
|
|
18
18
|
},
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
22
|
-
},
|
|
23
19
|
"license": "Apache-2.0",
|
|
24
20
|
"author": {
|
|
25
21
|
"name": "Aymeric PINEAU",
|
|
@@ -32,7 +28,25 @@
|
|
|
32
28
|
"url": "https://github.com/aymericzip"
|
|
33
29
|
}
|
|
34
30
|
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/aymericzip/intlayer.git"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"./dist",
|
|
37
|
+
"./package.json"
|
|
38
|
+
],
|
|
35
39
|
"sideEffects": false,
|
|
40
|
+
"main": "dist/esm/index.mjs",
|
|
41
|
+
"module": "dist/esm/index.mjs",
|
|
42
|
+
"types": "dist/types/index.d.ts",
|
|
43
|
+
"typesVersions": {
|
|
44
|
+
"*": {
|
|
45
|
+
"plugin": [
|
|
46
|
+
"./dist/types/plugin/index.d.ts"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
},
|
|
36
50
|
"exports": {
|
|
37
51
|
".": {
|
|
38
52
|
"types": "./dist/types/index.d.ts",
|
|
@@ -44,29 +58,15 @@
|
|
|
44
58
|
},
|
|
45
59
|
"./package.json": "./package.json"
|
|
46
60
|
},
|
|
47
|
-
"main": "dist/esm/index.mjs",
|
|
48
|
-
"module": "dist/esm/index.mjs",
|
|
49
|
-
"types": "dist/types/index.d.ts",
|
|
50
|
-
"typesVersions": {
|
|
51
|
-
"*": {
|
|
52
|
-
"plugin": [
|
|
53
|
-
"./dist/types/plugin/index.d.ts"
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"files": [
|
|
58
|
-
"./dist",
|
|
59
|
-
"./package.json"
|
|
60
|
-
],
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "bun --bun tsdown --config tsdown.config.ts",
|
|
63
63
|
"build:ci": "bun --bun tsdown --config tsdown.config.ts",
|
|
64
64
|
"clean": "bun --bun rimraf ./dist .turbo",
|
|
65
65
|
"dev": "bun --bun tsdown --config tsdown.config.ts --watch",
|
|
66
|
-
"format": "
|
|
67
|
-
"format:fix": "
|
|
68
|
-
"lint": "
|
|
69
|
-
"lint:fix": "
|
|
66
|
+
"format": "oxfmt --check .",
|
|
67
|
+
"format:fix": "oxfmt .",
|
|
68
|
+
"lint": "oxlint .",
|
|
69
|
+
"lint:fix": "oxlint --fix .",
|
|
70
70
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
71
71
|
"publish": "bun publish || true",
|
|
72
72
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@intlayer/config": "9.
|
|
81
|
-
"@intlayer/core": "9.7.
|
|
82
|
-
"@intlayer/engine": "9.7.
|
|
83
|
-
"@intlayer/i18next": "9.7.
|
|
84
|
-
"@intlayer/types": "9.7.
|
|
85
|
-
"react-intlayer": "9.7.
|
|
86
|
-
"vite-intlayer": "9.
|
|
80
|
+
"@intlayer/config": "9.7.2",
|
|
81
|
+
"@intlayer/core": "9.7.2",
|
|
82
|
+
"@intlayer/engine": "9.7.2",
|
|
83
|
+
"@intlayer/i18next": "9.7.2",
|
|
84
|
+
"@intlayer/types": "9.7.2",
|
|
85
|
+
"react-intlayer": "9.7.2",
|
|
86
|
+
"vite-intlayer": "9.7.2"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@types/node": "^26",
|
|
@@ -91,13 +91,13 @@
|
|
|
91
91
|
"@utils/ts-config": "1.0.4",
|
|
92
92
|
"@utils/ts-config-types": "1.0.4",
|
|
93
93
|
"@utils/tsdown-config": "1.0.4",
|
|
94
|
-
"i18next": "26.
|
|
95
|
-
"react-i18next": "17.
|
|
96
|
-
"rimraf": "6.1.
|
|
97
|
-
"tsdown": "0.23.
|
|
94
|
+
"i18next": "26.7.1",
|
|
95
|
+
"react-i18next": "17.1.11",
|
|
96
|
+
"rimraf": "6.1.4",
|
|
97
|
+
"tsdown": "0.23.7",
|
|
98
98
|
"typescript": "7.0.2",
|
|
99
|
-
"vite": "8.3.
|
|
100
|
-
"vitest": "5.0
|
|
99
|
+
"vite": "8.3.7",
|
|
100
|
+
"vitest": "5.1.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"i18next": ">=20.0.0",
|