@intlayer/docs 5.5.12 → 5.6.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/dist/cjs/common.cjs.map +1 -1
- package/dist/esm/common.mjs.map +1 -1
- package/dist/types/common.d.ts +2 -0
- package/dist/types/common.d.ts.map +1 -1
- package/docs/ar/intlayer_CMS.md +1 -0
- package/docs/ar/intlayer_cli.md +292 -177
- package/docs/ar/intlayer_visual_editor.md +1 -0
- package/docs/ar/intlayer_with_angular.md +1 -0
- package/docs/ar/intlayer_with_create_react_app.md +1 -0
- package/docs/ar/intlayer_with_lynx+react.md +1 -0
- package/docs/ar/intlayer_with_nextjs_14.md +1 -0
- package/docs/ar/intlayer_with_nextjs_15.md +3 -1
- package/docs/ar/intlayer_with_nuxt.md +1 -0
- package/docs/ar/intlayer_with_react_native+expo.md +1 -0
- package/docs/ar/intlayer_with_vite+preact.md +4 -3
- package/docs/ar/intlayer_with_vite+react.md +8 -4
- package/docs/ar/intlayer_with_vite+solid.md +4 -3
- package/docs/ar/intlayer_with_vite+svelte.md +4 -3
- package/docs/ar/intlayer_with_vite+vue.md +5 -4
- package/docs/ar/mcp_server.md +126 -92
- package/docs/de/intlayer_CMS.md +1 -0
- package/docs/de/intlayer_cli.md +291 -171
- package/docs/de/intlayer_visual_editor.md +1 -0
- package/docs/de/intlayer_with_angular.md +1 -0
- package/docs/de/intlayer_with_create_react_app.md +1 -0
- package/docs/de/intlayer_with_lynx+react.md +1 -0
- package/docs/de/intlayer_with_nextjs_14.md +1 -0
- package/docs/de/intlayer_with_nextjs_15.md +3 -1
- package/docs/de/intlayer_with_nuxt.md +1 -0
- package/docs/de/intlayer_with_react_native+expo.md +1 -0
- package/docs/de/intlayer_with_vite+preact.md +4 -3
- package/docs/de/intlayer_with_vite+react.md +7 -4
- package/docs/de/intlayer_with_vite+solid.md +4 -3
- package/docs/de/intlayer_with_vite+svelte.md +4 -3
- package/docs/de/intlayer_with_vite+vue.md +5 -4
- package/docs/de/mcp_server.md +116 -112
- package/docs/en/configuration.md +7 -6
- package/docs/en/intlayer_CMS.md +1 -0
- package/docs/en/intlayer_cli.md +246 -138
- package/docs/en/intlayer_visual_editor.md +1 -0
- package/docs/en/intlayer_with_angular.md +1 -0
- package/docs/en/intlayer_with_create_react_app.md +1 -0
- package/docs/en/intlayer_with_lynx+react.md +1 -0
- package/docs/en/intlayer_with_nextjs_14.md +1 -0
- package/docs/en/intlayer_with_nextjs_15.md +3 -1
- package/docs/en/intlayer_with_nuxt.md +1 -0
- package/docs/en/intlayer_with_react_native+expo.md +1 -0
- package/docs/en/intlayer_with_vite+preact.md +6 -3
- package/docs/en/intlayer_with_vite+react.md +9 -3
- package/docs/en/intlayer_with_vite+solid.md +4 -3
- package/docs/en/intlayer_with_vite+svelte.md +4 -3
- package/docs/en/intlayer_with_vite+vue.md +7 -4
- package/docs/en/mcp_server.md +100 -107
- package/docs/en-GB/intlayer_CMS.md +1 -0
- package/docs/en-GB/intlayer_cli.md +257 -138
- package/docs/en-GB/intlayer_visual_editor.md +1 -0
- package/docs/en-GB/intlayer_with_angular.md +1 -0
- package/docs/en-GB/intlayer_with_create_react_app.md +1 -0
- package/docs/en-GB/intlayer_with_lynx+react.md +1 -0
- package/docs/en-GB/intlayer_with_nextjs_14.md +1 -0
- package/docs/en-GB/intlayer_with_nextjs_15.md +3 -1
- package/docs/en-GB/intlayer_with_nuxt.md +1 -0
- package/docs/en-GB/intlayer_with_react_native+expo.md +1 -0
- package/docs/en-GB/intlayer_with_vite+preact.md +4 -3
- package/docs/en-GB/intlayer_with_vite+react.md +7 -4
- package/docs/en-GB/intlayer_with_vite+solid.md +4 -3
- package/docs/en-GB/intlayer_with_vite+svelte.md +4 -3
- package/docs/en-GB/intlayer_with_vite+vue.md +5 -4
- package/docs/en-GB/mcp_server.md +116 -82
- package/docs/es/intlayer_CMS.md +1 -0
- package/docs/es/intlayer_cli.md +283 -164
- package/docs/es/intlayer_visual_editor.md +1 -0
- package/docs/es/intlayer_with_angular.md +1 -0
- package/docs/es/intlayer_with_create_react_app.md +1 -0
- package/docs/es/intlayer_with_lynx+react.md +1 -0
- package/docs/es/intlayer_with_nextjs_14.md +1 -0
- package/docs/es/intlayer_with_nextjs_15.md +3 -1
- package/docs/es/intlayer_with_nuxt.md +1 -0
- package/docs/es/intlayer_with_react_native+expo.md +1 -0
- package/docs/es/intlayer_with_vite+preact.md +4 -3
- package/docs/es/intlayer_with_vite+react.md +7 -4
- package/docs/es/intlayer_with_vite+solid.md +4 -3
- package/docs/es/intlayer_with_vite+svelte.md +4 -3
- package/docs/es/intlayer_with_vite+vue.md +5 -4
- package/docs/es/mcp_server.md +120 -86
- package/docs/es/vs_code_extension.md +1 -0
- package/docs/fr/intlayer_CMS.md +1 -0
- package/docs/fr/intlayer_cli.md +280 -184
- package/docs/fr/intlayer_visual_editor.md +1 -0
- package/docs/fr/intlayer_with_angular.md +1 -0
- package/docs/fr/intlayer_with_create_react_app.md +1 -0
- package/docs/fr/intlayer_with_lynx+react.md +1 -0
- package/docs/fr/intlayer_with_nextjs_14.md +1 -0
- package/docs/fr/intlayer_with_nextjs_15.md +3 -1
- package/docs/fr/intlayer_with_nuxt.md +1 -0
- package/docs/fr/intlayer_with_react_native+expo.md +1 -0
- package/docs/fr/intlayer_with_vite+preact.md +5 -4
- package/docs/fr/intlayer_with_vite+react.md +7 -4
- package/docs/fr/intlayer_with_vite+solid.md +4 -3
- package/docs/fr/intlayer_with_vite+svelte.md +4 -3
- package/docs/fr/intlayer_with_vite+vue.md +5 -4
- package/docs/fr/mcp_server.md +121 -87
- package/docs/hi/intlayer_CMS.md +1 -0
- package/docs/hi/intlayer_cli.md +295 -174
- package/docs/hi/intlayer_visual_editor.md +1 -0
- package/docs/hi/intlayer_with_angular.md +1 -0
- package/docs/hi/intlayer_with_create_react_app.md +1 -0
- package/docs/hi/intlayer_with_lynx+react.md +1 -0
- package/docs/hi/intlayer_with_nextjs_14.md +1 -0
- package/docs/hi/intlayer_with_nextjs_15.md +3 -1
- package/docs/hi/intlayer_with_nuxt.md +1 -0
- package/docs/hi/intlayer_with_react_native+expo.md +1 -0
- package/docs/hi/intlayer_with_vite+preact.md +4 -3
- package/docs/hi/intlayer_with_vite+react.md +7 -4
- package/docs/hi/intlayer_with_vite+solid.md +4 -3
- package/docs/hi/intlayer_with_vite+svelte.md +4 -3
- package/docs/hi/intlayer_with_vite+vue.md +5 -4
- package/docs/hi/mcp_server.md +118 -84
- package/docs/it/intlayer_CMS.md +1 -0
- package/docs/it/intlayer_cli.md +282 -167
- package/docs/it/intlayer_visual_editor.md +1 -0
- package/docs/it/intlayer_with_angular.md +1 -0
- package/docs/it/intlayer_with_create_react_app.md +1 -0
- package/docs/it/intlayer_with_lynx+react.md +1 -0
- package/docs/it/intlayer_with_nextjs_14.md +1 -0
- package/docs/it/intlayer_with_nextjs_15.md +3 -1
- package/docs/it/intlayer_with_nuxt.md +1 -0
- package/docs/it/intlayer_with_react_native+expo.md +1 -0
- package/docs/it/intlayer_with_vite+preact.md +4 -3
- package/docs/it/intlayer_with_vite+react.md +7 -4
- package/docs/it/intlayer_with_vite+solid.md +4 -3
- package/docs/it/intlayer_with_vite+svelte.md +4 -3
- package/docs/it/intlayer_with_vite+vue.md +4 -4
- package/docs/it/mcp_server.md +120 -86
- package/docs/ja/intlayer_CMS.md +1 -0
- package/docs/ja/intlayer_cli.md +285 -168
- package/docs/ja/intlayer_visual_editor.md +1 -0
- package/docs/ja/intlayer_with_angular.md +1 -0
- package/docs/ja/intlayer_with_create_react_app.md +1 -0
- package/docs/ja/intlayer_with_lynx+react.md +1 -0
- package/docs/ja/intlayer_with_nextjs_14.md +1 -0
- package/docs/ja/intlayer_with_nextjs_15.md +3 -1
- package/docs/ja/intlayer_with_nuxt.md +1 -0
- package/docs/ja/intlayer_with_react_native+expo.md +1 -0
- package/docs/ja/intlayer_with_vite+preact.md +4 -3
- package/docs/ja/intlayer_with_vite+react.md +7 -4
- package/docs/ja/intlayer_with_vite+solid.md +4 -3
- package/docs/ja/intlayer_with_vite+svelte.md +4 -3
- package/docs/ja/intlayer_with_vite+vue.md +5 -4
- package/docs/ja/mcp_server.md +121 -85
- package/docs/ko/intlayer_CMS.md +1 -0
- package/docs/ko/intlayer_cli.md +291 -175
- package/docs/ko/intlayer_visual_editor.md +1 -0
- package/docs/ko/intlayer_with_angular.md +1 -0
- package/docs/ko/intlayer_with_create_react_app.md +1 -0
- package/docs/ko/intlayer_with_lynx+react.md +1 -0
- package/docs/ko/intlayer_with_nextjs_14.md +1 -0
- package/docs/ko/intlayer_with_nextjs_15.md +3 -1
- package/docs/ko/intlayer_with_nuxt.md +1 -0
- package/docs/ko/intlayer_with_react_native+expo.md +1 -0
- package/docs/ko/intlayer_with_vite+preact.md +4 -3
- package/docs/ko/intlayer_with_vite+react.md +7 -4
- package/docs/ko/intlayer_with_vite+solid.md +4 -3
- package/docs/ko/intlayer_with_vite+svelte.md +4 -3
- package/docs/ko/intlayer_with_vite+vue.md +5 -4
- package/docs/ko/mcp_server.md +117 -83
- package/docs/pt/intlayer_CMS.md +1 -0
- package/docs/pt/intlayer_cli.md +274 -154
- package/docs/pt/intlayer_visual_editor.md +1 -0
- package/docs/pt/intlayer_with_angular.md +1 -0
- package/docs/pt/intlayer_with_create_react_app.md +1 -0
- package/docs/pt/intlayer_with_lynx+react.md +1 -0
- package/docs/pt/intlayer_with_nextjs_14.md +1 -0
- package/docs/pt/intlayer_with_nextjs_15.md +3 -1
- package/docs/pt/intlayer_with_nuxt.md +1 -0
- package/docs/pt/intlayer_with_react_native+expo.md +1 -0
- package/docs/pt/intlayer_with_vite+preact.md +4 -3
- package/docs/pt/intlayer_with_vite+react.md +7 -4
- package/docs/pt/intlayer_with_vite+solid.md +4 -3
- package/docs/pt/intlayer_with_vite+svelte.md +4 -3
- package/docs/pt/intlayer_with_vite+vue.md +4 -4
- package/docs/pt/mcp_server.md +121 -87
- package/docs/ru/intlayer_CMS.md +1 -0
- package/docs/ru/intlayer_cli.md +287 -170
- package/docs/ru/intlayer_visual_editor.md +1 -0
- package/docs/ru/intlayer_with_angular.md +1 -0
- package/docs/ru/intlayer_with_create_react_app.md +1 -0
- package/docs/ru/intlayer_with_lynx+react.md +1 -0
- package/docs/ru/intlayer_with_nextjs_14.md +1 -0
- package/docs/ru/intlayer_with_nextjs_15.md +3 -1
- package/docs/ru/intlayer_with_nuxt.md +1 -0
- package/docs/ru/intlayer_with_react_native+expo.md +1 -0
- package/docs/ru/intlayer_with_vite+preact.md +4 -3
- package/docs/ru/intlayer_with_vite+react.md +7 -4
- package/docs/ru/intlayer_with_vite+solid.md +4 -3
- package/docs/ru/intlayer_with_vite+svelte.md +4 -3
- package/docs/ru/intlayer_with_vite+vue.md +5 -4
- package/docs/ru/mcp_server.md +119 -85
- package/docs/zh/intlayer_CMS.md +1 -0
- package/docs/zh/intlayer_cli.md +275 -155
- package/docs/zh/intlayer_visual_editor.md +1 -0
- package/docs/zh/intlayer_with_angular.md +1 -0
- package/docs/zh/intlayer_with_create_react_app.md +1 -0
- package/docs/zh/intlayer_with_lynx+react.md +1 -0
- package/docs/zh/intlayer_with_nextjs_14.md +1 -0
- package/docs/zh/intlayer_with_nextjs_15.md +3 -1
- package/docs/zh/intlayer_with_nuxt.md +1 -0
- package/docs/zh/intlayer_with_react_native+expo.md +1 -0
- package/docs/zh/intlayer_with_vite+preact.md +4 -3
- package/docs/zh/intlayer_with_vite+react.md +7 -4
- package/docs/zh/intlayer_with_vite+solid.md +4 -3
- package/docs/zh/intlayer_with_vite+svelte.md +4 -3
- package/docs/zh/intlayer_with_vite+vue.md +5 -4
- package/docs/zh/mcp_server.md +119 -86
- package/package.json +10 -10
- package/src/common.ts +2 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2024-08-11
|
|
3
|
-
updatedAt: 2025-
|
|
3
|
+
updatedAt: 2025-07-11
|
|
4
4
|
title: CLI
|
|
5
5
|
description: Discover how to use the Intlayer CLI to manage your multilingual website. Follow the steps in this online documentation to set up your project in a few minutes.
|
|
6
6
|
keywords:
|
|
@@ -36,15 +36,15 @@ yarn add intlayer-cli -g
|
|
|
36
36
|
pnpm add intlayer-cli -g
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
> If the `intlayer` package is already installed, the CLI is installed
|
|
39
|
+
> If the `intlayer` package is already installed, the CLI is automatically installed. You can skip this step.
|
|
40
40
|
|
|
41
41
|
## intlayer-cli package
|
|
42
42
|
|
|
43
|
-
The `intlayer-cli` package is intended to transpile your [intlayer declarations](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
43
|
+
The `intlayer-cli` package is intended to transpile your [intlayer declarations](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/dictionary/get_started.md) into dictionaries.
|
|
44
44
|
|
|
45
45
|
This package will transpile all intlayer files, such as `src/**/*.content.{ts|js|mjs|cjs|json}`. [See how to declare your Intlayer declaration files](https://github.com/aymericzip/intlayer/blob/main/packages/intlayer/README.md).
|
|
46
46
|
|
|
47
|
-
To interpret intlayer dictionaries
|
|
47
|
+
To interpret intlayer dictionaries you can use interpreters, such as [react-intlayer](https://www.npmjs.com/package/react-intlayer), or [next-intlayer](https://www.npmjs.com/package/next-intlayer).
|
|
48
48
|
|
|
49
49
|
## Configuration File Support
|
|
50
50
|
|
|
@@ -57,49 +57,7 @@ Intlayer accepts multiple configuration file formats:
|
|
|
57
57
|
- `intlayer.config.mjs`
|
|
58
58
|
- `.intlayerrc`
|
|
59
59
|
|
|
60
|
-
To see how to configure available locales, or other parameters, refer to the [configuration documentation here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
61
|
-
|
|
62
|
-
## CLI SDK
|
|
63
|
-
|
|
64
|
-
The CLI SDK is a library that allows you to use the Intlayer CLI in your own code.
|
|
65
|
-
|
|
66
|
-
```bash packageManager="npm"
|
|
67
|
-
npm install @intlayer/cli -D
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
```bash packageManager="yarn"
|
|
71
|
-
yarn add @intlayer/cli -D
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
```bash packageManager="pnpm"
|
|
75
|
-
pnpm add @intlayer/cli -D
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Example of usage:
|
|
79
|
-
|
|
80
|
-
```ts
|
|
81
|
-
import {
|
|
82
|
-
push,
|
|
83
|
-
pull,
|
|
84
|
-
fill,
|
|
85
|
-
build,
|
|
86
|
-
docTranslate,
|
|
87
|
-
docReview,
|
|
88
|
-
} from "@intlayer/cli";
|
|
89
|
-
|
|
90
|
-
push();
|
|
91
|
-
// ...
|
|
92
|
-
pull();
|
|
93
|
-
// ...
|
|
94
|
-
fill();
|
|
95
|
-
// ...
|
|
96
|
-
build();
|
|
97
|
-
// ...
|
|
98
|
-
docTranslate();
|
|
99
|
-
// ...
|
|
100
|
-
docReview();
|
|
101
|
-
// ...
|
|
102
|
-
```
|
|
60
|
+
To see how to configure available locales, or other parameters, refer to the [configuration documentation here](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/configuration.md).
|
|
103
61
|
|
|
104
62
|
## Run intlayer commands
|
|
105
63
|
|
|
@@ -128,10 +86,11 @@ This command will find your declaration content files by default as `./src/**/*.
|
|
|
128
86
|
### Push dictionaries
|
|
129
87
|
|
|
130
88
|
```bash
|
|
89
|
+
bash
|
|
131
90
|
npx intlayer dictionary push
|
|
132
91
|
```
|
|
133
92
|
|
|
134
|
-
If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
93
|
+
If the [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/{{locale}}/intlayer_visual_editor.md) is installed, you can also push dictionaries to the editor. This command will make the dictionaries available to [the editor](https://intlayer.org/dashboard). In this way, you can share your dictionaries with your team and edit your content without modifying the code of your application.
|
|
135
94
|
|
|
136
95
|
##### Aliases:
|
|
137
96
|
|
|
@@ -141,22 +100,57 @@ If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
|
141
100
|
|
|
142
101
|
##### Arguments:
|
|
143
102
|
|
|
144
|
-
|
|
103
|
+
**Dictionary options:**
|
|
104
|
+
|
|
105
|
+
- **`-d`, `--dictionaries`**: IDs of the dictionaries to push. If not specified, all dictionaries will be pushed.
|
|
106
|
+
|
|
145
107
|
> Example: `npx intlayer dictionary push -d my-dictionary-id my-other-dictionary-id`
|
|
146
|
-
|
|
108
|
+
|
|
109
|
+
**Configuration options:**
|
|
110
|
+
|
|
111
|
+
- **`--base-dir`**: Specify the base directory for the project. To retrieve the intlayer configuration, the command will look for the `intlayer.config.{ts,js,json,cjs,mjs}` file in the base directory.
|
|
112
|
+
|
|
113
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
114
|
+
|
|
115
|
+
**Environment variables options:**
|
|
116
|
+
|
|
117
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`). Useful if you use environment variables in your intlayer configuration file.
|
|
118
|
+
- **`--env-file`**: Provide a custom environment file to load variables from. Useful if you use environment variables in your intlayer configuration file.
|
|
119
|
+
|
|
120
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
121
|
+
|
|
122
|
+
> Example: `npx intlayer dictionary push --env production`
|
|
123
|
+
|
|
124
|
+
**Output options:**
|
|
125
|
+
|
|
126
|
+
- **`-r`, `--delete-locale-dictionary`**: Skip the question asking whether to delete the locales directories once the dictionaries are pushed, and remove them. By default, if the dictionary is defined locally, it will overwrite remote dictionaries' content.
|
|
127
|
+
|
|
147
128
|
> Example: `npx intlayer dictionary push -r`
|
|
148
|
-
|
|
129
|
+
|
|
130
|
+
> Example: `npx intlayer dictionary push --delete-locale-dictionary`
|
|
131
|
+
|
|
132
|
+
- **`-k`, `--keep-locale-dictionary`**: Skip the question asking whether to delete the locales directories once the dictionaries are pushed, and keep them. By default, if the dictionary is defined locally, it will overwrite remote dictionaries' content.
|
|
133
|
+
|
|
149
134
|
> Example: `npx intlayer dictionary push -k`
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
-
|
|
135
|
+
|
|
136
|
+
> Example: `npx intlayer dictionary push --keep-locale-dictionary`
|
|
137
|
+
|
|
138
|
+
**Log options:**
|
|
139
|
+
|
|
140
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
141
|
+
|
|
142
|
+
**Git options:**
|
|
143
|
+
|
|
144
|
+
- **`--git-diff`**: Only run on dictionaries that include changes from the base (default `origin/main`) to the current branch (default: `HEAD`).
|
|
145
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
146
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default `HEAD`).
|
|
147
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
148
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
149
|
+
- **`--untracked`**: Include untracked files.
|
|
150
|
+
|
|
151
|
+
> Example: `npx intlayer dictionary push --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
152
|
+
|
|
153
|
+
> Example: `npx intlayer dictionary push --uncommitted --unpushed --untracked`
|
|
160
154
|
|
|
161
155
|
### Pull remote dictionaries
|
|
162
156
|
|
|
@@ -164,7 +158,7 @@ If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
|
164
158
|
npx intlayer pull
|
|
165
159
|
```
|
|
166
160
|
|
|
167
|
-
If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en
|
|
161
|
+
If the [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) is installed, you can also pull dictionaries from the editor. This way, you can overwrite the content of your dictionaries to suit the needs of your application.
|
|
168
162
|
|
|
169
163
|
##### Aliases:
|
|
170
164
|
|
|
@@ -174,13 +168,35 @@ If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
|
174
168
|
|
|
175
169
|
##### Arguments:
|
|
176
170
|
|
|
177
|
-
|
|
171
|
+
**Dictionary options:**
|
|
172
|
+
|
|
173
|
+
- **`-d, --dictionaries`**: IDs of the dictionaries to pull. If not specified, all dictionaries will be pulled.
|
|
174
|
+
|
|
178
175
|
> Example: `npx intlayer dictionary pull -d my-dictionary-id my-other-dictionary-id`
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
|
|
176
|
+
|
|
177
|
+
**Configuration options:**
|
|
178
|
+
|
|
179
|
+
- **`--base-dir`**: Specify the base directory for the project. To retrieve the intlayer configuration, the command will look for the `intlayer.config.{ts,js,json,cjs,mjs}` file in the base directory.
|
|
180
|
+
|
|
181
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
182
|
+
|
|
183
|
+
**Environment variables options:**
|
|
184
|
+
|
|
185
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
186
|
+
- **`--env-file`**: Provide a custom environment file to load variables from.
|
|
187
|
+
- **`--base-dir`**: Specify the base directory for the project. To retrieve the intlayer configuration, the command will look for the `intlayer.config.{ts,js,json,cjs,mjs}` file in the base directory.
|
|
188
|
+
|
|
189
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
190
|
+
|
|
191
|
+
> Example: `npx intlayer dictionary push --env production`
|
|
192
|
+
|
|
193
|
+
**Output options:**
|
|
194
|
+
|
|
195
|
+
- **`--new-dictionaries-path`**: Path to the directory where the new dictionaries will be saved. If not specified, the new dictionaries will be saved in the `./intlayer-dictionaries` directory of the project. If a `filePath` field is specified in your dictionary content, the dictionaries will not consider this argument and will be saved in the specified `filePath` directory.
|
|
196
|
+
|
|
197
|
+
**Log options:**
|
|
198
|
+
|
|
199
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
184
200
|
|
|
185
201
|
##### Example:
|
|
186
202
|
|
|
@@ -204,77 +220,74 @@ This command analyses your content declaration files for potential issues such a
|
|
|
204
220
|
|
|
205
221
|
##### Arguments:
|
|
206
222
|
|
|
207
|
-
|
|
208
|
-
|
|
223
|
+
**Files list options:**
|
|
224
|
+
|
|
225
|
+
- **`-f, --file [files...]`**: A list of specific content declaration files to audit. If not provided, all discovered `*.content.{ts,js,mjs,cjs,tsx,jsx,json}` based on your configuration file setup will be audited.
|
|
226
|
+
|
|
227
|
+
> Example: `npx intlayer dictionary fill -f src/home/app.content.ts`
|
|
209
228
|
|
|
210
|
-
-
|
|
211
|
-
Globs pattern to exclude from the audit (e.g. `--exclude "src/test/**"`).
|
|
229
|
+
- **`-k, --keys [keys...]`**: Filter dictionaries based on keys. If not provided, all dictionaries will be audited.
|
|
212
230
|
|
|
213
|
-
|
|
214
|
-
The source locale to translate from. If not specified, the default locale from your configuration will be used.
|
|
231
|
+
> Example: `npx intlayer dictionary fill -k key1 key2`
|
|
215
232
|
|
|
216
|
-
-
|
|
217
|
-
Target locales to translate to. If not specified, all locales from your configuration will be used except the source locale.
|
|
233
|
+
- **`--excluded-keys [excludedKeys...]`**: Filter out dictionaries based on keys. If not provided, all dictionaries will be audited.
|
|
218
234
|
|
|
219
|
-
-
|
|
220
|
-
Translation mode: 'complete', 'review', or 'missing-only'. Default is 'missing-only'.
|
|
235
|
+
> Example: `npx intlayer dictionary fill --excluded-keys key1 key2`
|
|
221
236
|
|
|
222
|
-
-
|
|
223
|
-
Filters dictionaries that include changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
237
|
+
- **`--path-filter [pathFilters...]`**: Filter dictionaries based on glob pattern for file paths.
|
|
224
238
|
|
|
225
|
-
-
|
|
226
|
-
Specify the base reference for git diff (default `origin/main`).
|
|
239
|
+
> Example: `npx intlayer dictionary fill --path-filter "src/home/**"`
|
|
227
240
|
|
|
228
|
-
|
|
229
|
-
Specify the current reference for git diff (default: `HEAD`).
|
|
241
|
+
**Entry output options:**
|
|
230
242
|
|
|
231
|
-
-
|
|
232
|
-
Filters dictionaries that include uncommitted changes.
|
|
243
|
+
- **`--source-locale [sourceLocale]`**: The source locale to translate from. If not specified, the default locale from your configuration will be used.
|
|
233
244
|
|
|
234
|
-
-
|
|
235
|
-
- `--unpushed`
|
|
236
|
-
Filters dictionaries that include unpushed changes.
|
|
245
|
+
- **`--output-locales [outputLocales...]`**: Target locales to translate to. If not specified, all locales from your configuration will be used except the source locale.
|
|
237
246
|
|
|
238
|
-
-
|
|
239
|
-
Filters dictionaries that include untracked files.
|
|
247
|
+
- **`--mode [mode]`**: Translation mode: 'complete', 'review', or 'missing-only'. Default is 'missing-only'.
|
|
240
248
|
|
|
241
|
-
|
|
242
|
-
Filter dictionaries based on specified keys.
|
|
249
|
+
**Git options:**
|
|
243
250
|
|
|
244
|
-
-
|
|
245
|
-
|
|
251
|
+
- **`--git-diff`**: Only run on dictionaries that include changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
252
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
253
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default: `HEAD`).
|
|
254
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
255
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
256
|
+
- **`--untracked`**: Include untracked files.
|
|
246
257
|
|
|
247
|
-
-
|
|
248
|
-
Filter dictionaries based on glob pattern for file paths.
|
|
258
|
+
> Example: `npx intlayer doc translate --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
249
259
|
|
|
250
|
-
|
|
251
|
-
The AI model to use for the translation (e.g., `gpt-3.5-turbo`).
|
|
260
|
+
> Example: `npx intlayer doc translate --uncommitted --unpushed --untracked`
|
|
252
261
|
|
|
253
|
-
|
|
254
|
-
The AI provider to use for the translation.
|
|
262
|
+
**AI options:**
|
|
255
263
|
|
|
256
|
-
-
|
|
257
|
-
|
|
264
|
+
- **`--model [model]`**: The AI model to use for the translation (e.g., `gpt-3.5-turbo`).
|
|
265
|
+
- **`--provider [provider]`**: The AI provider to use for the translation.
|
|
266
|
+
- **`--temperature [temperature]`**: Temperature setting for the AI model.
|
|
267
|
+
- **`--api-key [apiKey]`**: Provide your own API key for the AI service.
|
|
268
|
+
- **`--custom-prompt [prompt]`**: Provide a custom prompt for your translation instructions.
|
|
269
|
+
- **`--application-context [applicationContext]`**: Provide additional context for the AI translation.
|
|
258
270
|
|
|
259
|
-
-
|
|
260
|
-
Provide your own API key for the AI service.
|
|
271
|
+
> Example: `npx intlayer fill --model gpt-3.5-turbo --provider openai --temperature 0.5 --api-key sk-1234567890 --application-context "My application is a cat store"`
|
|
261
272
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
-
|
|
265
|
-
|
|
273
|
+
**Environment variables options:**
|
|
274
|
+
|
|
275
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
276
|
+
- **`--env-file [envFile]`**: Provide a custom environment file to load variables from.
|
|
266
277
|
|
|
267
|
-
-
|
|
268
|
-
Specify the environment (e.g., `development`, `production`).
|
|
278
|
+
> Example: `npx intlayer fill --env-file .env.production.local`
|
|
269
279
|
|
|
270
|
-
|
|
271
|
-
Provide a custom environment file to load variables from.
|
|
280
|
+
> Example: `npx intlayer fill --env production`
|
|
272
281
|
|
|
273
|
-
|
|
274
|
-
Specify the base directory for the project.
|
|
282
|
+
**Configuration options:**
|
|
275
283
|
|
|
276
|
-
-
|
|
277
|
-
|
|
284
|
+
- **`--base-dir`**: Specify the base directory for the project.
|
|
285
|
+
|
|
286
|
+
> Example: `npx intlayer fill --base-dir ./src`
|
|
287
|
+
|
|
288
|
+
**Log options:**
|
|
289
|
+
|
|
290
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
278
291
|
|
|
279
292
|
##### Example:
|
|
280
293
|
|
|
@@ -342,37 +355,97 @@ npx intlayer doc translate
|
|
|
342
355
|
|
|
343
356
|
##### Arguments:
|
|
344
357
|
|
|
358
|
+
**File list options:**
|
|
359
|
+
|
|
345
360
|
- **`--doc-pattern [docPattern...]`**: Glob patterns to match documentation files to translate.
|
|
361
|
+
|
|
346
362
|
> Example: `npx intlayer doc translate --doc-pattern "docs/**/*.md" "src/**/*.mdx"`
|
|
363
|
+
|
|
347
364
|
- **`--excluded-glob-pattern [excludedGlobPattern...]`**: Glob patterns to exclude from translation.
|
|
365
|
+
|
|
348
366
|
> Example: `npx intlayer doc translate --excluded-glob-pattern "docs/internal/**"`
|
|
349
|
-
|
|
350
|
-
|
|
367
|
+
|
|
368
|
+
- **`--skip-if-modified-before [skipIfModifiedBefore]`**: Skip the file if it has been modified before the specified time.
|
|
369
|
+
|
|
370
|
+
- Can be an absolute time such as "2025-12-05" (string or Date)
|
|
371
|
+
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
372
|
+
- This option checks the update time of the file using the `fs.stat` method. Therefore, it could be affected by Git or other tools that modify the file.
|
|
373
|
+
|
|
374
|
+
> Example: `npx intlayer doc translate --skip-if-modified-before "2025-12-05"`
|
|
375
|
+
|
|
376
|
+
- **`--skip-if-modified-after [skipIfModifiedAfter]`**: Skip the file if it has been modified within the specified time.
|
|
377
|
+
|
|
378
|
+
- Can be an absolute time such as "2025-12-05" (string or Date)
|
|
379
|
+
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
380
|
+
- This option checks the update time of the file using the `fs.stat` method. Therefore, it could be affected by Git or other tools that modify the file.
|
|
381
|
+
|
|
382
|
+
> Example: `npx intlayer doc translate --skip-if-modified-after "2025-12-05"`
|
|
383
|
+
|
|
384
|
+
**Entry output options:**
|
|
385
|
+
|
|
351
386
|
- **`--locales [locales...]`**: Target locales to translate documentation into.
|
|
387
|
+
|
|
352
388
|
> Example: `npx intlayer doc translate --locales fr es de`
|
|
389
|
+
|
|
353
390
|
- **`--base-locale [baseLocale]`**: Source locale to translate from.
|
|
391
|
+
|
|
354
392
|
> Example: `npx intlayer doc translate --base-locale en`
|
|
393
|
+
|
|
394
|
+
**File processing options:**
|
|
395
|
+
|
|
396
|
+
- **`--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]`**: Number of files to process simultaneously for translation.
|
|
397
|
+
|
|
398
|
+
> Example: `npx intlayer doc translate --nb-simultaneous-file-processed 5`
|
|
399
|
+
|
|
400
|
+
**AI options:**
|
|
401
|
+
|
|
355
402
|
- **`--model [model]`**: The AI model to use for translation (e.g., `gpt-3.5-turbo`).
|
|
356
403
|
- **`--provider [provider]`**: The AI provider to use for translation.
|
|
357
404
|
- **`--temperature [temperature]`**: Temperature setting for the AI model.
|
|
358
405
|
- **`--api-key [apiKey]`**: Provide your own API key for the AI service.
|
|
359
|
-
- **`--custom-prompt [prompt]`**: Provide a custom prompt for translation instructions.
|
|
360
406
|
- **`--application-context [applicationContext]`**: Provide additional context for the AI translation.
|
|
407
|
+
- **`--custom-prompt [prompt]`**: Customise the base prompt used for translation. (Note: For most use cases, the `--custom-instructions` option is recommended instead as it provides better control over translation behaviour.)
|
|
408
|
+
|
|
409
|
+
> Example: `npx intlayer doc translate --model deepseek-chat --provider deepseek --temperature 0.5 --api-key sk-1234567890 --application-context "My application is a cat store"`
|
|
410
|
+
|
|
411
|
+
**Environment variables options:**
|
|
412
|
+
|
|
361
413
|
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
362
414
|
- **`--env-file [envFile]`**: Provide a custom environment file to load variables from.
|
|
363
415
|
- **`--base-dir`**: Specify the base directory for the project.
|
|
416
|
+
|
|
417
|
+
> Example: `npx intlayer doc translate --base-dir ./docs --env-file .env.production.local`
|
|
418
|
+
|
|
419
|
+
**Log options:**
|
|
420
|
+
|
|
364
421
|
- **`--verbose`**: Enable verbose logging for debugging.
|
|
422
|
+
|
|
423
|
+
> Example: `npx intlayer doc translate --verbose`
|
|
424
|
+
|
|
425
|
+
**Custom instructions options:**
|
|
426
|
+
|
|
365
427
|
- **`--custom-instructions [customInstructions]`**: Custom instructions added to the prompt. Useful to apply specific rules regarding formatting, URLs translation, etc.
|
|
366
428
|
|
|
367
|
-
|
|
429
|
+
- Can be an absolute time such as "2025-12-05" (string or Date)
|
|
430
|
+
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
431
|
+
- This option checks the update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.
|
|
368
432
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
--
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
433
|
+
> Example: `npx intlayer doc translate --custom-instructions "Avoid translating URLs, and keep the markdown format"`
|
|
434
|
+
|
|
435
|
+
> Example: `npx intlayer doc translate --custom-instructions "$(cat ./instructions.md)"`
|
|
436
|
+
|
|
437
|
+
**Git options:**
|
|
438
|
+
|
|
439
|
+
- **`--git-diff`**: Only run on dictionaries that include changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
440
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
441
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default `HEAD`).
|
|
442
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
443
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
444
|
+
- **`--untracked`**: Include untracked files.
|
|
445
|
+
|
|
446
|
+
> Example: `npx intlayer doc translate --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
447
|
+
|
|
448
|
+
> Example: `npx intlayer doc translate --uncommitted --unpushed --untracked`
|
|
376
449
|
|
|
377
450
|
> Note that the output file path will be determined by replacing the following patterns
|
|
378
451
|
>
|
|
@@ -392,19 +465,20 @@ The `doc review` command analyses documentation files for quality, consistency,
|
|
|
392
465
|
npx intlayer doc review
|
|
393
466
|
```
|
|
394
467
|
|
|
468
|
+
It can be used to review files that are already translated, and to check if the translation is correct.
|
|
469
|
+
|
|
470
|
+
For most use cases,
|
|
471
|
+
|
|
472
|
+
- prefer using the `doc translate` when the translated version of this file is not available.
|
|
473
|
+
- prefer using the `doc review` when the translated version of this file already exists.
|
|
474
|
+
|
|
475
|
+
> Note that the review process consumes more entry tokens than the translate process to review the same file entirely. However, the review process will optimise the chunks to review, and will skip the parts that are not changed.
|
|
476
|
+
|
|
395
477
|
##### Arguments:
|
|
396
478
|
|
|
397
479
|
The `doc review` command accepts the same arguments as `doc translate`, allowing you to review specific documentation files and apply quality checks.
|
|
398
480
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
```bash
|
|
402
|
-
npx intlayer doc review
|
|
403
|
-
--doc-pattern "docs/en-GB/**/*.md"
|
|
404
|
-
--locales fr es de
|
|
405
|
-
--model chatgpt-4o-latest
|
|
406
|
-
--custom-instructions "$(cat ./instructions.md)"
|
|
407
|
-
```
|
|
481
|
+
If you have activated one of the git options, the command will only review the parts of the files that are being changed. The script will process by chunking the file and reviewing each chunk. If there are no changes in the chunk, the script will skip it to speed up the review process and limit the AI Provider API cost.
|
|
408
482
|
|
|
409
483
|
## Use intlayer commands in your `package.json`
|
|
410
484
|
|
|
@@ -420,6 +494,48 @@ npx intlayer doc review
|
|
|
420
494
|
}
|
|
421
495
|
```
|
|
422
496
|
|
|
497
|
+
## CLI SDK
|
|
498
|
+
|
|
499
|
+
The CLI SDK is a library that allows you to use the Intlayer CLI in your own code.
|
|
500
|
+
|
|
501
|
+
```bash packageManager="npm"
|
|
502
|
+
npm install @intlayer/cli --save-dev
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
```bash packageManager="yarn"
|
|
506
|
+
yarn add @intlayer/cli --save-dev
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
```bash packageManager="pnpm"
|
|
510
|
+
pnpm add @intlayer/cli --save-dev
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
Example of usage:
|
|
514
|
+
|
|
515
|
+
```ts
|
|
516
|
+
import {
|
|
517
|
+
push,
|
|
518
|
+
pull,
|
|
519
|
+
fill,
|
|
520
|
+
build,
|
|
521
|
+
docTranslate,
|
|
522
|
+
docReview,
|
|
523
|
+
} from "@intlayer/cli";
|
|
524
|
+
|
|
525
|
+
push();
|
|
526
|
+
// ...
|
|
527
|
+
pull();
|
|
528
|
+
// ...
|
|
529
|
+
fill();
|
|
530
|
+
// ...
|
|
531
|
+
build();
|
|
532
|
+
// ...
|
|
533
|
+
docTranslate();
|
|
534
|
+
// ...
|
|
535
|
+
docReview();
|
|
536
|
+
// ...
|
|
537
|
+
```
|
|
538
|
+
|
|
423
539
|
## Debug intlayer command
|
|
424
540
|
|
|
425
541
|
### 1. **Ensure you're using the latest version**
|
|
@@ -452,4 +568,7 @@ npx clear-npx-cache
|
|
|
452
568
|
|
|
453
569
|
## Doc History
|
|
454
570
|
|
|
455
|
-
|
|
571
|
+
| Version | Date | Changes |
|
|
572
|
+
| ------- | ---------- | ------------------------------------------- |
|
|
573
|
+
| 5.5.11 | 2025-07-11 | Update CLI command parameters documentation |
|
|
574
|
+
| 5.5.10 | 2025-06-29 | Init history |
|
|
@@ -14,6 +14,8 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- nextjs
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-next-15-template
|
|
18
|
+
youtubeVideo: https://www.youtube.com/watch?v=e_PPG7PTqGU
|
|
17
19
|
---
|
|
18
20
|
|
|
19
21
|
# Getting Started internationalising (i18n) with Intlayer and Next.js 15 App Router
|
|
@@ -130,7 +132,7 @@ module.exports = config;
|
|
|
130
132
|
|
|
131
133
|
Configure your Next.js setup to use Intlayer:
|
|
132
134
|
|
|
133
|
-
```typescript
|
|
135
|
+
```typescript fileName="next.config.ts" codeFormat="typescript"
|
|
134
136
|
import type { NextConfig } from "next";
|
|
135
137
|
import { withIntlayer } from "next-intlayer/server";
|
|
136
138
|
|
|
@@ -14,6 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- vite-and-preact
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-vite-preact-template
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
# Getting Started Internationalising (i18n) with Intlayer and Vite and Preact
|
|
@@ -43,17 +44,17 @@ Install the necessary packages using npm:
|
|
|
43
44
|
|
|
44
45
|
```bash packageManager="npm"
|
|
45
46
|
npm install intlayer preact-intlayer
|
|
46
|
-
npm install --save-dev
|
|
47
|
+
npm install vite-intlayer --save-dev
|
|
47
48
|
```
|
|
48
49
|
|
|
49
50
|
```bash packageManager="pnpm"
|
|
50
51
|
pnpm add intlayer preact-intlayer
|
|
51
|
-
pnpm add --save-dev
|
|
52
|
+
pnpm add vite-intlayer --save-dev
|
|
52
53
|
```
|
|
53
54
|
|
|
54
55
|
```bash packageManager="yarn"
|
|
55
56
|
yarn add intlayer preact-intlayer
|
|
56
|
-
yarn add --save-dev
|
|
57
|
+
yarn add vite-intlayer --save-dev
|
|
57
58
|
```
|
|
58
59
|
|
|
59
60
|
- **intlayer**
|