next-intlayer 3.3.6 → 3.4.6
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/README.md +18 -10
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/types/NextPage.cjs.map +1 -1
- package/dist/cjs/types/index.cjs.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/NextPage.d.ts +8 -1
- package/dist/types/types/NextPage.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -177,17 +177,20 @@ Then add a new layout in your `[locale]` directory:
|
|
|
177
177
|
```tsx
|
|
178
178
|
// src/app/[locale]/layout.tsx
|
|
179
179
|
|
|
180
|
-
import { NextLayoutIntlayer } from "next-intlayer";
|
|
180
|
+
import { type NextLayoutIntlayer } from "next-intlayer";
|
|
181
181
|
import { Inter } from "next/font/google";
|
|
182
182
|
import { getHTMLTextDir } from "intlayer";
|
|
183
183
|
|
|
184
184
|
const inter = Inter({ subsets: ["latin"] });
|
|
185
185
|
|
|
186
|
-
const LocaleLayout: NextLayoutIntlayer = ({ children, params
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
186
|
+
const LocaleLayout: NextLayoutIntlayer = async ({ children, params }) => {
|
|
187
|
+
const { locale } = await params;
|
|
188
|
+
return (
|
|
189
|
+
<html lang={locale} dir={getHTMLTextDir(locale)}>
|
|
190
|
+
<body className={inter.className}>{children}</body>
|
|
191
|
+
</html>
|
|
192
|
+
);
|
|
193
|
+
};
|
|
191
194
|
|
|
192
195
|
export default LocaleLayout;
|
|
193
196
|
```
|
|
@@ -233,7 +236,9 @@ import { ServerComponentExample } from "@component/ServerComponentExample";
|
|
|
233
236
|
import { type NextPageIntlayer, IntlayerClientProvider } from "next-intlayer";
|
|
234
237
|
import { IntlayerServerProvider, useIntlayer } from "next-intlayer/server";
|
|
235
238
|
|
|
236
|
-
const Page: NextPageIntlayer = ({ params
|
|
239
|
+
const Page: NextPageIntlayer = async ({ params }) => {
|
|
240
|
+
const { locale } = await params;
|
|
241
|
+
return (
|
|
237
242
|
const content = useIntlayer("page", locale);
|
|
238
243
|
|
|
239
244
|
return (
|
|
@@ -318,9 +323,12 @@ import { type IConfigLocales, getTranslationContent } from 'intlayer';
|
|
|
318
323
|
import type { Metadata } from 'next';
|
|
319
324
|
import type { LocalParams } from 'next-intlayer';
|
|
320
325
|
|
|
321
|
-
export const generateMetadata = ({
|
|
322
|
-
params
|
|
323
|
-
}:
|
|
326
|
+
export const generateMetadata = async ({
|
|
327
|
+
params,
|
|
328
|
+
}: LocalPromiseParams): Promise<Metadata> => {
|
|
329
|
+
const { locale } = await params;
|
|
330
|
+
|
|
331
|
+
|
|
324
332
|
const t = <T>(content: IConfigLocales<T>) =>
|
|
325
333
|
getTranslationContent(content, locale);
|
|
326
334
|
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getTranslation,\n IntlayerClientContext,\n useIntlayer,\n useTraduction,\n useDictionary,\n useLocaleCookie,\n type IntlayerNode,\n t,\n} from 'react-intlayer';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n NextPageIntlayer,\n NextLayoutIntlayer,\n} from './types/index';\nexport {\n useLocale,\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from './client/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BASO;AACP,kCAAqC;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getTranslation,\n IntlayerClientContext,\n useIntlayer,\n useTraduction,\n useDictionary,\n useLocaleCookie,\n type IntlayerNode,\n t,\n} from 'react-intlayer';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n Next14PageIntlayer,\n Next15PageIntlayer,\n NextPageIntlayer,\n NextLayoutIntlayer,\n LocalPromiseParams,\n} from './types/index';\nexport {\n useLocale,\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from './client/index';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BASO;AACP,kCAAqC;AASrC,oBAIO;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/NextPage.ts"],"sourcesContent":["import type { Locales } from 'intlayer';\nimport type { NextPage } from 'next';\nimport type { PropsWithChildren } from 'react';\n\nexport type LocalParams<T = undefined> = {\n params: { locale: Locales } & T;\n};\n\nexport type
|
|
1
|
+
{"version":3,"sources":["../../../src/types/NextPage.ts"],"sourcesContent":["import type { Locales } from 'intlayer';\nimport type { NextPage } from 'next';\nimport type { PropsWithChildren } from 'react';\n\nexport type LocalParams<T = undefined> = {\n params: { locale: Locales } & T;\n};\n\nexport type LocalPromiseParams<T = undefined> = {\n params: Promise<{ locale: Locales } & T>;\n};\n\nexport type Next14PageIntlayer<T = undefined> = NextPage<LocalParams<T>>;\nexport type Next15PageIntlayer<T = undefined> = NextPage<LocalPromiseParams<T>>;\nexport type NextPageIntlayer<T = undefined> = Next15PageIntlayer<T>;\nexport type NextLayoutIntlayer<T = undefined> = NextPage<\n PropsWithChildren<LocalParams<T>>\n>;\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/types/index.ts"],"sourcesContent":["export type {\n LocalParams,\n NextPageIntlayer,\n NextLayoutIntlayer,\n} from './NextPage';\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/types/index.ts"],"sourcesContent":["export type {\n LocalParams,\n Next14PageIntlayer,\n Next15PageIntlayer,\n NextPageIntlayer,\n NextLayoutIntlayer,\n LocalPromiseParams,\n} from './NextPage';\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getTranslation,\n IntlayerClientContext,\n useIntlayer,\n useTraduction,\n useDictionary,\n useLocaleCookie,\n type IntlayerNode,\n t,\n} from 'react-intlayer';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n NextPageIntlayer,\n NextLayoutIntlayer,\n} from './types/index';\nexport {\n useLocale,\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from './client/index';\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,4BAA4B;
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export {\n getTranslation,\n IntlayerClientContext,\n useIntlayer,\n useTraduction,\n useDictionary,\n useLocaleCookie,\n type IntlayerNode,\n t,\n} from 'react-intlayer';\nexport { generateStaticParams } from './generateStaticParams';\nexport type {\n LocalParams,\n Next14PageIntlayer,\n Next15PageIntlayer,\n NextPageIntlayer,\n NextLayoutIntlayer,\n LocalPromiseParams,\n} from './types/index';\nexport {\n useLocale,\n IntlayerClientProvider,\n type IntlayerClientProviderProps,\n} from './client/index';\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AACP,SAAS,4BAA4B;AASrC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { getTranslation, IntlayerClientContext, useIntlayer, useTraduction, useDictionary, useLocaleCookie, type IntlayerNode, t, } from 'react-intlayer';
|
|
2
2
|
export { generateStaticParams } from './generateStaticParams';
|
|
3
|
-
export type { LocalParams, NextPageIntlayer, NextLayoutIntlayer, } from './types/index';
|
|
3
|
+
export type { LocalParams, Next14PageIntlayer, Next15PageIntlayer, NextPageIntlayer, NextLayoutIntlayer, LocalPromiseParams, } from './types/index';
|
|
4
4
|
export { useLocale, IntlayerClientProvider, type IntlayerClientProviderProps, } from './client/index';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,YAAY,EACjB,CAAC,GACF,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,aAAa,EACb,eAAe,EACf,KAAK,YAAY,EACjB,CAAC,GACF,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,gBAAgB,CAAC"}
|
|
@@ -6,6 +6,13 @@ export type LocalParams<T = undefined> = {
|
|
|
6
6
|
locale: Locales;
|
|
7
7
|
} & T;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type LocalPromiseParams<T = undefined> = {
|
|
10
|
+
params: Promise<{
|
|
11
|
+
locale: Locales;
|
|
12
|
+
} & T>;
|
|
13
|
+
};
|
|
14
|
+
export type Next14PageIntlayer<T = undefined> = NextPage<LocalParams<T>>;
|
|
15
|
+
export type Next15PageIntlayer<T = undefined> = NextPage<LocalPromiseParams<T>>;
|
|
16
|
+
export type NextPageIntlayer<T = undefined> = Next15PageIntlayer<T>;
|
|
10
17
|
export type NextLayoutIntlayer<T = undefined> = NextPage<PropsWithChildren<LocalParams<T>>>;
|
|
11
18
|
//# sourceMappingURL=NextPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextPage.d.ts","sourceRoot":"","sources":["../../../src/types/NextPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,SAAS,IAAI;IACvC,MAAM,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"NextPage.d.ts","sourceRoot":"","sources":["../../../src/types/NextPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,SAAS,IAAI;IACvC,MAAM,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,CAAC,CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI;IAC9C,MAAM,EAAE,OAAO,CAAC;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,CAAC,CAAC,CAAC;CAC1C,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AACzE,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,CAAC,CAAC,GAAG,SAAS,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,CACtD,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAClC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { LocalParams, NextPageIntlayer, NextLayoutIntlayer, } from './NextPage';
|
|
1
|
+
export type { LocalParams, Next14PageIntlayer, Next15PageIntlayer, NextPageIntlayer, NextLayoutIntlayer, LocalPromiseParams, } from './NextPage';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-intlayer",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Internationalisation tool for Next.js applications. Declare your multilingual contant in the same lever than your component. Powered by TypeScript, declaration files.",
|
|
6
6
|
"keywords": [
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
],
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"webpack": "^5.96.1",
|
|
75
|
-
"@intlayer/chokidar": "^3.
|
|
76
|
-
"@intlayer/config": "^3.
|
|
77
|
-
"@intlayer/
|
|
78
|
-
"@intlayer/
|
|
79
|
-
"react-intlayer": "^3.
|
|
80
|
-
"@intlayer/
|
|
75
|
+
"@intlayer/chokidar": "^3.4.6",
|
|
76
|
+
"@intlayer/config": "^3.4.6",
|
|
77
|
+
"@intlayer/dictionaries-entry": "^3.4.6",
|
|
78
|
+
"@intlayer/webpack": "^3.4.6",
|
|
79
|
+
"react-intlayer": "^3.4.6",
|
|
80
|
+
"@intlayer/core": "^3.4.6"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@types/node": "^22.10.1",
|
|
@@ -89,21 +89,21 @@
|
|
|
89
89
|
"tsc-alias": "^1.8.10",
|
|
90
90
|
"tsup": "^8.3.5",
|
|
91
91
|
"typescript": "^5.7.2",
|
|
92
|
-
"@utils/eslint-config": "^1.0.4",
|
|
93
92
|
"@utils/ts-config": "^1.0.4",
|
|
93
|
+
"@utils/eslint-config": "^1.0.4",
|
|
94
94
|
"@utils/ts-config-types": "^1.0.4",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
95
|
+
"intlayer": "^3.4.6",
|
|
96
|
+
"@utils/tsup-config": "^1.0.4"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"next": ">=14.0.0 <16.0.0",
|
|
100
100
|
"react": ">=16.0.0 <19.0.0",
|
|
101
|
-
"@intlayer/config": "^3.
|
|
102
|
-
"@intlayer/
|
|
103
|
-
"@intlayer/
|
|
104
|
-
"
|
|
105
|
-
"intlayer": "^3.
|
|
106
|
-
"
|
|
101
|
+
"@intlayer/config": "^3.4.6",
|
|
102
|
+
"@intlayer/dictionaries-entry": "^3.4.6",
|
|
103
|
+
"@intlayer/core": "^3.4.6",
|
|
104
|
+
"react-intlayer": "^3.4.6",
|
|
105
|
+
"@intlayer/webpack": "^3.4.6",
|
|
106
|
+
"intlayer": "^3.4.6"
|
|
107
107
|
},
|
|
108
108
|
"engines": {
|
|
109
109
|
"node": ">=14.18"
|