@intlayer/docs 7.0.3 → 7.0.4-canary.0
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/blog/en/intlayer_with_i18next.md +1620 -54
- package/blog/en/intlayer_with_next-i18next.md +763 -163
- package/blog/en/intlayer_with_next-intl.md +986 -217
- package/blog/en/intlayer_with_react-i18next.md +645 -147
- package/blog/en/intlayer_with_react-intl.md +900 -147
- package/blog/en/next-i18next_vs_next-intl_vs_intlayer.md +1 -1
- package/dist/cjs/generated/blog.entry.cjs +13 -1
- package/dist/cjs/generated/blog.entry.cjs.map +1 -1
- package/dist/cjs/generated/docs.entry.cjs +13 -1
- package/dist/cjs/generated/docs.entry.cjs.map +1 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs +13 -1
- package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
- package/dist/cjs/generated/legal.entry.cjs +13 -1
- package/dist/cjs/generated/legal.entry.cjs.map +1 -1
- package/dist/esm/generated/blog.entry.mjs +13 -2
- package/dist/esm/generated/blog.entry.mjs.map +1 -1
- package/dist/esm/generated/docs.entry.mjs +13 -2
- package/dist/esm/generated/docs.entry.mjs.map +1 -1
- package/dist/esm/generated/frequentQuestions.entry.mjs +13 -2
- package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
- package/dist/esm/generated/legal.entry.mjs +13 -2
- package/dist/esm/generated/legal.entry.mjs.map +1 -1
- package/dist/types/generated/blog.entry.d.ts.map +1 -1
- package/dist/types/generated/docs.entry.d.ts.map +1 -1
- package/dist/types/generated/frequentQuestions.entry.d.ts.map +1 -1
- package/dist/types/generated/legal.entry.d.ts.map +1 -1
- package/docs/de/releases/v7.md +1 -18
- package/docs/en/CI_CD.md +1 -1
- package/docs/en/configuration.md +1 -1
- package/docs/en/formatters.md +1 -1
- package/docs/en/how_works_intlayer.md +1 -1
- package/docs/en/intlayer_CMS.md +1 -1
- package/docs/en/intlayer_cli.md +1 -1
- package/docs/en/intlayer_with_nextjs_14.md +1 -1
- package/docs/en/intlayer_with_nextjs_15.md +1 -1
- package/docs/en/intlayer_with_nextjs_16.md +1 -1
- package/docs/en/intlayer_with_nextjs_page_router.md +1 -1
- package/docs/en/intlayer_with_nuxt.md +1 -1
- package/docs/en/intlayer_with_react_native+expo.md +1 -1
- package/docs/en/intlayer_with_react_router_v7.md +1 -1
- package/docs/en/intlayer_with_tanstack.md +1 -1
- package/docs/en/intlayer_with_vite+preact.md +1 -1
- package/docs/en/intlayer_with_vite+react.md +1 -1
- package/docs/en/intlayer_with_vite+solid.md +1 -1
- package/docs/en/intlayer_with_vite+svelte.md +1 -1
- package/docs/en/intlayer_with_vite+vue.md +1 -1
- package/docs/en/roadmap.md +1 -1
- package/docs/es/releases/v7.md +1 -18
- package/docs/fr/intlayer_with_nextjs_16.md +2 -51
- package/docs/fr/releases/v7.md +1 -18
- package/docs/hi/intlayer_with_nextjs_16.md +3 -2
- package/docs/id/releases/v7.md +1 -18
- package/docs/it/releases/v7.md +1 -18
- package/docs/ja/intlayer_with_nextjs_16.md +44 -205
- package/docs/ja/releases/v7.md +1 -18
- package/docs/ko/releases/v7.md +1 -18
- package/docs/pt/intlayer_with_nextjs_16.md +1 -52
- package/package.json +14 -14
- package/src/generated/blog.entry.ts +26 -3
- package/src/generated/docs.entry.ts +26 -3
- package/src/generated/frequentQuestions.entry.ts +26 -3
- package/src/generated/legal.entry.ts +26 -3
|
@@ -735,37 +735,6 @@ export default metadataContent;
|
|
|
735
735
|
```javascript fileName="src/app/[locale]/metadata.content.cjs" contentDeclarationFormat="commonjs"
|
|
736
736
|
const { t } = require("intlayer");
|
|
737
737
|
|
|
738
|
-
/** @type {import('intlayer').Dictionary<import('next').Metadata>} */
|
|
739
|
-
const metadataContent = {
|
|
740
|
-
key: "page-metadata",
|
|
741
|
-
content: {
|
|
742
|
-
title: t({
|
|
743
|
-
en: "Create Next App",
|
|
744
|
-
fr: "Créer une application Next.js",
|
|
745
|
-
es: "Crear una aplicación Next.js",
|
|
746
|
-
}),
|
|
747
|
-
description: t({
|
|
748
|
-
en: "Generated by create next app",
|
|
749
|
-
fr: "Généré par create next app",
|
|
750
|
-
es: "Generado por create next app",
|
|
751
|
-
}),
|
|
752
|
-
},
|
|
753
|
-
};
|
|
754
|
-
|
|
755
|
-
module.exports = metadataContent;
|
|
756
|
-
fr: "Généré par create next app",
|
|
757
|
-
es: "Generado por create next app",
|
|
758
|
-
pt: "Gerado por create next app",
|
|
759
|
-
}),
|
|
760
|
-
},
|
|
761
|
-
};
|
|
762
|
-
|
|
763
|
-
export default metadataContent;
|
|
764
|
-
```
|
|
765
|
-
|
|
766
|
-
```javascript fileName="src/app/[locale]/metadata.content.cjs" contentDeclarationFormat="commonjs"
|
|
767
|
-
const { t } = require("intlayer");
|
|
768
|
-
|
|
769
738
|
/** @type {import('intlayer').Dictionary<import('next').Metadata>} */
|
|
770
739
|
const metadataContent = {
|
|
771
740
|
key: "page-metadata",
|
|
@@ -948,26 +917,6 @@ module.exports = { generateMetadata };
|
|
|
948
917
|
|
|
949
918
|
Alternativamente, você pode usar a função `getTranslation` para declarar seus metadados. No entanto, é recomendável usar arquivos de declaração de conteúdo para automatizar a tradução dos seus metadados e externalizar o conteúdo em algum momento.
|
|
950
919
|
|
|
951
|
-
````typescript fileName="src/app/[locale]/layout.tsx or src/app/[locale]/page.tsx" codeFormat="typescript"
|
|
952
|
-
import {
|
|
953
|
-
type IConfigLocales,
|
|
954
|
-
getTranslation,
|
|
955
|
-
getMultilingualUrls,
|
|
956
|
-
} from "intlayer";
|
|
957
|
-
import type { Metadata } from "next";
|
|
958
|
-
import type { LocalPromiseParams } from "next-intlayer";
|
|
959
|
-
|
|
960
|
-
export const generateMetadata = async ({
|
|
961
|
-
params,
|
|
962
|
-
}: LocalPromiseParams): Promise<Metadata> => {
|
|
963
|
-
const { locale } = await params;
|
|
964
|
-
const t = <T>(content: IConfigLocales<T>) => getTranslation(content, locale);
|
|
965
|
-
|
|
966
|
-
return {
|
|
967
|
-
title: t<string>({
|
|
968
|
-
en: "My title",
|
|
969
|
-
Alternativamente, você pode usar a função `getTranslation` para declarar seus metadados. No entanto, é recomendado usar arquivos de declaração de conteúdo para automatizar a tradução dos seus metadados e externalizar o conteúdo em algum momento.
|
|
970
|
-
|
|
971
920
|
```typescript fileName="src/app/[locale]/layout.tsx or src/app/[locale]/page.tsx" codeFormat="typescript"
|
|
972
921
|
import {
|
|
973
922
|
type IConfigLocales,
|
|
@@ -998,7 +947,7 @@ export const generateMetadata = async ({
|
|
|
998
947
|
};
|
|
999
948
|
|
|
1000
949
|
// ... Resto do código
|
|
1001
|
-
|
|
950
|
+
```
|
|
1002
951
|
|
|
1003
952
|
```javascript fileName="src/app/[locale]/layout.mjs or src/app/[locale]/page.mjs" codeFormat="esm"
|
|
1004
953
|
import { getTranslation, getMultilingualUrls } from "intlayer";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/docs",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.4-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer documentation",
|
|
6
6
|
"keywords": [
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@intlayer/config": "
|
|
73
|
-
"@intlayer/core": "
|
|
74
|
-
"@intlayer/types": "
|
|
72
|
+
"@intlayer/config": "workspace:*",
|
|
73
|
+
"@intlayer/core": "workspace:*",
|
|
74
|
+
"@intlayer/types": "workspace:*"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@intlayer/api": "
|
|
78
|
-
"@intlayer/cli": "
|
|
77
|
+
"@intlayer/api": "workspace:*",
|
|
78
|
+
"@intlayer/cli": "workspace:*",
|
|
79
79
|
"@types/node": "24.9.2",
|
|
80
|
-
"@utils/ts-config": "
|
|
81
|
-
"@utils/ts-config-types": "
|
|
82
|
-
"@utils/tsdown-config": "
|
|
80
|
+
"@utils/ts-config": "workspace:*",
|
|
81
|
+
"@utils/ts-config-types": "workspace:*",
|
|
82
|
+
"@utils/tsdown-config": "workspace:*",
|
|
83
83
|
"fast-glob": "3.3.3",
|
|
84
84
|
"rimraf": "6.0.1",
|
|
85
85
|
"tsdown": "0.15.11",
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
"vitest": "4.0.5"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
|
90
|
-
"@intlayer/api": "
|
|
91
|
-
"@intlayer/cli": "
|
|
92
|
-
"@intlayer/config": "
|
|
93
|
-
"@intlayer/core": "
|
|
94
|
-
"@intlayer/types": "
|
|
90
|
+
"@intlayer/api": "workspace:*",
|
|
91
|
+
"@intlayer/cli": "workspace:*",
|
|
92
|
+
"@intlayer/config": "workspace:*",
|
|
93
|
+
"@intlayer/core": "workspace:*",
|
|
94
|
+
"@intlayer/types": "workspace:*"
|
|
95
95
|
},
|
|
96
96
|
"engines": {
|
|
97
97
|
"node": ">=14.18"
|
|
@@ -2,12 +2,35 @@
|
|
|
2
2
|
/* REGENERATE USING `pnpm prepare` */
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { join, dirname as pathDirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import { getPackageJsonPath, getProjectRequire } from '@intlayer/config';
|
|
7
8
|
import type { LocalesValues } from '@intlayer/types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// Robustly resolve the base directory of the @intlayer/docs package in both
|
|
11
|
+
// bundled environments (Next.js) and standalone CLIs (MCP via npx).
|
|
12
|
+
const currentDir =
|
|
13
|
+
typeof __dirname !== 'undefined'
|
|
14
|
+
? __dirname
|
|
15
|
+
: pathDirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
let baseDir: string;
|
|
18
|
+
try {
|
|
19
|
+
// Prefer resolving from the location of this file (works for CLIs).
|
|
20
|
+
const projectRequire = getProjectRequire(currentDir);
|
|
21
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
22
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
23
|
+
} catch {
|
|
24
|
+
try {
|
|
25
|
+
// Fallback: resolve from the consumer project (works for apps/bundlers).
|
|
26
|
+
const projectRequire = getProjectRequire();
|
|
27
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
28
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
29
|
+
} catch {
|
|
30
|
+
// Last resort: walk up from currentDir (useful when executed inside @intlayer/docs).
|
|
31
|
+
baseDir = getPackageJsonPath(currentDir).baseDir;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
|
|
12
35
|
const readLocale = (
|
|
13
36
|
relativeAfterLocale: string,
|
|
@@ -2,12 +2,35 @@
|
|
|
2
2
|
/* REGENERATE USING `pnpm prepare` */
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { join, dirname as pathDirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import { getPackageJsonPath, getProjectRequire } from '@intlayer/config';
|
|
7
8
|
import type { LocalesValues } from '@intlayer/types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// Robustly resolve the base directory of the @intlayer/docs package in both
|
|
11
|
+
// bundled environments (Next.js) and standalone CLIs (MCP via npx).
|
|
12
|
+
const currentDir =
|
|
13
|
+
typeof __dirname !== 'undefined'
|
|
14
|
+
? __dirname
|
|
15
|
+
: pathDirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
let baseDir: string;
|
|
18
|
+
try {
|
|
19
|
+
// Prefer resolving from the location of this file (works for CLIs).
|
|
20
|
+
const projectRequire = getProjectRequire(currentDir);
|
|
21
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
22
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
23
|
+
} catch {
|
|
24
|
+
try {
|
|
25
|
+
// Fallback: resolve from the consumer project (works for apps/bundlers).
|
|
26
|
+
const projectRequire = getProjectRequire();
|
|
27
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
28
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
29
|
+
} catch {
|
|
30
|
+
// Last resort: walk up from currentDir (useful when executed inside @intlayer/docs).
|
|
31
|
+
baseDir = getPackageJsonPath(currentDir).baseDir;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
|
|
12
35
|
const readLocale = (
|
|
13
36
|
relativeAfterLocale: string,
|
|
@@ -2,12 +2,35 @@
|
|
|
2
2
|
/* REGENERATE USING `pnpm prepare` */
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { join, dirname as pathDirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import { getPackageJsonPath, getProjectRequire } from '@intlayer/config';
|
|
7
8
|
import type { LocalesValues } from '@intlayer/types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// Robustly resolve the base directory of the @intlayer/docs package in both
|
|
11
|
+
// bundled environments (Next.js) and standalone CLIs (MCP via npx).
|
|
12
|
+
const currentDir =
|
|
13
|
+
typeof __dirname !== 'undefined'
|
|
14
|
+
? __dirname
|
|
15
|
+
: pathDirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
let baseDir: string;
|
|
18
|
+
try {
|
|
19
|
+
// Prefer resolving from the location of this file (works for CLIs).
|
|
20
|
+
const projectRequire = getProjectRequire(currentDir);
|
|
21
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
22
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
23
|
+
} catch {
|
|
24
|
+
try {
|
|
25
|
+
// Fallback: resolve from the consumer project (works for apps/bundlers).
|
|
26
|
+
const projectRequire = getProjectRequire();
|
|
27
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
28
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
29
|
+
} catch {
|
|
30
|
+
// Last resort: walk up from currentDir (useful when executed inside @intlayer/docs).
|
|
31
|
+
baseDir = getPackageJsonPath(currentDir).baseDir;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
|
|
12
35
|
const readLocale = (
|
|
13
36
|
relativeAfterLocale: string,
|
|
@@ -2,12 +2,35 @@
|
|
|
2
2
|
/* REGENERATE USING `pnpm prepare` */
|
|
3
3
|
import { existsSync } from 'node:fs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
|
-
import { join } from 'node:path';
|
|
5
|
+
import { join, dirname as pathDirname } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
6
7
|
import { getPackageJsonPath, getProjectRequire } from '@intlayer/config';
|
|
7
8
|
import type { LocalesValues } from '@intlayer/types';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// Robustly resolve the base directory of the @intlayer/docs package in both
|
|
11
|
+
// bundled environments (Next.js) and standalone CLIs (MCP via npx).
|
|
12
|
+
const currentDir =
|
|
13
|
+
typeof __dirname !== 'undefined'
|
|
14
|
+
? __dirname
|
|
15
|
+
: pathDirname(fileURLToPath(import.meta.url));
|
|
16
|
+
|
|
17
|
+
let baseDir: string;
|
|
18
|
+
try {
|
|
19
|
+
// Prefer resolving from the location of this file (works for CLIs).
|
|
20
|
+
const projectRequire = getProjectRequire(currentDir);
|
|
21
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
22
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
23
|
+
} catch {
|
|
24
|
+
try {
|
|
25
|
+
// Fallback: resolve from the consumer project (works for apps/bundlers).
|
|
26
|
+
const projectRequire = getProjectRequire();
|
|
27
|
+
const docEntryPath = projectRequire.resolve('@intlayer/docs');
|
|
28
|
+
baseDir = getPackageJsonPath(docEntryPath).baseDir;
|
|
29
|
+
} catch {
|
|
30
|
+
// Last resort: walk up from currentDir (useful when executed inside @intlayer/docs).
|
|
31
|
+
baseDir = getPackageJsonPath(currentDir).baseDir;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
11
34
|
|
|
12
35
|
const readLocale = (
|
|
13
36
|
relativeAfterLocale: string,
|