@intlayer/docs 5.5.9 → 5.5.10
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/ar/autoFill.md +1 -2
- package/ar/intlayer_with_create_react_app.md +1 -14
- package/ar/intlayer_with_nextjs_14.md +1 -14
- package/ar/intlayer_with_nextjs_15.md +1 -14
- package/ar/intlayer_with_nextjs_page_router.md +1 -13
- package/ar/intlayer_with_nuxt.md +792 -0
- package/ar/intlayer_with_react_native+expo.md +6 -3
- package/ar/intlayer_with_vite+preact.md +7 -18
- package/ar/intlayer_with_vite+react.md +7 -17
- package/ar/intlayer_with_vite+vue.md +25 -5
- package/ar/packages/nuxt-intlayer/index.md +29 -0
- package/ar/roadmap.md +11 -11
- package/de/autoFill.md +1 -2
- package/de/how_works_intlayer.md +1 -1
- package/de/intlayer_with_create_react_app.md +1 -14
- package/de/intlayer_with_nextjs_14.md +1 -14
- package/de/intlayer_with_nextjs_15.md +1 -14
- package/de/intlayer_with_nextjs_page_router.md +1 -13
- package/de/intlayer_with_nuxt.md +791 -0
- package/de/intlayer_with_react_native+expo.md +6 -3
- package/de/intlayer_with_vite+preact.md +7 -18
- package/de/intlayer_with_vite+react.md +7 -17
- package/de/intlayer_with_vite+vue.md +84 -62
- package/de/packages/nuxt-intlayer/index.md +29 -0
- package/de/roadmap.md +11 -11
- package/en/autoFill.md +1 -2
- package/en/how_works_intlayer.md +17 -3
- package/en/intlayer_with_angular.md +535 -6
- package/en/intlayer_with_create_react_app.md +1 -14
- package/en/intlayer_with_nextjs_14.md +193 -59
- package/en/intlayer_with_nextjs_15.md +192 -61
- package/en/intlayer_with_nextjs_page_router.md +396 -61
- package/en/intlayer_with_nuxt.md +737 -0
- package/en/intlayer_with_react_native+expo.md +6 -3
- package/en/intlayer_with_vite+preact.md +8 -27
- package/en/intlayer_with_vite+react.md +7 -17
- package/en/intlayer_with_vite+solid.md +6 -3
- package/en/intlayer_with_vite+svelte.md +6 -3
- package/en/intlayer_with_vite+vue.md +17 -6
- package/en/packages/nuxt-intlayer/index.md +31 -0
- package/en/roadmap.md +13 -13
- package/en/t.md +5 -5
- package/en-GB/how_works_intlayer.md +16 -4
- package/en-GB/intlayer_with_create_react_app.md +1 -14
- package/en-GB/intlayer_with_nextjs_14.md +1 -14
- package/en-GB/intlayer_with_nextjs_15.md +1 -14
- package/en-GB/intlayer_with_nextjs_page_router.md +1 -13
- package/en-GB/intlayer_with_nuxt.md +795 -0
- package/en-GB/intlayer_with_react_native+expo.md +6 -3
- package/en-GB/intlayer_with_vite+preact.md +7 -18
- package/en-GB/intlayer_with_vite+react.md +6 -9
- package/en-GB/intlayer_with_vite+vue.md +65 -59
- package/en-GB/packages/nuxt-intlayer/index.md +31 -0
- package/en-GB/roadmap.md +11 -11
- package/es/autoFill.md +1 -2
- package/es/how_works_intlayer.md +1 -1
- package/es/intlayer_with_create_react_app.md +1 -14
- package/es/intlayer_with_nextjs_14.md +1 -14
- package/es/intlayer_with_nextjs_15.md +1 -14
- package/es/intlayer_with_nextjs_page_router.md +1 -13
- package/es/intlayer_with_nuxt.md +731 -0
- package/es/intlayer_with_react_native+expo.md +6 -3
- package/es/intlayer_with_vite+preact.md +7 -18
- package/es/intlayer_with_vite+react.md +7 -17
- package/es/intlayer_with_vite+vue.md +64 -51
- package/es/packages/nuxt-intlayer/index.md +29 -0
- package/fr/autoFill.md +1 -2
- package/fr/how_works_intlayer.md +1 -1
- package/fr/intlayer_with_create_react_app.md +1 -14
- package/fr/intlayer_with_nextjs_14.md +1 -14
- package/fr/intlayer_with_nextjs_15.md +1 -14
- package/fr/intlayer_with_nextjs_page_router.md +1 -13
- package/fr/intlayer_with_nuxt.md +731 -0
- package/fr/intlayer_with_react_native+expo.md +6 -3
- package/fr/intlayer_with_vite+preact.md +7 -18
- package/fr/intlayer_with_vite+react.md +7 -17
- package/fr/intlayer_with_vite+vue.md +30 -15
- package/fr/packages/nuxt-intlayer/index.md +29 -0
- package/fr/roadmap.md +11 -11
- package/hi/autoFill.md +1 -2
- package/hi/how_works_intlayer.md +1 -1
- package/hi/intlayer_with_create_react_app.md +1 -14
- package/hi/intlayer_with_nextjs_14.md +1 -14
- package/hi/intlayer_with_nextjs_15.md +1 -14
- package/hi/intlayer_with_nextjs_page_router.md +1 -13
- package/hi/intlayer_with_nuxt.md +784 -0
- package/hi/intlayer_with_react_native+expo.md +6 -3
- package/hi/intlayer_with_vite+preact.md +7 -18
- package/hi/intlayer_with_vite+react.md +7 -17
- package/hi/intlayer_with_vite+vue.md +59 -47
- package/hi/packages/nuxt-intlayer/index.md +29 -0
- package/hi/roadmap.md +11 -11
- package/index.cjs +30 -0
- package/index.d.ts +2 -0
- package/it/autoFill.md +1 -2
- package/it/how_works_intlayer.md +1 -1
- package/it/intlayer_with_create_react_app.md +0 -6
- package/it/intlayer_with_nextjs_14.md +1 -14
- package/it/intlayer_with_nextjs_15.md +1 -14
- package/it/intlayer_with_nextjs_page_router.md +1 -13
- package/it/intlayer_with_nuxt.md +793 -0
- package/it/intlayer_with_react_native+expo.md +6 -3
- package/it/intlayer_with_vite+preact.md +7 -18
- package/it/intlayer_with_vite+react.md +7 -17
- package/it/intlayer_with_vite+vue.md +26 -17
- package/it/packages/nuxt-intlayer/index.md +29 -0
- package/it/roadmap.md +11 -11
- package/ja/autoFill.md +1 -2
- package/ja/how_works_intlayer.md +1 -1
- package/ja/intlayer_with_create_react_app.md +1 -14
- package/ja/intlayer_with_nextjs_14.md +1 -14
- package/ja/intlayer_with_nextjs_15.md +1 -14
- package/ja/intlayer_with_nextjs_page_router.md +1 -13
- package/ja/intlayer_with_nuxt.md +792 -0
- package/ja/intlayer_with_react_native+expo.md +6 -3
- package/ja/intlayer_with_vite+preact.md +7 -18
- package/ja/intlayer_with_vite+react.md +7 -17
- package/ja/intlayer_with_vite+vue.md +68 -63
- package/ja/packages/nuxt-intlayer/index.md +29 -0
- package/ja/roadmap.md +11 -11
- package/ko/autoFill.md +1 -2
- package/ko/how_works_intlayer.md +1 -1
- package/ko/intlayer_with_create_react_app.md +1 -14
- package/ko/intlayer_with_nextjs_14.md +1 -14
- package/ko/intlayer_with_nextjs_15.md +1 -14
- package/ko/intlayer_with_nextjs_page_router.md +1 -13
- package/ko/intlayer_with_nuxt.md +784 -0
- package/ko/intlayer_with_react_native+expo.md +6 -3
- package/ko/intlayer_with_vite+preact.md +7 -18
- package/ko/intlayer_with_vite+react.md +7 -17
- package/ko/intlayer_with_vite+vue.md +69 -59
- package/ko/packages/nuxt-intlayer/index.md +31 -0
- package/ko/roadmap.md +11 -11
- package/package.json +5 -5
- package/pt/autoFill.md +1 -2
- package/pt/how_works_intlayer.md +1 -1
- package/pt/intlayer_with_create_react_app.md +1 -14
- package/pt/intlayer_with_nextjs_14.md +1 -14
- package/pt/intlayer_with_nextjs_15.md +1 -14
- package/pt/intlayer_with_nextjs_page_router.md +1 -13
- package/pt/intlayer_with_nuxt.md +792 -0
- package/pt/intlayer_with_react_native+expo.md +6 -3
- package/pt/intlayer_with_vite+preact.md +7 -18
- package/pt/intlayer_with_vite+react.md +7 -17
- package/pt/intlayer_with_vite+vue.md +23 -19
- package/pt/packages/nuxt-intlayer/index.md +29 -0
- package/pt/roadmap.md +11 -11
- package/ru/autoFill.md +1 -2
- package/ru/how_works_intlayer.md +1 -1
- package/ru/intlayer_with_create_react_app.md +1 -14
- package/ru/intlayer_with_nextjs_14.md +1 -14
- package/ru/intlayer_with_nextjs_15.md +1 -14
- package/ru/intlayer_with_nextjs_page_router.md +1 -13
- package/ru/intlayer_with_nuxt.md +792 -0
- package/ru/intlayer_with_react_native+expo.md +6 -3
- package/ru/intlayer_with_vite+preact.md +7 -18
- package/ru/intlayer_with_vite+react.md +7 -17
- package/ru/intlayer_with_vite+vue.md +25 -17
- package/ru/packages/nuxt-intlayer/index.md +31 -0
- package/ru/roadmap.md +11 -11
- package/zh/autoFill.md +1 -2
- package/zh/intlayer_with_create_react_app.md +1 -14
- package/zh/intlayer_with_nextjs_14.md +1 -14
- package/zh/intlayer_with_nextjs_15.md +1 -14
- package/zh/intlayer_with_nextjs_page_router.md +1 -13
- package/zh/intlayer_with_nuxt.md +784 -0
- package/zh/intlayer_with_react_native+expo.md +6 -3
- package/zh/intlayer_with_vite+preact.md +7 -18
- package/zh/intlayer_with_vite+react.md +7 -17
- package/zh/intlayer_with_vite+vue.md +68 -57
- package/zh/packages/nuxt-intlayer/index.md +31 -0
- package/zh/roadmap.md +11 -11
|
@@ -20,15 +20,18 @@ With Intlayer, you can:
|
|
|
20
20
|
From your React Native project, install the following packages:
|
|
21
21
|
|
|
22
22
|
```bash packageManager="npm"
|
|
23
|
-
npm install intlayer react-intlayer
|
|
23
|
+
npm install intlayer react-intlayer
|
|
24
|
+
npm install --save-dev react-native-intlayer
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
```bash packageManager="pnpm"
|
|
27
|
-
pnpm add intlayer react-intlayer
|
|
28
|
+
pnpm add intlayer react-intlayer
|
|
29
|
+
pnpm add --save-dev react-native-intlayer
|
|
28
30
|
```
|
|
29
31
|
|
|
30
32
|
```bash packageManager="yarn"
|
|
31
|
-
yarn add intlayer react-intlayer
|
|
33
|
+
yarn add intlayer react-intlayer
|
|
34
|
+
yarn add --save-dev react-native-intlayer
|
|
32
35
|
```
|
|
33
36
|
|
|
34
37
|
### Packages
|
|
@@ -24,15 +24,18 @@ With Intlayer, you can:
|
|
|
24
24
|
Install the necessary packages using npm:
|
|
25
25
|
|
|
26
26
|
```bash packageManager="npm"
|
|
27
|
-
npm install intlayer preact-intlayer
|
|
27
|
+
npm install intlayer preact-intlayer
|
|
28
|
+
npm install --save-dev vite-intlayer
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
```bash packageManager="pnpm"
|
|
31
|
-
pnpm add intlayer preact-intlayer
|
|
32
|
+
pnpm add intlayer preact-intlayer
|
|
33
|
+
pnpm add --save-dev vite-intlayer
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
```bash packageManager="yarn"
|
|
35
|
-
yarn add intlayer preact-intlayer
|
|
37
|
+
yarn add intlayer preact-intlayer
|
|
38
|
+
yarn add --save-dev vite-intlayer
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
- **intlayer**
|
|
@@ -515,13 +518,7 @@ module.exports = App;
|
|
|
515
518
|
> If you want to use your content in a `string` attribute, such as `alt`, `title`, `href`, `aria-label`, etc., you must call the value of the function, like:
|
|
516
519
|
|
|
517
520
|
> ```jsx
|
|
518
|
-
>
|
|
519
|
-
> ```
|
|
520
|
-
|
|
521
521
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
522
|
-
|
|
523
|
-
> ```
|
|
524
|
-
>
|
|
525
522
|
> ```
|
|
526
523
|
|
|
527
524
|
> Note: In Preact, `className` is typically written as `class`.
|
|
@@ -1245,23 +1242,15 @@ module.exports = LocaleSwitcher;
|
|
|
1245
1242
|
```
|
|
1246
1243
|
|
|
1247
1244
|
> Documentation references:
|
|
1248
|
-
|
|
1245
|
+
>
|
|
1249
1246
|
> - [`useLocale` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/packages/react-intlayer/useLocale.md) (API is similar for `preact-intlayer`)
|
|
1250
|
-
|
|
1251
1247
|
> - [`getLocaleName` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/packages/intlayer/getLocaleName.md)
|
|
1252
|
-
|
|
1253
1248
|
> - [`getLocalizedUrl` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/packages/intlayer/getLocalizedUrl.md)
|
|
1254
|
-
|
|
1255
1249
|
> - [`getHTMLTextDir` hook](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/packages/intlayer/getHTMLTextDir.md)
|
|
1256
|
-
|
|
1257
1250
|
> - [`hreflang` attribute](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
|
|
1258
|
-
|
|
1259
1251
|
> - [`lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
|
|
1260
|
-
|
|
1261
1252
|
> - [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
|
|
1262
|
-
|
|
1263
1253
|
> - [`aria-current` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
1264
|
-
|
|
1265
1254
|
> - [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API)
|
|
1266
1255
|
|
|
1267
1256
|
Below is the updated **Step 9** with added explanations and refined code examples:
|
|
@@ -24,15 +24,18 @@ With Intlayer, you can:
|
|
|
24
24
|
Install the necessary packages using npm:
|
|
25
25
|
|
|
26
26
|
```bash packageManager="npm"
|
|
27
|
-
npm install intlayer react-intlayer
|
|
27
|
+
npm install intlayer react-intlayer
|
|
28
|
+
npm install --save-dev vite-intlayer
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
```bash packageManager="pnpm"
|
|
31
|
-
pnpm add intlayer react-intlayer
|
|
32
|
+
pnpm add intlayer react-intlayer
|
|
33
|
+
pnpm add --save-dev vite-intlayer
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
```bash packageManager="yarn"
|
|
35
|
-
yarn add intlayer react-intlayer
|
|
37
|
+
yarn add intlayer react-intlayer
|
|
38
|
+
yarn add --save-dev vite-intlayer
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
- **intlayer**
|
|
@@ -561,13 +564,7 @@ module.exports = App;
|
|
|
561
564
|
> If you want to use your content in a `string` attribute, such as `alt`, `title`, `href`, `aria-label`, etc., you must call the value of the function, like:
|
|
562
565
|
|
|
563
566
|
> ```jsx
|
|
564
|
-
>
|
|
565
|
-
> ```
|
|
566
|
-
|
|
567
567
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
568
|
-
|
|
569
|
-
> ```
|
|
570
|
-
>
|
|
571
568
|
> ```
|
|
572
569
|
|
|
573
570
|
> To Learn more about the `useIntlayer` hook, refer to the [documentation](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/packages/react-intlayer/useIntlayer.md).
|
|
@@ -24,15 +24,18 @@ With Intlayer, you can:
|
|
|
24
24
|
Install the necessary packages using npm:
|
|
25
25
|
|
|
26
26
|
```bash packageManager="npm"
|
|
27
|
-
npm install intlayer vue-intlayer
|
|
27
|
+
npm install intlayer vue-intlayer
|
|
28
|
+
npm install --save-dev vite-intlayer
|
|
28
29
|
```
|
|
29
30
|
|
|
30
31
|
```bash packageManager="pnpm"
|
|
31
|
-
pnpm add intlayer vue-intlayer
|
|
32
|
+
pnpm add intlayer vue-intlayer
|
|
33
|
+
pnpm add --save-dev vite-intlayer
|
|
32
34
|
```
|
|
33
35
|
|
|
34
36
|
```bash packageManager="yarn"
|
|
35
|
-
yarn add intlayer vue-intlayer
|
|
37
|
+
yarn add intlayer vue-intlayer
|
|
38
|
+
yarn add --save-dev vite-intlayer
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
- **intlayer**
|
|
@@ -261,52 +264,61 @@ const helloWorldContent = {
|
|
|
261
264
|
export default helloWorldContent;
|
|
262
265
|
```
|
|
263
266
|
|
|
264
|
-
|
|
265
|
-
|
|
267
|
+
```javascript fileName="src/helloWorld.content.cjs" contentDeclarationFormat="commonjs"
|
|
266
268
|
const { t } = require("intlayer");
|
|
267
269
|
|
|
268
|
-
|
|
270
|
+
/** @type {import('intlayer').Dictionary} */
|
|
269
271
|
const appContent = {
|
|
270
|
-
key: "helloworld",
|
|
271
|
-
content: {
|
|
272
|
-
count: t({
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
272
|
+
key: "helloworld",
|
|
273
|
+
content: {
|
|
274
|
+
count: t({
|
|
275
|
+
"en-GB": "count is ",
|
|
276
|
+
en: "count is ",
|
|
277
|
+
fr: "le compte est ",
|
|
278
|
+
es: "el recuento es ",
|
|
279
|
+
}),
|
|
280
|
+
edit: t({
|
|
281
|
+
"en-GB":
|
|
282
|
+
"Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
283
|
+
en: "Edit <code>components/HelloWorld.vue</code> and save to test HMR",
|
|
284
|
+
fr: "Éditez <code>components/HelloWorld.vue</code> et enregistrez pour tester HMR",
|
|
285
|
+
es: "Edita <code>components/HelloWorld.vue</code> y guarda para probar HMR",
|
|
286
|
+
}),
|
|
287
|
+
checkOut: t({
|
|
288
|
+
"en-GB": "Check out ",
|
|
289
|
+
en: "Check out ",
|
|
290
|
+
fr: "Vérifiez ",
|
|
291
|
+
es: "Compruebe ",
|
|
292
|
+
}),
|
|
293
|
+
officialStarter: t({
|
|
294
|
+
"en-GB": "the official Vue + Vite starter",
|
|
295
|
+
en: "the official Vue + Vite starter",
|
|
296
|
+
fr: "le starter officiel Vue + Vite",
|
|
297
|
+
es: "el starter oficial Vue + Vite",
|
|
298
|
+
}),
|
|
299
|
+
learnMore: t({
|
|
300
|
+
"en-GB": "Learn more about IDE Support for Vue in the ",
|
|
301
|
+
en: "Learn more about IDE Support for Vue in the ",
|
|
302
|
+
fr: "En savoir plus sur le support IDE pour Vue dans le ",
|
|
303
|
+
es: "Aprenda más sobre el soporte IDE para Vue en el ",
|
|
304
|
+
}),
|
|
305
|
+
vueDocs: t({
|
|
306
|
+
"en-GB": "Vue Docs Scaling up Guide",
|
|
307
|
+
en: "Vue Docs Scaling up Guide",
|
|
308
|
+
fr: "Vue Docs Scaling up Guide",
|
|
309
|
+
es: "Vue Docs Scaling up Guide",
|
|
310
|
+
}),
|
|
311
|
+
readTheDocs: t({
|
|
312
|
+
"en-GB": "Click on the Vite and Vue logos to learn more",
|
|
313
|
+
en: "Click on the Vite and Vue logos to learn more",
|
|
314
|
+
fr: "Cliquez sur les logos Vite et Vue pour en savoir plus",
|
|
315
|
+
es: "Haga clic en los logotipos de Vite y Vue para obtener más información",
|
|
316
|
+
}),
|
|
317
|
+
},
|
|
305
318
|
};
|
|
306
319
|
|
|
307
320
|
module.exports = appContent;
|
|
308
|
-
|
|
309
|
-
````
|
|
321
|
+
```
|
|
310
322
|
|
|
311
323
|
```json fileName="src/helloWorld.content.json" contentDeclarationFormat="json"
|
|
312
324
|
{
|
|
@@ -378,7 +390,7 @@ module.exports = appContent;
|
|
|
378
390
|
}
|
|
379
391
|
}
|
|
380
392
|
}
|
|
381
|
-
|
|
393
|
+
```
|
|
382
394
|
|
|
383
395
|
> Your content declarations can be defined anywhere in your application as long as they are included in the `contentDir` directory (by default, `./src`). They must also match the content declaration file extension (by default, `.content.{json,ts,tsx,js,jsx,mjs,mjx,cjs,cjx}`).
|
|
384
396
|
|
|
@@ -446,23 +458,18 @@ const count = ref(0);
|
|
|
446
458
|
</template>
|
|
447
459
|
```
|
|
448
460
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
> ```html
|
|
452
|
-
>
|
|
453
|
-
> ```
|
|
461
|
+
#### Accessing Content in Intlayer Intlayer offers different APIs to access your content
|
|
454
462
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
463
|
+
- **Component-based syntax** (recommended): Use the `<myContent />`, or `<Component :is="myContent" />` syntax to render content as an Intlayer Node. This integrates seamlessly with the [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/intlayer_visual_editor.md) and [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/en-GB/intlayer_CMS.md).
|
|
464
|
+
- **String-based syntax**: Use `{{ myContent }}` to render the content as plain text, without Visual Editor support.
|
|
465
|
+
- **Raw HTML syntax**: Use `<div v-html="myContent" />` to render the content as raw HTML, without Visual Editor support.
|
|
466
|
+
- **Destructuration syntax**: The `useIntlayer` composable returns a Proxy with the content. This proxy can be destructured to access the content while maintaining reactivity.
|
|
467
|
+
- Use `const content = useIntlayer("myContent");` and `{{ content.myContent }}` / `<content.myContent />`.
|
|
468
|
+
- Or use `const { myContent } = useIntlayer("myContent");` and `{{ myContent }}` / `<myContent />` to destructure the content.
|
|
460
469
|
|
|
461
470
|
### (Optional) Step 6: Change the language of your content
|
|
462
471
|
|
|
463
|
-
To change the language of your content, you can use the `setLocale` function provided by the `useLocale` composable. This function allows you to set the locale of the application and update the content accordingly.
|
|
464
|
-
|
|
465
|
-
Create a component to switch between languages:
|
|
472
|
+
To change the language of your content, you can use the `setLocale` function provided by the `useLocale` composable. This function allows you to set the locale of the application and update the content accordingly. Create a component to switch between languages:
|
|
466
473
|
|
|
467
474
|
```vue fileName="src/components/LocaleSwitcher.vue"
|
|
468
475
|
<template>
|
|
@@ -533,7 +540,6 @@ Example:
|
|
|
533
540
|
|
|
534
541
|
```plaintext
|
|
535
542
|
- https://example.com/about
|
|
536
|
-
|
|
537
543
|
- https://example.com/en-GB/about
|
|
538
544
|
- https://example.com/fr/about
|
|
539
545
|
```
|
|
@@ -843,7 +849,7 @@ useI18nHTMLAttributes();
|
|
|
843
849
|
|
|
844
850
|
### (Optional) Step 10: Creating a Localised Link Component
|
|
845
851
|
|
|
846
|
-
To ensure that your application
|
|
852
|
+
To ensure that your application's navigation respects the current locale, you can create a custom `Link` component. This component automatically prefixes internal URLs with the current language, so that, for example, when a French-speaking user clicks on a link to the "About" page, they are redirected to `/fr/about` instead of `/about`.
|
|
847
853
|
|
|
848
854
|
This behaviour is useful for several reasons:
|
|
849
855
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# nuxt-intlayer: NPM Package to internationalise (i18n) a Vue application
|
|
2
|
+
|
|
3
|
+
**Intlayer** is a suite of packages designed specifically for JavaScript developers. It is compatible with frameworks like Vue, Vue, and Express.js.
|
|
4
|
+
|
|
5
|
+
**The `nuxt-intlayer` package** allows you to internationalise your Vue application. It provides context providers and hooks for Vue internationalisation.
|
|
6
|
+
|
|
7
|
+
## Why Internationalise Your Vue Application?
|
|
8
|
+
|
|
9
|
+
Internationalising your Vue application is essential for serving a global audience effectively. It allows your application to deliver content and messages in the preferred language of each user. This capability enhances user experience and broadens your application's reach by making it more accessible and relevant to people from different linguistic backgrounds.
|
|
10
|
+
|
|
11
|
+
## Why to integrate Intlayer?
|
|
12
|
+
|
|
13
|
+
- **JavaScript-Powered Content Management**: Harness the flexibility of JavaScript to define and manage your content efficiently.
|
|
14
|
+
- **Type-Safe Environment**: Leverage TypeScript to ensure all your content definitions are precise and error-free.
|
|
15
|
+
- **Integrated Content Files**: Keep your translations close to their respective components, enhancing maintainability and clarity.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install the necessary package using your preferred package manager:
|
|
20
|
+
|
|
21
|
+
```bash packageManager="npm"
|
|
22
|
+
npm install nuxt-intlayer
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash packageManager="yarn"
|
|
26
|
+
yarn add nuxt-intlayer
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
```bash packageManager="pnpm"
|
|
30
|
+
pnpm add nuxt-intlayer
|
|
31
|
+
```
|
package/en-GB/roadmap.md
CHANGED
|
@@ -14,7 +14,7 @@ Intlayer is a content management and internationalization solution designed to s
|
|
|
14
14
|
- **Distributed**: Alternatively, split your content into separate files at the component or feature level for better maintainability. This keeps your content close to the relevant code (components, tests, Storybook, etc.). Removing a component ensures any associated content is also removed, preventing leftover data from cluttering your codebase.
|
|
15
15
|
|
|
16
16
|
> Resources:
|
|
17
|
-
|
|
17
|
+
>
|
|
18
18
|
> - [Content Declaration](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/dictionary/get_started.md)
|
|
19
19
|
|
|
20
20
|
### 2. Internationalization
|
|
@@ -23,7 +23,7 @@ Intlayer is a content management and internationalization solution designed to s
|
|
|
23
23
|
- Easily manage translations for all these locales from one place.
|
|
24
24
|
|
|
25
25
|
> Resources:
|
|
26
|
-
|
|
26
|
+
>
|
|
27
27
|
> - [Internationalization](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/dictionary/translation.md)
|
|
28
28
|
|
|
29
29
|
### 3. Markdown Support
|
|
@@ -32,7 +32,7 @@ Intlayer is a content management and internationalization solution designed to s
|
|
|
32
32
|
- Ideal for blog posts, articles, documentation pages, or any scenario where rich text formatting is needed.
|
|
33
33
|
|
|
34
34
|
> Resources:
|
|
35
|
-
|
|
35
|
+
>
|
|
36
36
|
> - [Markdown](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/dictionary/markdown.md)
|
|
37
37
|
|
|
38
38
|
### 4. Conditional Rendering
|
|
@@ -41,7 +41,7 @@ Intlayer is a content management and internationalization solution designed to s
|
|
|
41
41
|
- Helps tailor personalized experiences without duplicating content across multiple files.
|
|
42
42
|
|
|
43
43
|
> Resources:
|
|
44
|
-
|
|
44
|
+
>
|
|
45
45
|
> - [Conditional Rendering](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/dictionary/condition.md)
|
|
46
46
|
|
|
47
47
|
### 5. Content Declaration Formats
|
|
@@ -86,7 +86,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
86
86
|
- Fully compatible with the new Next.js Turbopack as well as traditional Webpack.
|
|
87
87
|
|
|
88
88
|
> Resources:
|
|
89
|
-
|
|
89
|
+
>
|
|
90
90
|
> - [Next.js](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_with_nextjs_15.md)
|
|
91
91
|
|
|
92
92
|
### 2. Vite
|
|
@@ -94,7 +94,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
94
94
|
- Similar to Next.js, you can integrate Intlayer with Vite and use a **middleware** to redirect users to content based on their preferred language.
|
|
95
95
|
|
|
96
96
|
> Resources:
|
|
97
|
-
|
|
97
|
+
>
|
|
98
98
|
> - [Vite](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_with_vite+react.md)
|
|
99
99
|
|
|
100
100
|
### 3. Express
|
|
@@ -103,7 +103,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
103
103
|
- Personalize emails, error messages, push notifications, and more with localized text.
|
|
104
104
|
|
|
105
105
|
> Resources:
|
|
106
|
-
|
|
106
|
+
>
|
|
107
107
|
> - [Express](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_with_express.md)
|
|
108
108
|
|
|
109
109
|
---
|
|
@@ -120,7 +120,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
120
120
|
- Can be hosted locally or deployed on a remote server.
|
|
121
121
|
|
|
122
122
|
> Resources:
|
|
123
|
-
|
|
123
|
+
>
|
|
124
124
|
> - [Visual Editor](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_visual_editor.md)
|
|
125
125
|
|
|
126
126
|
### 2. Intlayer CMS (Remote)
|
|
@@ -130,7 +130,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
130
130
|
- Interact with your content via your live application interface.
|
|
131
131
|
|
|
132
132
|
> Resources:
|
|
133
|
-
|
|
133
|
+
>
|
|
134
134
|
> - [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_CMS.md)
|
|
135
135
|
|
|
136
136
|
---
|
|
@@ -142,7 +142,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
142
142
|
- Useful for **CI/CD pipelines**, ensuring your content is always synchronized with your code.
|
|
143
143
|
|
|
144
144
|
> Resources:
|
|
145
|
-
|
|
145
|
+
>
|
|
146
146
|
> - [CLI](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_cli.md)
|
|
147
147
|
|
|
148
148
|
---
|
|
@@ -159,7 +159,7 @@ Intlayer supports **TypeScript** (also JavaScript) and **JSON** for declaring co
|
|
|
159
159
|
- When using remote dictionaries and the Intlayer CMS, you can **update your application’s content on the fly**, without needing to redeploy.
|
|
160
160
|
|
|
161
161
|
> Resources:
|
|
162
|
-
|
|
162
|
+
>
|
|
163
163
|
> - [CMS](https://github.com/aymericzip/intlayer/blob/main/docs/{{locale}}/intlayer_CMS.md)
|
|
164
164
|
|
|
165
165
|
---
|
package/es/autoFill.md
CHANGED
|
@@ -67,9 +67,8 @@ src/components/example/example.filled.content.ts
|
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
> La generación de archivos `.js`, `.ts` y similares funciona de la siguiente manera:
|
|
70
|
-
|
|
70
|
+
>
|
|
71
71
|
> - Si el archivo ya existe, Intlayer lo analizará usando el AST (Árbol de Sintaxis Abstracta) para localizar cada campo e insertar las traducciones faltantes.
|
|
72
|
-
|
|
73
72
|
> - Si el archivo no existe, Intlayer lo generará usando la plantilla predeterminada para archivos de declaración de contenido.
|
|
74
73
|
|
|
75
74
|
## Rutas Absolutas
|
package/es/how_works_intlayer.md
CHANGED
|
@@ -196,7 +196,7 @@ El paquete `@intlayer/editor-react` proporciona estados, contextos, hooks y comp
|
|
|
196
196
|
|
|
197
197
|
El paquete `@intlayer/babel` proporciona herramientas que optimizan el empaquetado de diccionarios para aplicaciones basadas en Vite y Webpack.
|
|
198
198
|
|
|
199
|
-
### @intlayer/swc
|
|
199
|
+
### @intlayer/swc
|
|
200
200
|
|
|
201
201
|
El paquete `@intlayer/swc` proporciona herramientas que optimizan el empaquetado de diccionarios para aplicaciones Next.js.
|
|
202
202
|
|
|
@@ -325,13 +325,7 @@ const App = () => (
|
|
|
325
325
|
> Nota: Si deseas usar tu contenido en un atributo `string`, como `alt`, `title`, `href`, `aria-label`, etc., debes llamar al valor de la función, como:
|
|
326
326
|
|
|
327
327
|
> ```jsx
|
|
328
|
-
>
|
|
329
|
-
> ```
|
|
330
|
-
|
|
331
328
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
332
|
-
|
|
333
|
-
> ```
|
|
334
|
-
>
|
|
335
329
|
> ```
|
|
336
330
|
|
|
337
331
|
> Para aprender más sobre el hook `useIntlayer`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/react-intlayer/useIntlayer.md).
|
|
@@ -973,21 +967,14 @@ const LocaleSwitcher = () => {
|
|
|
973
967
|
```
|
|
974
968
|
|
|
975
969
|
> Referencias de documentación:
|
|
976
|
-
|
|
970
|
+
>
|
|
977
971
|
> - [Hook `useLocale`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/react-intlayer/useLocale.md)
|
|
978
|
-
|
|
979
972
|
> - [Hook `getLocaleName`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocaleName.md)
|
|
980
|
-
|
|
981
973
|
> - [Hook `getLocalizedUrl`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocalizedUrl.md)
|
|
982
|
-
|
|
983
974
|
> - [Hook `getHTMLTextDir`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getHTMLTextDir.md)
|
|
984
|
-
|
|
985
975
|
> - [Atributo `hrefLang`](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
|
|
986
|
-
|
|
987
976
|
> - [Atributo `lang`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
|
|
988
|
-
|
|
989
977
|
> - [Atributo `dir`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
|
|
990
|
-
|
|
991
978
|
> - [Atributo `aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
992
979
|
|
|
993
980
|
### (Opcional) Paso 9: Cambiar los atributos de idioma y dirección del HTML
|
|
@@ -568,13 +568,7 @@ const ServerComponentExample = () => {
|
|
|
568
568
|
> Si deseas usar tu contenido en un atributo `string`, como `alt`, `title`, `href`, `aria-label`, etc., debes llamar al valor de la función, como:
|
|
569
569
|
|
|
570
570
|
> ```jsx
|
|
571
|
-
>
|
|
572
|
-
> ```
|
|
573
|
-
|
|
574
571
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
575
|
-
|
|
576
|
-
> ```
|
|
577
|
-
>
|
|
578
572
|
> ```
|
|
579
573
|
|
|
580
574
|
> Para aprender más sobre el hook `useIntlayer`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useIntlayer.md).
|
|
@@ -1042,21 +1036,14 @@ const LocaleSwitcher = () => {
|
|
|
1042
1036
|
```
|
|
1043
1037
|
|
|
1044
1038
|
> Referencias de documentación:
|
|
1045
|
-
|
|
1039
|
+
>
|
|
1046
1040
|
> - [Hook `useLocale`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useLocale.md)
|
|
1047
|
-
|
|
1048
1041
|
> - [Hook `getLocaleName`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocaleName.md)
|
|
1049
|
-
|
|
1050
1042
|
> - [Hook `getLocalizedUrl`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocalizedUrl.md)
|
|
1051
|
-
|
|
1052
1043
|
> - [Hook `getHTMLTextDir`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getHTMLTextDir.md)
|
|
1053
|
-
|
|
1054
1044
|
> - [Atributo `hrefLang`](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=es)
|
|
1055
|
-
|
|
1056
1045
|
> - [Atributo `lang`](https://developer.mozilla.org/es/docs/Web/HTML/Global_attributes/lang)
|
|
1057
|
-
|
|
1058
1046
|
> - [Atributo `dir`](https://developer.mozilla.org/es/docs/Web/HTML/Global_attributes/dir)
|
|
1059
|
-
|
|
1060
1047
|
> - [Atributo `aria-current`](https://developer.mozilla.org/es/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
1061
1048
|
|
|
1062
1049
|
### (Opcional) Paso 11: Crear un componente de enlace localizado
|
|
@@ -582,13 +582,7 @@ const ServerComponentExample = () => {
|
|
|
582
582
|
> Si deseas usar tu contenido en un atributo `string`, como `alt`, `title`, `href`, `aria-label`, etc., debes llamar al valor de la función, como:
|
|
583
583
|
|
|
584
584
|
> ```jsx
|
|
585
|
-
>
|
|
586
|
-
> ```
|
|
587
|
-
|
|
588
585
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
589
|
-
|
|
590
|
-
> ```
|
|
591
|
-
>
|
|
592
586
|
> ```
|
|
593
587
|
|
|
594
588
|
> Para aprender más sobre el hook `useIntlayer`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useIntlayer.md).
|
|
@@ -1097,21 +1091,14 @@ export const LocaleSwitcher = () => {
|
|
|
1097
1091
|
```
|
|
1098
1092
|
|
|
1099
1093
|
> Referencias de documentación:
|
|
1100
|
-
|
|
1094
|
+
>
|
|
1101
1095
|
> - [Hook `useLocale`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useLocale.md)
|
|
1102
|
-
|
|
1103
1096
|
> - [Hook `getLocaleName`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocaleName.md)
|
|
1104
|
-
|
|
1105
1097
|
> - [Hook `getLocalizedUrl`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocalizedUrl.md)
|
|
1106
|
-
|
|
1107
1098
|
> - [Hook `getHTMLTextDir`](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getHTMLTextDir.md)
|
|
1108
|
-
|
|
1109
1099
|
> - [Atributo `hrefLang`](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
|
|
1110
|
-
|
|
1111
1100
|
> - [Atributo `lang`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
|
|
1112
|
-
|
|
1113
1101
|
> - [Atributo `dir`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
|
|
1114
|
-
|
|
1115
1102
|
> - [Atributo `aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
1116
1103
|
|
|
1117
1104
|
### (Opcional) Paso 11: Crear un componente de enlace localizado
|
|
@@ -530,13 +530,7 @@ const ComponentExample = () => {
|
|
|
530
530
|
> Al usar traducciones en atributos de tipo `string` (por ejemplo, `alt`, `title`, `href`, `aria-label`), llama al valor de la función de la siguiente manera:
|
|
531
531
|
|
|
532
532
|
> ```jsx
|
|
533
|
-
>
|
|
534
|
-
> ```
|
|
535
|
-
|
|
536
533
|
> <img src={content.image.src.value} alt={content.image.value} />
|
|
537
|
-
|
|
538
|
-
> ```
|
|
539
|
-
>
|
|
540
534
|
> ```
|
|
541
535
|
|
|
542
536
|
> Para aprender más sobre el hook `useIntlayer`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useIntlayer.md).
|
|
@@ -866,19 +860,13 @@ const LocaleSwitcher = () => {
|
|
|
866
860
|
> La API `useLocalePageRouter` es la misma que `useLocale`. Para aprender más sobre el hook `useLocale`, consulta la [documentación](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/next-intlayer/useLocale.md).
|
|
867
861
|
|
|
868
862
|
> Referencias de la documentación:
|
|
869
|
-
|
|
863
|
+
>
|
|
870
864
|
> - [`getLocaleName` hook](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocaleName.md)
|
|
871
|
-
|
|
872
865
|
> - [`getLocalizedUrl` hook](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getLocalizedUrl.md)
|
|
873
|
-
|
|
874
866
|
> - [`getHTMLTextDir` hook](https://github.com/aymericzip/intlayer/blob/main/docs/es/packages/intlayer/getHTMLTextDir.md)
|
|
875
|
-
|
|
876
867
|
> - [`hrefLang` attribute](https://developers.google.com/search/docs/specialty/international/localized-versions?hl=fr)
|
|
877
|
-
|
|
878
868
|
> - [`lang` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang)
|
|
879
|
-
|
|
880
869
|
> - [`dir` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir)
|
|
881
|
-
|
|
882
870
|
> - [`aria-current` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current)
|
|
883
871
|
|
|
884
872
|
### (Opcional) Paso 10: Crear un Componente de Enlace Localizado
|