@intlayer/react-i18next 9.7.1 → 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 +2 -2
- package/dist/esm/Trans.mjs +6 -6
- package/dist/esm/Trans.mjs.map +1 -1
- package/dist/esm/helpers.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/useDictionary.mjs +1 -1
- package/dist/esm/useDictionaryDynamic.mjs +1 -1
- package/dist/esm/useTranslation.mjs +1 -1
- package/dist/types/Trans.d.ts +2 -2
- package/dist/types/createTranslationApi.d.ts +1 -1
- package/dist/types/helpers.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/useDictionary.d.ts +2 -2
- package/dist/types/useDictionaryDynamic.d.ts +2 -2
- package/dist/types/useTranslation.d.ts +2 -2
- package/package.json +38 -38
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { IntlayerProvider } from "react-intlayer";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
5
|
import { log } from "@intlayer/config/built";
|
|
4
6
|
import { CYAN } from "@intlayer/config/colors";
|
|
5
7
|
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
6
|
-
import { IntlayerProvider } from "react-intlayer";
|
|
7
|
-
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
|
|
9
9
|
// src/I18nextProvider.tsx
|
|
10
10
|
/**
|
package/dist/esm/Trans.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useTranslationLoose } from "./useTranslation.mjs";
|
|
4
|
-
import { Fragment,
|
|
5
|
-
import { Children, Fragment as Fragment$1, cloneElement, isValidElement } from "react";
|
|
4
|
+
import { Children, Fragment, cloneElement, isValidElement } from "react";
|
|
6
5
|
import { parseTaggedMessage } from "@intlayer/core/messageFormat";
|
|
6
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
7
7
|
|
|
8
8
|
// src/Trans.tsx
|
|
9
9
|
/**
|
|
@@ -22,7 +22,7 @@ const renderTokens = (tokens, components, childrenArray) => tokens.map((token, t
|
|
|
22
22
|
const NativeTag = token.tag;
|
|
23
23
|
return /* @__PURE__ */ jsx(NativeTag, { children: renderedChildren }, tokenIndex);
|
|
24
24
|
}
|
|
25
|
-
return /* @__PURE__ */ jsx(Fragment
|
|
25
|
+
return /* @__PURE__ */ jsx(Fragment, { children: renderedChildren }, tokenIndex);
|
|
26
26
|
});
|
|
27
27
|
/**
|
|
28
28
|
* Drop-in for react-i18next's `<Trans>`.
|
|
@@ -50,11 +50,11 @@ const Trans = function Trans({ i18nKey, ns, values, count, context, defaults, co
|
|
|
50
50
|
if (typeof defaults === "string") translateOptions.defaultValue = defaults;
|
|
51
51
|
const message = i18nKey ? t(i18nKey, translateOptions) : defaults ?? "";
|
|
52
52
|
const resolvedMessage = typeof message === "string" && message !== i18nKey ? message : defaults ?? message;
|
|
53
|
-
if (typeof resolvedMessage !== "string") return /* @__PURE__ */ jsx(Fragment, { children: children ?? resolvedMessage });
|
|
53
|
+
if (typeof resolvedMessage !== "string") return /* @__PURE__ */ jsx(Fragment$1, { children: children ?? resolvedMessage });
|
|
54
54
|
const childrenArray = Children.toArray(children);
|
|
55
55
|
const tokens = parseTaggedMessage(resolvedMessage);
|
|
56
|
-
if (!tokens.some((token) => typeof token !== "string") && !components) return /* @__PURE__ */ jsx(Fragment, { children: resolvedMessage });
|
|
57
|
-
return /* @__PURE__ */ jsx(Fragment, { children: renderTokens(tokens, components ?? {}, childrenArray) });
|
|
56
|
+
if (!tokens.some((token) => typeof token !== "string") && !components) return /* @__PURE__ */ jsx(Fragment$1, { children: resolvedMessage });
|
|
57
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: renderTokens(tokens, components ?? {}, childrenArray) });
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export { Trans };
|
package/dist/esm/Trans.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trans.mjs","names":[
|
|
1
|
+
{"version":3,"file":"Trans.mjs","names":[],"sources":["../../src/Trans.tsx"],"sourcesContent":["'use client';\n\nimport {\n parseTaggedMessage,\n type TaggedMessageToken,\n} from '@intlayer/core/messageFormat';\nimport type { ValidDotPathsFor } from '@intlayer/core/transpiler';\nimport type { DictionaryKeys } from '@intlayer/types/module_augmentation';\nimport type { Namespace, TOptions } from 'i18next';\nimport {\n Children,\n cloneElement,\n Fragment,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from 'react';\nimport type { TransProps } from 'react-i18next';\nimport { useTranslationLoose } from './useTranslation';\n\n/**\n * `<Trans>` props for a known dictionary namespace: `i18nKey` is validated\n * against the dictionary's dot-paths, matching the strength of `useIntlayer`.\n */\ntype TypedTransProps<N extends DictionaryKeys, P extends string> = Omit<\n TransProps<string>,\n 'i18nKey' | 'ns'\n> & {\n /** Dictionary namespace the `i18nKey` is validated against. */\n ns: N | readonly N[];\n /** Typed dot-path key into the `ns` dictionary. */\n i18nKey: P;\n};\n\n/**\n * Overload set for {@link Trans}: with a `ns` prop the `i18nKey` is a typed\n * dot-path of that dictionary; without one the key falls back to the default\n * namespace and stays loosely typed.\n */\ntype TypedTrans = {\n <N extends DictionaryKeys, P extends ValidDotPathsFor<N>>(\n props: TypedTransProps<N, P>\n ): ReactElement;\n (props: TransProps<string> & { ns?: undefined }): ReactElement;\n};\n\n/**\n * Renders parsed message tokens to React nodes, mapping tags to the\n * `components` prop (object or array form) or to the JSX children\n * (numbered tags `<1>…</1>` index into the children, react-i18next style).\n */\nconst renderTokens = (\n tokens: TaggedMessageToken[],\n components: Record<string, ReactElement> | readonly ReactElement[],\n childrenArray: ReactNode[]\n): ReactNode[] =>\n tokens.map((token, tokenIndex) => {\n if (typeof token === 'string') return token;\n\n const renderedChildren = renderTokens(\n token.children,\n components,\n childrenArray\n );\n\n const mappedComponent = Array.isArray(components)\n ? components[Number(token.tag)]\n : (components as Record<string, ReactElement>)[token.tag];\n\n const fallbackChild = /^\\d+$/.test(token.tag)\n ? childrenArray[Number(token.tag)]\n : undefined;\n\n const elementToClone = mappedComponent ?? fallbackChild;\n\n if (isValidElement(elementToClone)) {\n return cloneElement(\n elementToClone as ReactElement<{ children?: ReactNode }>,\n { key: tokenIndex },\n ...(renderedChildren.length\n ? renderedChildren\n : [\n (elementToClone as ReactElement<{ children?: ReactNode }>).props\n .children,\n ])\n );\n }\n\n // Native HTML tag in the message without a mapping — render it as-is\n if (/^[a-z][\\w-]*$/.test(token.tag)) {\n const NativeTag = token.tag as keyof React.JSX.IntrinsicElements;\n return <NativeTag key={tokenIndex}>{renderedChildren}</NativeTag>;\n }\n\n // Unknown numbered tag — render its children unwrapped\n return <Fragment key={tokenIndex}>{renderedChildren}</Fragment>;\n });\n\n/**\n * Drop-in for react-i18next's `<Trans>`.\n *\n * Supports `values` interpolation, `count` plural resolution, `context`,\n * `defaults` fallback, and component interpolation through the `components`\n * prop (object or array form) or numbered tags mapped onto JSX children.\n *\n * @example\n * ```tsx\n * <Trans i18nKey=\"richText\" components={{ bold: <strong /> }} />\n * <Trans i18nKey=\"hello\" count={2} values={{ name: 'John' }}>\n * Hello <b>{'{{name}}'}</b>\n * </Trans>\n * ```\n */\nexport const Trans = function Trans<\n Key extends string = string,\n Ns extends Namespace = Namespace,\n>({\n i18nKey,\n ns,\n values,\n count,\n context,\n defaults,\n components,\n tOptions,\n children,\n}: TransProps<Key, Ns>): React.ReactElement {\n const { t } = useTranslationLoose(Array.isArray(ns) ? ns[0] : ns);\n\n const translateOptions: TOptions = {\n ...((tOptions ?? {}) as TOptions),\n ...((values ?? {}) as Record<string, unknown>),\n };\n if (count !== undefined) translateOptions.count = count;\n if (context !== undefined) translateOptions.context = context;\n if (typeof defaults === 'string') translateOptions.defaultValue = defaults;\n\n const message = i18nKey\n ? t(i18nKey as string, translateOptions)\n : (defaults ?? '');\n\n const resolvedMessage =\n typeof message === 'string' && message !== i18nKey\n ? message\n : (defaults ?? message);\n\n if (typeof resolvedMessage !== 'string') {\n return <>{children ?? resolvedMessage}</>;\n }\n\n const childrenArray = Children.toArray(children);\n\n const tokens = parseTaggedMessage(resolvedMessage);\n const hasTags = tokens.some((token) => typeof token !== 'string');\n\n if (!hasTags && !components) {\n return <>{resolvedMessage}</>;\n }\n\n return (\n <>\n {renderTokens(\n tokens,\n (components ?? {}) as Record<string, ReactElement>,\n childrenArray\n )}\n </>\n );\n} as TypedTrans;\n"],"mappings":";;;;;;;;;;;;;AAmDA,MAAM,gBACJ,QACA,YACA,kBAEA,OAAO,KAAK,OAAO,eAAe;CAChC,IAAI,OAAO,UAAU,UAAU,OAAO;CAEtC,MAAM,mBAAmB,aACvB,MAAM,UACN,YACA,aACF;CAEA,MAAM,kBAAkB,MAAM,QAAQ,UAAU,IAC5C,WAAW,OAAO,MAAM,GAAG,KAC1B,WAA4C,MAAM;CAEvD,MAAM,gBAAgB,QAAQ,KAAK,MAAM,GAAG,IACxC,cAAc,OAAO,MAAM,GAAG,KAC9B;CAEJ,MAAM,iBAAiB,mBAAmB;CAE1C,IAAI,eAAe,cAAc,GAC/B,OAAO,aACL,gBACA,EAAE,KAAK,WAAW,GAClB,GAAI,iBAAiB,SACjB,mBACA,CACG,eAA0D,MACxD,QACL,CACN;CAIF,IAAI,gBAAgB,KAAK,MAAM,GAAG,GAAG;EACnC,MAAM,YAAY,MAAM;EACxB,OAAO,oBAAC,WAAD,YAA6B,iBAA4B,GAAzC,UAAyC;CAClE;CAGA,OAAO,oBAAC,UAAD,YAA4B,iBAA2B,GAAxC,UAAwC;AAChE,CAAC;;;;;;;;;;;;;;;;AAiBH,MAAa,QAAQ,SAAS,MAG5B,EACA,SACA,IACA,QACA,OACA,SACA,UACA,YACA,UACA,YAC0C;CAC1C,MAAM,EAAE,MAAM,oBAAoB,MAAM,QAAQ,EAAE,IAAI,GAAG,KAAK,EAAE;CAEhE,MAAM,mBAA6B;EACjC,GAAK,YAAY,CAAC;EAClB,GAAK,UAAU,CAAC;CAClB;CACA,IAAI,UAAU,QAAW,iBAAiB,QAAQ;CAClD,IAAI,YAAY,QAAW,iBAAiB,UAAU;CACtD,IAAI,OAAO,aAAa,UAAU,iBAAiB,eAAe;CAElE,MAAM,UAAU,UACZ,EAAE,SAAmB,gBAAgB,IACpC,YAAY;CAEjB,MAAM,kBACJ,OAAO,YAAY,YAAY,YAAY,UACvC,UACC,YAAY;CAEnB,IAAI,OAAO,oBAAoB,UAC7B,OAAO,4CAAG,YAAY,gBAAkB;CAG1C,MAAM,gBAAgB,SAAS,QAAQ,QAAQ;CAE/C,MAAM,SAAS,mBAAmB,eAAe;CAGjD,IAAI,CAFY,OAAO,MAAM,UAAU,OAAO,UAAU,QAE7C,KAAK,CAAC,YACf,OAAO,4CAAG,gBAAkB;CAG9B,OACE,4CACG,aACC,QACC,cAAc,CAAC,GAChB,aACF,EACA;AAEN"}
|
package/dist/esm/helpers.mjs
CHANGED
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,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { createTranslationApi } from "./createTranslationApi.mjs";
|
|
4
|
-
import { useDictionary as useDictionary$1, useLocale } from "react-intlayer";
|
|
5
4
|
import { useMemo } from "react";
|
|
5
|
+
import { useDictionary as useDictionary$1, useLocale } from "react-intlayer";
|
|
6
6
|
|
|
7
7
|
// src/useDictionary.ts
|
|
8
8
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { createTranslationApi } from "./createTranslationApi.mjs";
|
|
4
|
-
import { useDictionaryDynamic as useDictionaryDynamic$1, useLocale } from "react-intlayer";
|
|
5
4
|
import { useMemo } from "react";
|
|
5
|
+
import { useDictionaryDynamic as useDictionaryDynamic$1, useLocale } from "react-intlayer";
|
|
6
6
|
|
|
7
7
|
// src/useDictionaryDynamic.ts
|
|
8
8
|
/**
|
package/dist/types/Trans.d.ts
CHANGED
|
@@ -1,7 +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";
|
|
4
|
+
import { ValidDotPathsFor } from "@intlayer/core/transpiler";
|
|
5
5
|
/**
|
|
6
6
|
* `<Trans>` props for a known dictionary namespace: `i18nKey` is validated
|
|
7
7
|
* against the dictionary's dot-paths, matching the strength of `useIntlayer`.
|
|
@@ -1,5 +1,5 @@
|
|
|
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
4
|
/** Untyped runtime `t()` produced by {@link createTranslationApi}. */
|
|
5
5
|
export type TranslateFunction = (key: string | string[], optionsOrDefaultValue?: TOptions | string, extraOptions?: TOptions) => string;
|
package/dist/types/helpers.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
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":";;;;;;;;;
|
|
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,8 +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";
|
|
4
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
5
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
6
6
|
/**
|
|
7
7
|
* Overload set for {@link useDictionary}: without a key prefix the returned
|
|
8
8
|
* `t()` is typed against the dictionary's dot-paths; with a prefix (string or
|
|
@@ -1,8 +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";
|
|
4
|
+
import { DictionaryKeys, StrictModeLocaleMap } from "@intlayer/types/module_augmentation";
|
|
5
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
6
6
|
/**
|
|
7
7
|
* Overload set for {@link useDictionaryDynamic}: without a key prefix the
|
|
8
8
|
* returned `t()` is typed against the dictionary's dot-paths; with a prefix
|
|
@@ -1,7 +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";
|
|
3
|
+
import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
4
|
+
import { UseTranslationOptions } from "react-i18next";
|
|
5
5
|
/**
|
|
6
6
|
* Overload set for {@link useTranslation}: with a `keyPrefix` option the
|
|
7
7
|
* returned `t()` accepts relative dot-paths under the prefix; otherwise keys
|
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.7.
|
|
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.7.
|
|
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",
|
|
@@ -93,10 +93,10 @@
|
|
|
93
93
|
"@utils/tsdown-config": "1.0.4",
|
|
94
94
|
"i18next": "26.7.1",
|
|
95
95
|
"react-i18next": "17.1.11",
|
|
96
|
-
"rimraf": "6.1.
|
|
97
|
-
"tsdown": "0.23.
|
|
96
|
+
"rimraf": "6.1.4",
|
|
97
|
+
"tsdown": "0.23.7",
|
|
98
98
|
"typescript": "7.0.2",
|
|
99
|
-
"vite": "8.3.
|
|
99
|
+
"vite": "8.3.7",
|
|
100
100
|
"vitest": "5.1.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|