@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
package/docs/en/intlayer_cli.md
CHANGED
|
@@ -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:
|
|
@@ -59,48 +59,6 @@ Intlayer accepts multiple configuration file formats:
|
|
|
59
59
|
|
|
60
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/en/configuration.md).
|
|
61
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
|
-
```
|
|
103
|
-
|
|
104
62
|
## Run intlayer commands
|
|
105
63
|
|
|
106
64
|
### Build dictionaries
|
|
@@ -141,22 +99,57 @@ If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
|
141
99
|
|
|
142
100
|
##### Arguments:
|
|
143
101
|
|
|
144
|
-
|
|
102
|
+
**Dictionary options:**
|
|
103
|
+
|
|
104
|
+
- **`-d`, `--dictionaries`**: ids of the dictionaries to pull. If not specified, all dictionaries will be pushed.
|
|
105
|
+
|
|
145
106
|
> Example: `npx intlayer dictionary push -d my-dictionary-id my-other-dictionary-id`
|
|
146
|
-
|
|
107
|
+
|
|
108
|
+
**Configuration options:**
|
|
109
|
+
|
|
110
|
+
- **`--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.
|
|
111
|
+
|
|
112
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
113
|
+
|
|
114
|
+
**Environment variables options:**
|
|
115
|
+
|
|
116
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`). Useful in the case you use environment variables in your intlayer configuration file.
|
|
117
|
+
- **`--env-file`**: Provide a custom environment file to load variables from. Useful in the case you use environment variables in your intlayer configuration file.
|
|
118
|
+
|
|
119
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
120
|
+
|
|
121
|
+
> Example: `npx intlayer dictionary push --env production`
|
|
122
|
+
|
|
123
|
+
**Output options:**
|
|
124
|
+
|
|
125
|
+
- **`-r`, `--delete-locale-dictionary`**: Skip the question that asking to delete the locales directories once the dictionaries are pushed, and remove them. By default, if the dictionary is defined locally, it will overwrite distant dictionaries content.
|
|
126
|
+
|
|
147
127
|
> Example: `npx intlayer dictionary push -r`
|
|
148
|
-
|
|
128
|
+
|
|
129
|
+
> Example: `npx intlayer dictionary push --delete-locale-dictionary`
|
|
130
|
+
|
|
131
|
+
- **`-k`, `--keep-locale-dictionary`**: Skip the question that asking to delete the locales directories once the dictionaries are pushed, and keep them. By default, is the dictionary is defined locally, it will overwrite distant dictionaries content.
|
|
132
|
+
|
|
149
133
|
> Example: `npx intlayer dictionary push -k`
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
-
|
|
134
|
+
|
|
135
|
+
> Example: `npx intlayer dictionary push --keep-locale-dictionary`
|
|
136
|
+
|
|
137
|
+
**Log options:**
|
|
138
|
+
|
|
139
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
140
|
+
|
|
141
|
+
**Git options:**
|
|
142
|
+
|
|
143
|
+
- **`--git-diff`**: Only run on dictionaries that includes changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
144
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
145
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default: `HEAD`).
|
|
146
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
147
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
148
|
+
- **`--untracked`**: Include untracked files.
|
|
149
|
+
|
|
150
|
+
> Example: `npx intlayer dictionary push --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
151
|
+
|
|
152
|
+
> Example: `npx intlayer dictionary push --uncommitted --unpushed --untracked`
|
|
160
153
|
|
|
161
154
|
### Pull distant dictionaries
|
|
162
155
|
|
|
@@ -174,13 +167,35 @@ If [intlayer editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/
|
|
|
174
167
|
|
|
175
168
|
##### Arguments:
|
|
176
169
|
|
|
177
|
-
|
|
170
|
+
**Dictionary options:**
|
|
171
|
+
|
|
172
|
+
- **`-d, --dictionaries`**: Ids of the dictionaries to pull. If not specified, all dictionaries will be pulled.
|
|
173
|
+
|
|
178
174
|
> Example: `npx intlayer dictionary pull -d my-dictionary-id my-other-dictionary-id`
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
|
|
175
|
+
|
|
176
|
+
**Configuration options:**
|
|
177
|
+
|
|
178
|
+
- **`--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.
|
|
179
|
+
|
|
180
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
181
|
+
|
|
182
|
+
**Environment variables options:**
|
|
183
|
+
|
|
184
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
185
|
+
- **`--env-file`**: Provide a custom environment file to load variables from.
|
|
186
|
+
- **`--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.
|
|
187
|
+
|
|
188
|
+
> Example: `npx intlayer dictionary push --env-file .env.production.local`
|
|
189
|
+
|
|
190
|
+
> Example: `npx intlayer dictionary push --env production`
|
|
191
|
+
|
|
192
|
+
**Output options:**
|
|
193
|
+
|
|
194
|
+
- \*\*`--new-dictionaries-path` : Path to the directory where the new dictionaries will be saved. If not specified, the news dictionaries will be saved in the `./intlayer-dictionaries` directory of the project. If a `filePath` fields is specified in your dictionary content, the dictionaries will not consider this argument and will be saved in the specified `filePath` directory.
|
|
195
|
+
|
|
196
|
+
**Log options:**
|
|
197
|
+
|
|
198
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
184
199
|
|
|
185
200
|
##### Example:
|
|
186
201
|
|
|
@@ -204,77 +219,74 @@ This command analyzes your content declaration files for potential issues such a
|
|
|
204
219
|
|
|
205
220
|
##### Arguments:
|
|
206
221
|
|
|
207
|
-
|
|
208
|
-
|
|
222
|
+
**Files list options:**
|
|
223
|
+
|
|
224
|
+
- **`-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.
|
|
209
225
|
|
|
210
|
-
|
|
211
|
-
Globs pattern to exclude from the audit (e.g. `--exclude "src/test/**"`).
|
|
226
|
+
> Example: `npx intlayer dictionary fill -f src/home/app.content.ts`
|
|
212
227
|
|
|
213
|
-
-
|
|
214
|
-
The source locale to translate from. If not specified, the default locale from your configuration will be used.
|
|
228
|
+
- **`-k, --keys [keys...]`**: Filter dictionaries based on keys. If not provided, all dictionaries will be audited.
|
|
215
229
|
|
|
216
|
-
|
|
217
|
-
Target locales to translate to. If not specified, all locales from your configuration will be used except the source locale.
|
|
230
|
+
> Example: `npx intlayer dictionary fill -k key1 key2`
|
|
218
231
|
|
|
219
|
-
-
|
|
220
|
-
Translation mode: 'complete', 'review', or 'missing-only'. Default is 'missing-only'.
|
|
232
|
+
- **`--excluded-keys [excludedKeys...]`**: Filter out dictionaries based on keys. If not provided, all dictionaries will be audited.
|
|
221
233
|
|
|
222
|
-
-
|
|
223
|
-
Filters dictionaries that includes changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
234
|
+
> Example: `npx intlayer dictionary fill --excluded-keys key1 key2`
|
|
224
235
|
|
|
225
|
-
-
|
|
226
|
-
Specify the base reference for git diff (default `origin/main`).
|
|
236
|
+
- **`--path-filter [pathFilters...]`**: Filter dictionaries based on glob pattern for file paths.
|
|
227
237
|
|
|
228
|
-
-
|
|
229
|
-
Specify the current reference for git diff (default: `HEAD`).
|
|
238
|
+
> Example: `npx intlayer dictionary fill --path-filter "src/home/**"`
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
Filters dictionaries that includes uncommitted changes.
|
|
240
|
+
**Entry output options:**
|
|
233
241
|
|
|
234
|
-
-
|
|
235
|
-
Filters dictionaries that includes unpushed changes.
|
|
242
|
+
- **`--source-locale [sourceLocale]`**: The source locale to translate from. If not specified, the default locale from your configuration will be used.
|
|
236
243
|
|
|
237
|
-
-
|
|
238
|
-
Filters dictionaries that includes untracked files.
|
|
244
|
+
- **`--output-locales [outputLocales...]`**: Target locales to translate to. If not specified, all locales from your configuration will be used except the source locale.
|
|
239
245
|
|
|
240
|
-
-
|
|
241
|
-
Filter dictionaries based on specified keys.
|
|
246
|
+
- **`--mode [mode]`**: Translation mode: 'complete', 'review', or 'missing-only'. Default is 'missing-only'.
|
|
242
247
|
|
|
243
|
-
|
|
244
|
-
Filter out dictionaries based on specified keys.
|
|
248
|
+
**Git options:**
|
|
245
249
|
|
|
246
|
-
-
|
|
247
|
-
|
|
250
|
+
- **`--git-diff`**: Only run on dictionaries that includes changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
251
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
252
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default: `HEAD`).
|
|
253
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
254
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
255
|
+
- **`--untracked`**: Include untracked files.
|
|
256
|
+
|
|
257
|
+
> Example: `npx intlayer doc translate --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
258
|
+
|
|
259
|
+
> Example: `npx intlayer doc translate --uncommitted --unpushed --untracked`
|
|
260
|
+
|
|
261
|
+
**AI options:**
|
|
262
|
+
|
|
263
|
+
- **`--model [model]`**: The AI model to use for the translation (e.g., `gpt-3.5-turbo`).
|
|
264
|
+
- **`--provider [provider]`**: The AI provider to use for the translation.
|
|
265
|
+
- **`--temperature [temperature]`**: Temperature setting for the AI model.
|
|
266
|
+
- **`--api-key [apiKey]`**: Provide your own API key for the AI service.
|
|
267
|
+
- **`--custom-prompt [prompt]`**: Provide a custom prompt for your translation instructions.
|
|
268
|
+
- **`--application-context [applicationContext]`**: Provide additional context for the AI translation.
|
|
248
269
|
|
|
249
|
-
|
|
250
|
-
The AI model to use for the translation (e.g., `gpt-3.5-turbo`).
|
|
270
|
+
> 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"`
|
|
251
271
|
|
|
252
|
-
|
|
253
|
-
The AI provider to use for the translation.
|
|
272
|
+
**Environment variables options:**
|
|
254
273
|
|
|
255
|
-
-
|
|
256
|
-
|
|
274
|
+
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
275
|
+
- **`--env-file [envFile]`**: Provide a custom environment file to load variables from.
|
|
257
276
|
|
|
258
|
-
|
|
259
|
-
Provide your own API key for the AI service.
|
|
277
|
+
> Example: `npx intlayer fill --env-file .env.production.local`
|
|
260
278
|
|
|
261
|
-
|
|
262
|
-
Provide a custom prompt for your translation instructions.
|
|
279
|
+
> Example: `npx intlayer fill --env production`
|
|
263
280
|
|
|
264
|
-
|
|
265
|
-
Provide additional context for the AI translation.
|
|
281
|
+
**Configuration options:**
|
|
266
282
|
|
|
267
|
-
-
|
|
268
|
-
Specify the environment (e.g., `development`, `production`).
|
|
283
|
+
- **`--base-dir`**: Specify the base directory for the project.
|
|
269
284
|
|
|
270
|
-
|
|
271
|
-
Provide a custom environment file to load variables from.
|
|
285
|
+
> Example: `npx intlayer fill --base-dir ./src`
|
|
272
286
|
|
|
273
|
-
|
|
274
|
-
Specify the base directory for the project.
|
|
287
|
+
**Log options:**
|
|
275
288
|
|
|
276
|
-
-
|
|
277
|
-
Enable verbose logging for debugging.
|
|
289
|
+
- **`--verbose`**: Enable verbose logging for debugging.
|
|
278
290
|
|
|
279
291
|
##### Example:
|
|
280
292
|
|
|
@@ -342,45 +354,97 @@ npx intlayer doc translate
|
|
|
342
354
|
|
|
343
355
|
##### Arguments:
|
|
344
356
|
|
|
357
|
+
**File list options:**
|
|
358
|
+
|
|
345
359
|
- **`--doc-pattern [docPattern...]`**: Glob patterns to match documentation files to translate.
|
|
360
|
+
|
|
346
361
|
> Example: `npx intlayer doc translate --doc-pattern "docs/**/*.md" "src/**/*.mdx"`
|
|
362
|
+
|
|
347
363
|
- **`--excluded-glob-pattern [excludedGlobPattern...]`**: Glob patterns to exclude from translation.
|
|
364
|
+
|
|
348
365
|
> Example: `npx intlayer doc translate --excluded-glob-pattern "docs/internal/**"`
|
|
349
|
-
|
|
350
|
-
|
|
366
|
+
|
|
367
|
+
- **`--skip-if-modified-before [skipIfModifiedBefore]`**: Skip the file if it has been modified before the given time.
|
|
368
|
+
|
|
369
|
+
- Can be an absolute time as "2025-12-05" (string or Date)
|
|
370
|
+
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
371
|
+
- This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.
|
|
372
|
+
|
|
373
|
+
> Example: `npx intlayer doc translate --skip-if-modified-before "2025-12-05"`
|
|
374
|
+
|
|
375
|
+
- **`--skip-if-modified-after [skipIfModifiedAfter]`**: Skip the file if it has been modified within the given time.
|
|
376
|
+
|
|
377
|
+
- Can be an absolute time as "2025-12-05" (string or Date)
|
|
378
|
+
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
379
|
+
- This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.
|
|
380
|
+
|
|
381
|
+
> Example: `npx intlayer doc translate --skip-if-modified-after "2025-12-05"`
|
|
382
|
+
|
|
383
|
+
**Entry output options:**
|
|
384
|
+
|
|
351
385
|
- **`--locales [locales...]`**: Target locales to translate documentation to.
|
|
386
|
+
|
|
352
387
|
> Example: `npx intlayer doc translate --locales fr es de`
|
|
388
|
+
|
|
353
389
|
- **`--base-locale [baseLocale]`**: Source locale to translate from.
|
|
390
|
+
|
|
354
391
|
> Example: `npx intlayer doc translate --base-locale en`
|
|
392
|
+
|
|
393
|
+
**File processing options:**
|
|
394
|
+
|
|
395
|
+
- **`--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]`**: Number of files to process simultaneously for translation.
|
|
396
|
+
|
|
397
|
+
> Example: `npx intlayer doc translate --nb-simultaneous-file-processed 5`
|
|
398
|
+
|
|
399
|
+
**AI options:**
|
|
400
|
+
|
|
355
401
|
- **`--model [model]`**: The AI model to use for translation (e.g., `gpt-3.5-turbo`).
|
|
356
402
|
- **`--provider [provider]`**: The AI provider to use for translation.
|
|
357
403
|
- **`--temperature [temperature]`**: Temperature setting for the AI model.
|
|
358
404
|
- **`--api-key [apiKey]`**: Provide your own API key for the AI service.
|
|
359
|
-
- **`--custom-prompt [prompt]`**: Provide a custom prompt for translation instructions.
|
|
360
405
|
- **`--application-context [applicationContext]`**: Provide additional context for the AI translation.
|
|
406
|
+
- **`--custom-prompt [prompt]`**: Customize 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 behavior.)
|
|
407
|
+
|
|
408
|
+
> 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"`
|
|
409
|
+
|
|
410
|
+
**Environment variables options:**
|
|
411
|
+
|
|
361
412
|
- **`--env`**: Specify the environment (e.g., `development`, `production`).
|
|
362
413
|
- **`--env-file [envFile]`**: Provide a custom environment file to load variables from.
|
|
363
414
|
- **`--base-dir`**: Specify the base directory for the project.
|
|
415
|
+
|
|
416
|
+
> Example: `npx intlayer doc translate --base-dir ./docs --env-file .env.production.local`
|
|
417
|
+
|
|
418
|
+
**Log options:**
|
|
419
|
+
|
|
364
420
|
- **`--verbose`**: Enable verbose logging for debugging.
|
|
421
|
+
|
|
422
|
+
> Example: `npx intlayer doc translate --verbose`
|
|
423
|
+
|
|
424
|
+
**Custom instructions options:**
|
|
425
|
+
|
|
365
426
|
- **`--custom-instructions [customInstructions]`**: Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.
|
|
366
|
-
|
|
367
|
-
- Can be an absolute time as "2025-12-05" (string or Date)
|
|
368
|
-
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
369
|
-
- This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.
|
|
370
|
-
- **`--skip-if-modified-after [skipIfModifiedAfter]`**: Skip the file if it has been modified within the given time.
|
|
427
|
+
|
|
371
428
|
- Can be an absolute time as "2025-12-05" (string or Date)
|
|
372
429
|
- Can be a relative time in ms `1 * 60 * 60 * 1000` (1 hour)
|
|
373
430
|
- This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.
|
|
374
431
|
|
|
375
|
-
|
|
432
|
+
> Example: `npx intlayer doc translate --custom-instructions "Avoid translating urls, and keep the markdown format"`
|
|
376
433
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
434
|
+
> Example: `npx intlayer doc translate --custom-instructions "$(cat ./instructions.md)"`
|
|
435
|
+
|
|
436
|
+
**Git options:**
|
|
437
|
+
|
|
438
|
+
- **`--git-diff`**: Only run on dictionaries that includes changes from base (default `origin/main`) to current branch (default: `HEAD`).
|
|
439
|
+
- **`--git-diff-base`**: Specify the base reference for git diff (default `origin/main`).
|
|
440
|
+
- **`--git-diff-current`**: Specify the current reference for git diff (default: `HEAD`).
|
|
441
|
+
- **`--uncommitted`**: Include uncommitted changes.
|
|
442
|
+
- **`--unpushed`**: Include unpushed changes.
|
|
443
|
+
- **`--untracked`**: Include untracked files.
|
|
444
|
+
|
|
445
|
+
> Example: `npx intlayer doc translate --git-diff --git-diff-base origin/main --git-diff-current HEAD`
|
|
446
|
+
|
|
447
|
+
> Example: `npx intlayer doc translate --uncommitted --unpushed --untracked`
|
|
384
448
|
|
|
385
449
|
> Note that the output file path will be determined by replacing the following patterns
|
|
386
450
|
>
|
|
@@ -400,19 +464,20 @@ The `doc review` command analyzes documentation files for quality, consistency,
|
|
|
400
464
|
npx intlayer doc review
|
|
401
465
|
```
|
|
402
466
|
|
|
467
|
+
It can be used to review files that are already translated, and to check if the translation is correct.
|
|
468
|
+
|
|
469
|
+
For most use cases,
|
|
470
|
+
|
|
471
|
+
- prefer using the `doc translate` when the translated version of this file is not available.
|
|
472
|
+
- prefer using the `doc review` when the translated version of this file already exists.
|
|
473
|
+
|
|
474
|
+
> Note that the review process consumes more entry tokens than the translate process to review the same file entirely. However, the review process will optimize the chunks to review, and will skip the parts that are not changed.
|
|
475
|
+
|
|
403
476
|
##### Arguments:
|
|
404
477
|
|
|
405
478
|
The `doc review` command accepts the same arguments as `doc translate`, allowing you to review specific documentation files and apply quality checks.
|
|
406
479
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
npx intlayer doc review
|
|
411
|
-
--doc-pattern "docs/en/**/*.md"
|
|
412
|
-
--locales fr es de
|
|
413
|
-
--model chatgpt-4o-latest
|
|
414
|
-
--custom-instructions "$(cat ./instructions.md)"
|
|
415
|
-
```
|
|
480
|
+
If you activated one of the git options, the command will only review the part of the files that getting changed. The script will process by chunking the file and review each chunk. If there is no changes in the chunk, the script will skip it to speed up the review process and limit the AI Provider API cost.
|
|
416
481
|
|
|
417
482
|
## Use intlayer commands in your `package.json`
|
|
418
483
|
|
|
@@ -428,6 +493,48 @@ npx intlayer doc review
|
|
|
428
493
|
}
|
|
429
494
|
```
|
|
430
495
|
|
|
496
|
+
## CLI SDK
|
|
497
|
+
|
|
498
|
+
The CLI SDK is a library that allows you to use the Intlayer CLI in your own code.
|
|
499
|
+
|
|
500
|
+
```bash packageManager="npm"
|
|
501
|
+
npm install @intlayer/cli --save-dev
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
```bash packageManager="yarn"
|
|
505
|
+
yarn add @intlayer/cli --save-dev
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
```bash packageManager="pnpm"
|
|
509
|
+
pnpm add @intlayer/cli --save-dev
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
Example of usage:
|
|
513
|
+
|
|
514
|
+
```ts
|
|
515
|
+
import {
|
|
516
|
+
push,
|
|
517
|
+
pull,
|
|
518
|
+
fill,
|
|
519
|
+
build,
|
|
520
|
+
docTranslate,
|
|
521
|
+
docReview,
|
|
522
|
+
} from "@intlayer/cli";
|
|
523
|
+
|
|
524
|
+
push();
|
|
525
|
+
// ...
|
|
526
|
+
pull();
|
|
527
|
+
// ...
|
|
528
|
+
fill();
|
|
529
|
+
// ...
|
|
530
|
+
build();
|
|
531
|
+
// ...
|
|
532
|
+
docTranslate();
|
|
533
|
+
// ...
|
|
534
|
+
docReview();
|
|
535
|
+
// ...
|
|
536
|
+
```
|
|
537
|
+
|
|
431
538
|
## Debug intlayer command
|
|
432
539
|
|
|
433
540
|
### 1. **Ensure you're using the latest version**
|
|
@@ -460,6 +567,7 @@ npx clear-npx-cache
|
|
|
460
567
|
|
|
461
568
|
## Doc History
|
|
462
569
|
|
|
463
|
-
| Version | Date | Changes
|
|
464
|
-
| ------- | ---------- |
|
|
465
|
-
| 5.5.
|
|
570
|
+
| Version | Date | Changes |
|
|
571
|
+
| ------- | ---------- | ------------------------------------------- |
|
|
572
|
+
| 5.5.11 | 2025-07-11 | Update CLI command parameters documentation |
|
|
573
|
+
| 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 internationalizing (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 Internationalizing (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**
|
|
@@ -1037,6 +1038,8 @@ module.exports = App;
|
|
|
1037
1038
|
|
|
1038
1039
|
In parallel, you can also use the `intLayerMiddlewarePlugin` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
|
|
1039
1040
|
|
|
1041
|
+
> Note that to use the `intLayerMiddlewarePlugin` in production, you need to switch the `vite-intlayer` package from `devDependencies` to `dependencies`.
|
|
1042
|
+
|
|
1040
1043
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
1041
1044
|
import { defineConfig } from "vite";
|
|
1042
1045
|
import preact from "@preact/preset-vite";
|
|
@@ -15,10 +15,14 @@ slugs:
|
|
|
15
15
|
- doc
|
|
16
16
|
- environment
|
|
17
17
|
- vite-and-react
|
|
18
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-vite-react-template
|
|
19
|
+
youtubeVideo: https://www.youtube.com/watch?v=dS9L7uJeak4
|
|
18
20
|
---
|
|
19
21
|
|
|
20
22
|
# Getting Started Internationalizing (i18n) with Intlayer and Vite and React
|
|
21
23
|
|
|
24
|
+
<iframe title="The best i18n solution for Vite and React? Discover Intlayer" class="m-auto aspect-[16/9] w-full overflow-hidden rounded-lg border-0" allow="autoplay; gyroscope;" loading="lazy" width="1080" height="auto" src="https://www.youtube.com/embed/dS9L7uJeak4?si=VaKmrYMmXjo3xpk2"/>
|
|
25
|
+
|
|
22
26
|
See [Application Template](https://github.com/aymericzip/intlayer-vite-react-template) on GitHub.
|
|
23
27
|
|
|
24
28
|
## What is Intlayer?
|
|
@@ -42,17 +46,17 @@ Install the necessary packages using npm:
|
|
|
42
46
|
|
|
43
47
|
```bash packageManager="npm"
|
|
44
48
|
npm install intlayer react-intlayer
|
|
45
|
-
npm install --save-dev
|
|
49
|
+
npm install vite-intlayer --save-dev
|
|
46
50
|
```
|
|
47
51
|
|
|
48
52
|
```bash packageManager="pnpm"
|
|
49
53
|
pnpm add intlayer react-intlayer
|
|
50
|
-
pnpm add --save-dev
|
|
54
|
+
pnpm add vite-intlayer --save-dev
|
|
51
55
|
```
|
|
52
56
|
|
|
53
57
|
```bash packageManager="yarn"
|
|
54
58
|
yarn add intlayer react-intlayer
|
|
55
|
-
yarn add --save-dev
|
|
59
|
+
yarn add vite-intlayer --save-dev
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
- **intlayer**
|
|
@@ -1002,6 +1006,8 @@ const App = () => (
|
|
|
1002
1006
|
|
|
1003
1007
|
In parallel, you can also use the `intLayerMiddlewarePlugin` to add server-side routing to your application. This plugin will automatically detect the current locale based on the URL and set the appropriate locale cookie. If no locale is specified, the plugin will determine the most appropriate locale based on the user's browser language preferences. If no locale is detected, it will redirect to the default locale.
|
|
1004
1008
|
|
|
1009
|
+
> Note that to use the `intLayerMiddlewarePlugin` in production, you need to switch the `vite-intlayer` package from `devDependencies` to `dependencies`.
|
|
1010
|
+
|
|
1005
1011
|
```typescript {3,7} fileName="vite.config.ts" codeFormat="typescript"
|
|
1006
1012
|
import { defineConfig } from "vite";
|
|
1007
1013
|
import react from "@vitejs/plugin-react-swc";
|