intlayer 4.0.2 → 4.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -75
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</a>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
# intlayer:
|
|
20
|
+
# intlayer: Manage Multilingual Content Declaration (i18n)
|
|
21
21
|
|
|
22
22
|
**Intlayer** is a suite of packages designed specifically for JavaScript developers. It is compatible with frameworks like React, Next.js, and Express.js.
|
|
23
23
|
|
|
@@ -70,7 +70,7 @@ With Intlayer, you can declare your content in a structured way anywhere in your
|
|
|
70
70
|
|
|
71
71
|
By default, Intlayer scans for files with the extension `.content.{ts,tsx,js,jsx,mjs,cjs}`.
|
|
72
72
|
|
|
73
|
-
>
|
|
73
|
+
> can modify the default extension by setting the `contentDir` property in the [configuration file](https://github.com/aymericzip/intlayer/blob/main/docs/en/configuration.md).
|
|
74
74
|
|
|
75
75
|
```bash codeFormat="typescript"
|
|
76
76
|
.
|
|
@@ -168,42 +168,6 @@ const config: IntlayerConfig = {
|
|
|
168
168
|
};
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
```typescript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
172
|
-
import { Locales } from "intlayer";
|
|
173
|
-
|
|
174
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
175
|
-
const config = {
|
|
176
|
-
/* ... */
|
|
177
|
-
content: {
|
|
178
|
-
// Tells Intlayer to generate message files for i18next
|
|
179
|
-
dictionaryOutput: ["i18next"],
|
|
180
|
-
|
|
181
|
-
// The directory where Intlayer will write your message JSON files
|
|
182
|
-
i18nextResourcesDir: "./i18next/resources",
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export default config;
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
190
|
-
const { Locales } = require("intlayer");
|
|
191
|
-
|
|
192
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
193
|
-
const config = {
|
|
194
|
-
/* ... */
|
|
195
|
-
content: {
|
|
196
|
-
// Tells Intlayer to generate message files for i18next
|
|
197
|
-
dictionaryOutput: ["i18next"],
|
|
198
|
-
|
|
199
|
-
// The directory where Intlayer will write your message JSON files
|
|
200
|
-
i18nextResourcesDir: "./i18next/resources",
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
module.exports = config;
|
|
205
|
-
```
|
|
206
|
-
|
|
207
171
|
> For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en/configuration.md).
|
|
208
172
|
|
|
209
173
|
Output:
|
|
@@ -235,7 +199,7 @@ For example, the **en/client-component.json** might look like:
|
|
|
235
199
|
}
|
|
236
200
|
```
|
|
237
201
|
|
|
238
|
-
### Build
|
|
202
|
+
### Build next-intl dictionaries
|
|
239
203
|
|
|
240
204
|
Intlayer can be configured to build dictionaries for [i18next](https://www.i18next.com/) or [next-intl](https://github.com/formatjs/react-intl/tree/main/packages/next-intl). For that you need to add the following configuration to your `intlayer.config.ts` file:
|
|
241
205
|
|
|
@@ -254,42 +218,6 @@ const config: IntlayerConfig = {
|
|
|
254
218
|
};
|
|
255
219
|
```
|
|
256
220
|
|
|
257
|
-
```typescript fileName="intlayer.config.mjs" codeFormat="esm"
|
|
258
|
-
import { Locales } from "intlayer";
|
|
259
|
-
|
|
260
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
261
|
-
const config = {
|
|
262
|
-
/* ... */
|
|
263
|
-
content: {
|
|
264
|
-
// Tells Intlayer to generate message files for i18next
|
|
265
|
-
dictionaryOutput: ["next-intl"],
|
|
266
|
-
|
|
267
|
-
// The directory where Intlayer will write your message JSON files
|
|
268
|
-
nextIntlMessagesDir: "./i18next/messages",
|
|
269
|
-
},
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
export default config;
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
```javascript fileName="intlayer.config.cjs" codeFormat="commonjs"
|
|
276
|
-
const { Locales } = require("intlayer");
|
|
277
|
-
|
|
278
|
-
/** @type {import('intlayer').IntlayerConfig} */
|
|
279
|
-
const config = {
|
|
280
|
-
/* ... */
|
|
281
|
-
content: {
|
|
282
|
-
// Tells Intlayer to generate message files for i18next
|
|
283
|
-
dictionaryOutput: ["next-intl"],
|
|
284
|
-
|
|
285
|
-
// The directory where Intlayer will write your message JSON files
|
|
286
|
-
nextIntlMessagesDir: "./intl/messages",
|
|
287
|
-
},
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
module.exports = config;
|
|
291
|
-
```
|
|
292
|
-
|
|
293
221
|
> For a complete list of available parameters, refer to the [configuration documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en/configuration.md).
|
|
294
222
|
|
|
295
223
|
Output:
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "intlayer",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "Manage internationalization in a simple way, through TypeScript, declaration file, declare your multilingual every where in your code.",
|
|
5
|
+
"description": "Manage internationalization i18n in a simple way, through TypeScript, declaration file, declare your multilingual content every where in your code.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"intlayer",
|
|
8
8
|
"application",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"./package.json"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@intlayer/
|
|
62
|
-
"@intlayer/
|
|
63
|
-
"@intlayer/
|
|
61
|
+
"@intlayer/core": "^4.0.4",
|
|
62
|
+
"@intlayer/cli": "4.0.4",
|
|
63
|
+
"@intlayer/config": "4.0.4"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@changesets/changelog-github": "0.5.0",
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
"tsup": "^8.3.5",
|
|
76
76
|
"typescript": "^5.7.3",
|
|
77
77
|
"@utils/ts-config": "1.0.4",
|
|
78
|
-
"@utils/ts-config-types": "1.0.4",
|
|
79
78
|
"@utils/eslint-config": "1.0.4",
|
|
79
|
+
"@utils/ts-config-types": "1.0.4",
|
|
80
80
|
"@utils/tsup-config": "1.0.4"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@intlayer/
|
|
84
|
-
"@intlayer/
|
|
85
|
-
"@intlayer/core": "^4.0.
|
|
83
|
+
"@intlayer/config": "4.0.4",
|
|
84
|
+
"@intlayer/cli": "4.0.4",
|
|
85
|
+
"@intlayer/core": "^4.0.4"
|
|
86
86
|
},
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": ">=14.18"
|