@intlayer/i18next 9.4.2 → 9.4.4
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/types/createInstance.d.ts +2 -2
- package/dist/types/createInstance.d.ts.map +1 -1
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getDictionary.d.ts.map +1 -1
- package/dist/types/getDictionaryDynamic.d.ts +1 -2
- package/dist/types/getDictionaryDynamic.d.ts.map +1 -1
- package/dist/types/index.d.ts +15 -15
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/plugin/index.d.ts +2 -2
- package/dist/types/plugin/index.d.ts.map +1 -1
- package/dist/types/resolveTranslation.d.ts +3 -4
- package/dist/types/resolveTranslation.d.ts.map +1 -1
- package/dist/types/typedTranslation.d.ts +6 -7
- package/dist/types/typedTranslation.d.ts.map +1 -1
- package/package.json +10 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypedGetFixedT } from "./typedTranslation.js";
|
|
2
2
|
import { createInstance as createInstance$1 } from "i18next";
|
|
3
3
|
//#region src/createInstance.d.ts
|
|
4
|
-
declare const createInstance: typeof createInstance$1;
|
|
4
|
+
export declare const createInstance: typeof createInstance$1;
|
|
5
5
|
//#endregion
|
|
6
|
-
export {
|
|
6
|
+
export type { TypedGetFixedT };
|
|
7
7
|
//# sourceMappingURL=createInstance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createInstance.d.ts","names":[],"sources":["../../src/createInstance.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"createInstance.d.ts","names":[],"sources":["../../src/createInstance.ts"],"mappings":";;;qBAgCa,uBAAuB"}
|
|
@@ -27,7 +27,6 @@ type GetDictionary = {
|
|
|
27
27
|
* const t = getDictionary(aboutDictionary, 'fr');
|
|
28
28
|
* t('counter.label');
|
|
29
29
|
*/
|
|
30
|
-
declare const getDictionary: GetDictionary;
|
|
30
|
+
export declare const getDictionary: GetDictionary;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { getDictionary };
|
|
33
32
|
//# sourceMappingURL=getDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;;KAgBK;GACF,UAAU,YACT,YAAY,GACZ,SAAS,gBACR,eAAe,WAAW;GAC5B,UAAU,YAAY,uBACrB,YAAY,GACZ,QAAQ,2BACR,WAAW,SACV,gBAAgB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getDictionary.d.ts","names":[],"sources":["../../src/getDictionary.ts"],"mappings":";;;;;;;;;KAgBK;GACF,UAAU,YACT,YAAY,GACZ,SAAS,gBACR,eAAe,WAAW;GAC5B,UAAU,YAAY,uBACrB,YAAY,GACZ,QAAQ,2BACR,WAAW,SACV,gBAAgB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;qBAmBnC,eAmBP"}
|
|
@@ -22,7 +22,6 @@ type GetDictionaryDynamic = {
|
|
|
22
22
|
* const t = await getDictionaryDynamic(aboutLoaders, 'about', 'fr');
|
|
23
23
|
* t('counter.label');
|
|
24
24
|
*/
|
|
25
|
-
declare const getDictionaryDynamic: GetDictionaryDynamic;
|
|
25
|
+
export declare const getDictionaryDynamic: GetDictionaryDynamic;
|
|
26
26
|
//#endregion
|
|
27
|
-
export { getDictionaryDynamic };
|
|
28
27
|
//# sourceMappingURL=getDictionaryDynamic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDictionaryDynamic.d.ts","names":[],"sources":["../../src/getDictionaryDynamic.ts"],"mappings":";;;;;;;;;KAiBK;GACF,UAAU,YAAY,UAAU,gBAC/B,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,SAAS,gBACR,QAAQ,eAAe;GACzB,UAAU,YAAY,UAAU,gBAAgB,uBAC/C,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,QAAQ,2BACR,WAAW,SACV,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getDictionaryDynamic.d.ts","names":[],"sources":["../../src/getDictionaryDynamic.ts"],"mappings":";;;;;;;;;KAiBK;GACF,UAAU,YAAY,UAAU,gBAC/B,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,SAAS,gBACR,QAAQ,eAAe;GACzB,UAAU,YAAY,UAAU,gBAAgB,uBAC/C,mBAAmB,0BAA0B,QAAQ,KACrD,KAAK,GACL,QAAQ,2BACR,WAAW,SACV,QAAQ,gBAAgB,GAAG;;;;;;;;;;;;;qBAcnB,sBA6BP"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ import { ResolveTranslationParams, getInterpolationValues, resolveTranslation }
|
|
|
6
6
|
import { InitOptions, TFunction, TOptions, changeLanguage as changeLanguage$1, dir as dir$1, exists as exists$1, hasLoadedNamespace as hasLoadedNamespace$1, i18n, i18n as i18n$1, init as init$1, loadLanguages as loadLanguages$1, loadNamespaces as loadNamespaces$1, loadResources as loadResources$1, reloadResources as reloadResources$1, setDefaultNamespace as setDefaultNamespace$1, t as t$1, use as use$1 } from "i18next";
|
|
7
7
|
//#region src/index.d.ts
|
|
8
8
|
declare const i18next: i18n$1;
|
|
9
|
-
declare const dir: typeof dir$1;
|
|
10
|
-
declare const init: typeof init$1;
|
|
11
|
-
declare const loadResources: typeof loadResources$1;
|
|
12
|
-
declare const reloadResources: typeof reloadResources$1;
|
|
13
|
-
declare const use: typeof use$1;
|
|
14
|
-
declare const changeLanguage: typeof changeLanguage$1;
|
|
9
|
+
export declare const dir: typeof dir$1;
|
|
10
|
+
export declare const init: typeof init$1;
|
|
11
|
+
export declare const loadResources: typeof loadResources$1;
|
|
12
|
+
export declare const reloadResources: typeof reloadResources$1;
|
|
13
|
+
export declare const use: typeof use$1;
|
|
14
|
+
export declare const changeLanguage: typeof changeLanguage$1;
|
|
15
15
|
/**
|
|
16
16
|
* Returns a `t()` function bound to a fixed locale and namespace.
|
|
17
17
|
* When `ns` matches a registered intlayer dictionary key, the returned
|
|
@@ -24,19 +24,19 @@ declare const changeLanguage: typeof changeLanguage$1;
|
|
|
24
24
|
* tAbout('counter.label'); // ✓ typed
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
declare const getFixedT: TypedGetFixedT;
|
|
28
|
-
declare const t: typeof t$1;
|
|
29
|
-
declare const exists: typeof exists$1;
|
|
30
|
-
declare const setDefaultNamespace: typeof setDefaultNamespace$1;
|
|
31
|
-
declare const hasLoadedNamespace: typeof hasLoadedNamespace$1;
|
|
32
|
-
declare const loadNamespaces: typeof loadNamespaces$1;
|
|
33
|
-
declare const loadLanguages: typeof loadLanguages$1;
|
|
27
|
+
export declare const getFixedT: TypedGetFixedT;
|
|
28
|
+
export declare const t: typeof t$1;
|
|
29
|
+
export declare const exists: typeof exists$1;
|
|
30
|
+
export declare const setDefaultNamespace: typeof setDefaultNamespace$1;
|
|
31
|
+
export declare const hasLoadedNamespace: typeof hasLoadedNamespace$1;
|
|
32
|
+
export declare const loadNamespaces: typeof loadNamespaces$1;
|
|
33
|
+
export declare const loadLanguages: typeof loadLanguages$1;
|
|
34
34
|
/**
|
|
35
35
|
* No-op shim for i18next's `keyFromSelector`. This helper is not exposed by
|
|
36
36
|
* every supported i18next version, so a permissive identity function is
|
|
37
37
|
* provided to keep `.keyFromSelector(...)` call-sites working.
|
|
38
38
|
*/
|
|
39
|
-
declare const keyFromSelector: (selector: unknown) => unknown;
|
|
39
|
+
export declare const keyFromSelector: (selector: unknown) => unknown;
|
|
40
40
|
//#endregion
|
|
41
|
-
export { type ContentAtPath, type InitOptions, type ResolveTranslationParams, type ScopedDotPaths, type ScopedTFunction, type TFunction, type TOptions, type TranslatedValue, type TypedGetFixedT, type TypedTFunction,
|
|
41
|
+
export { type ContentAtPath, type InitOptions, type ResolveTranslationParams, type ScopedDotPaths, type ScopedTFunction, type TFunction, type TOptions, type TranslatedValue, type TypedGetFixedT, type TypedTFunction, createInstance, i18next as default, i18next, getDictionary, getDictionaryDynamic, getInterpolationValues, type i18n, resolveTranslation };
|
|
42
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;cAiCM,SAAS;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;cAiCM,SAAS;qBAMF,YAAY;qBACZ,aAAa;qBACb,sBAAsB;qBAEtB,wBAAwB;qBAExB,YAAY;qBACZ,uBAAuB;;;;;;;;;;;;;qBAevB,WAAW;qBAIX,UAAU;qBACV,eAAe;qBACf,4BAA4B;qBAE5B,2BAA2B;qBAE3B,uBAAuB;qBAEvB,sBAAsB;;;;;;qBAQtB,kBAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PluginOption } from "vite";
|
|
2
2
|
import { intlayer } from "vite-intlayer";
|
|
3
3
|
//#region src/plugin/index.d.ts
|
|
4
|
-
declare const i18nextVitePlugin: (options?: Parameters<typeof intlayer>[0]) => PluginOption[];
|
|
4
|
+
export declare const i18nextVitePlugin: (options?: Parameters<typeof intlayer>[0]) => PluginOption[];
|
|
5
5
|
//#endregion
|
|
6
|
-
export { i18nextVitePlugin as default
|
|
6
|
+
export { i18nextVitePlugin as default };
|
|
7
7
|
//# 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":";;;qBASa,oBAAiB,UAClB,kBAAkB,iBAC3B"}
|
|
@@ -3,8 +3,8 @@ import { LocalesValues } from "@intlayer/types/module_augmentation";
|
|
|
3
3
|
import { MessageValues } from "@intlayer/core/messageFormat";
|
|
4
4
|
//#region src/resolveTranslation.d.ts
|
|
5
5
|
/** Extracts interpolation values from i18next `t()` options. */
|
|
6
|
-
declare const getInterpolationValues: (options?: TOptions) => MessageValues;
|
|
7
|
-
type ResolveTranslationParams = {
|
|
6
|
+
export declare const getInterpolationValues: (options?: TOptions) => MessageValues;
|
|
7
|
+
export type ResolveTranslationParams = {
|
|
8
8
|
/** Locale to resolve against. */
|
|
9
9
|
locale: LocalesValues;
|
|
10
10
|
/** Default namespace (dictionary key) when the key has no `ns:` prefix. */
|
|
@@ -40,7 +40,6 @@ type ResolveTranslationParams = {
|
|
|
40
40
|
* cannot be resolved (caller decides between `defaultValue`, fallback keys
|
|
41
41
|
* and key echo).
|
|
42
42
|
*/
|
|
43
|
-
declare const resolveTranslation: ({ locale, namespace, key, options, keySeparator, nsSeparator, depth, dictionaryContent }: ResolveTranslationParams) => unknown;
|
|
43
|
+
export declare const resolveTranslation: ({ locale, namespace, key, options, keySeparator, nsSeparator, depth, dictionaryContent }: ResolveTranslationParams) => unknown;
|
|
44
44
|
//#endregion
|
|
45
|
-
export { ResolveTranslationParams, getInterpolationValues, resolveTranslation };
|
|
46
45
|
//# sourceMappingURL=resolveTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveTranslation.d.ts","names":[],"sources":["../../src/resolveTranslation.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"resolveTranslation.d.ts","names":[],"sources":["../../src/resolveTranslation.ts"],"mappings":";;;;;qBAuHa,yBAAsB,UAAc,aAAW;YAmBhD;;EAEV,QAAQ;;EAER;;EAEA;;EAEA,UAAU;;EAEV;;EAEA;;EAEA;;;;;;;;;;;EAWA;;;;;;;;;;;qBAYW,uBAAkB,QAAA,WAAA,KAAA,SAAA,cAAA,aAAA,OAAA,qBAS5B"}
|
|
@@ -7,18 +7,18 @@ import { DictionaryKeys } from "@intlayer/types/module_augmentation";
|
|
|
7
7
|
* The interpreter-resolved content type at dot-path `P` of dictionary `N` —
|
|
8
8
|
* the same type strength as the base `useIntlayer` hook.
|
|
9
9
|
*/
|
|
10
|
-
type ContentAtPath<N extends DictionaryKeys, P> = GetNestingResult<N, P>;
|
|
10
|
+
export type ContentAtPath<N extends DictionaryKeys, P> = GetNestingResult<N, P>;
|
|
11
11
|
/**
|
|
12
12
|
* The value returned by `t()` for key `P` of dictionary `N`: string literals
|
|
13
13
|
* declared in the dictionary keep their literal type (matching the strength of
|
|
14
14
|
* `useIntlayer`), every other node resolves to `string` at runtime.
|
|
15
15
|
*/
|
|
16
|
-
type TranslatedValue<N extends DictionaryKeys, P> = ContentAtPath<N, P> extends string ? ContentAtPath<N, P> : string;
|
|
16
|
+
export type TranslatedValue<N extends DictionaryKeys, P> = ContentAtPath<N, P> extends string ? ContentAtPath<N, P> : string;
|
|
17
17
|
/**
|
|
18
18
|
* The dot-paths of dictionary `N` relative to the key prefix `Prefix`
|
|
19
19
|
* (`getFixedT(null, 'about', 'counter')` → paths under `about.counter`).
|
|
20
20
|
*/
|
|
21
|
-
type ScopedDotPaths<N extends DictionaryKeys, Prefix extends string> = ValidDotPathsFor<N> extends (infer AllPaths) ? AllPaths extends `${Prefix}.${infer RelativePath}` ? RelativePath : never : never;
|
|
21
|
+
export type ScopedDotPaths<N extends DictionaryKeys, Prefix extends string> = ValidDotPathsFor<N> extends (infer AllPaths) ? AllPaths extends `${Prefix}.${infer RelativePath}` ? RelativePath : never : never;
|
|
22
22
|
/**
|
|
23
23
|
* Fully-typed i18next `t()` bound to the dictionary namespace `N`.
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ type ScopedDotPaths<N extends DictionaryKeys, Prefix extends string> = ValidDotP
|
|
|
26
26
|
* resolved from the content at that path. With `returnObjects: true` the raw
|
|
27
27
|
* content subtree is returned instead of a string.
|
|
28
28
|
*/
|
|
29
|
-
type TypedTFunction<N extends DictionaryKeys> = {
|
|
29
|
+
export type TypedTFunction<N extends DictionaryKeys> = {
|
|
30
30
|
/** Returns the raw content subtree at `key` (i18next `returnObjects`). */
|
|
31
31
|
<P extends ValidDotPathsFor<N>>(key: P | P[], options: TOptions & {
|
|
32
32
|
returnObjects: true;
|
|
@@ -39,7 +39,7 @@ type TypedTFunction<N extends DictionaryKeys> = {
|
|
|
39
39
|
* prefix `Prefix`: keys are relative dot-paths under the prefix, and return
|
|
40
40
|
* types are resolved against the absolute path in the dictionary.
|
|
41
41
|
*/
|
|
42
|
-
type ScopedTFunction<N extends DictionaryKeys, Prefix extends string> = {
|
|
42
|
+
export type ScopedTFunction<N extends DictionaryKeys, Prefix extends string> = {
|
|
43
43
|
/** Returns the raw content subtree at `key` (i18next `returnObjects`). */
|
|
44
44
|
<P extends ScopedDotPaths<N, Prefix>>(key: P | P[], options: TOptions & {
|
|
45
45
|
returnObjects: true;
|
|
@@ -51,10 +51,9 @@ type ScopedTFunction<N extends DictionaryKeys, Prefix extends string> = {
|
|
|
51
51
|
* Typed variant of i18next's `getFixedT`, scoped to an intlayer dictionary
|
|
52
52
|
* namespace. With a `keyPrefix`, keys become relative dot-paths under it.
|
|
53
53
|
*/
|
|
54
|
-
type TypedGetFixedT = {
|
|
54
|
+
export type TypedGetFixedT = {
|
|
55
55
|
<N extends DictionaryKeys, Prefix extends string>(lng: string | readonly string[] | null, ns: N | null | undefined, keyPrefix: Prefix): ScopedTFunction<N, Prefix>;
|
|
56
56
|
<N extends DictionaryKeys>(lng: string | readonly string[] | null, ns?: N | null): TypedTFunction<N>;
|
|
57
57
|
};
|
|
58
58
|
//#endregion
|
|
59
|
-
export { ContentAtPath, ScopedDotPaths, ScopedTFunction, TranslatedValue, TypedGetFixedT, TypedTFunction };
|
|
60
59
|
//# sourceMappingURL=typedTranslation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedTranslation.d.ts","names":[],"sources":["../../src/typedTranslation.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"typedTranslation.d.ts","names":[],"sources":["../../src/typedTranslation.ts"],"mappings":";;;;;;;;;YASY,cAAc,UAAU,gBAAgB,KAAK,iBAAiB,GAAG;;;;;;YAOjE,gBAAgB,UAAU,gBAAgB,KACpD,cAAc,GAAG,oBAAoB,cAAc,GAAG;;;;;YAM5C,eAAe,UAAU,gBAAgB,yBACnD,iBAAiB,kBAAiB,YAC9B,oBAAoB,gBAAgB,iBAClC;;;;;;;;YAWI,eAAe,UAAU;;GAElC,UAAU,iBAAiB,IAC1B,KAAK,IAAI,KACT,SAAS;IAAa;MACrB,cAAc,GAAG;;GAEnB,UAAU,iBAAiB,IAC1B,KAAK,IAAI,KACT,wBAAwB,mBACxB,eAAe,WACd,gBAAgB,GAAG;;;;;;;YAQZ,gBAAgB,UAAU,gBAAgB;;GAEnD,UAAU,eAAe,GAAG,SAC3B,KAAK,IAAI,KACT,SAAS;IAAa;MACrB,cAAc,MAAM,UAAU;;GAEhC,UAAU,eAAe,GAAG,SAC3B,KAAK,IAAI,KACT,wBAAwB,mBACxB,eAAe,WACd,gBAAgB,MAAM,UAAU;;;;;;YAOzB;GACT,UAAU,gBAAgB,uBACzB,wCACA,IAAI,sBACJ,WAAW,SACV,gBAAgB,GAAG;GACrB,UAAU,gBACT,wCACA,KAAK,WACJ,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/i18next",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "i18next API adapter for intlayer — drop-in compatibility layer that exposes the i18next interface while using @intlayer/core under the hood",
|
|
6
6
|
"keywords": [
|
|
@@ -74,24 +74,24 @@
|
|
|
74
74
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@intlayer/config": "9.4.
|
|
78
|
-
"@intlayer/core": "9.4.
|
|
79
|
-
"@intlayer/dictionaries-entry": "9.4.
|
|
80
|
-
"@intlayer/engine": "9.4.
|
|
81
|
-
"@intlayer/types": "9.4.
|
|
82
|
-
"vite-intlayer": "9.4.
|
|
77
|
+
"@intlayer/config": "9.4.4",
|
|
78
|
+
"@intlayer/core": "9.4.4",
|
|
79
|
+
"@intlayer/dictionaries-entry": "9.4.4",
|
|
80
|
+
"@intlayer/engine": "9.4.4",
|
|
81
|
+
"@intlayer/types": "9.4.4",
|
|
82
|
+
"vite-intlayer": "9.4.4"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@types/node": "26.4.1",
|
|
86
86
|
"@utils/ts-config": "1.0.4",
|
|
87
87
|
"@utils/ts-config-types": "1.0.4",
|
|
88
88
|
"@utils/tsdown-config": "1.0.4",
|
|
89
|
-
"i18next": "26.
|
|
89
|
+
"i18next": "26.4.2",
|
|
90
90
|
"rimraf": "6.1.3",
|
|
91
|
-
"tsdown": "0.
|
|
91
|
+
"tsdown": "0.23.0",
|
|
92
92
|
"typescript": "7.0.2",
|
|
93
93
|
"vite": "8.2.2",
|
|
94
|
-
"vitest": "
|
|
94
|
+
"vitest": "5.0.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependencies": {
|
|
97
97
|
"i18next": ">=20.0.0",
|