@intlayer/docs 8.0.1 → 8.0.2
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/docs/ar/dictionary/html.md +4 -2
- package/docs/ar/dictionary/insertion.md +113 -59
- package/docs/ar/intlayer_with_adonisjs.md +10 -0
- package/docs/ar/intlayer_with_express.md +10 -0
- package/docs/ar/intlayer_with_fastify.md +10 -0
- package/docs/ar/intlayer_with_hono.md +10 -0
- package/docs/ar/intlayer_with_nestjs.md +11 -1
- package/docs/de/dictionary/html.md +4 -2
- package/docs/de/dictionary/insertion.md +119 -18
- package/docs/de/intlayer_with_adonisjs.md +10 -0
- package/docs/de/intlayer_with_express.md +10 -0
- package/docs/de/intlayer_with_fastify.md +10 -0
- package/docs/de/intlayer_with_hono.md +10 -0
- package/docs/de/intlayer_with_nestjs.md +11 -1
- package/docs/en/dictionary/html.md +3 -1
- package/docs/en/dictionary/insertion.md +119 -65
- package/docs/en/intlayer_with_adonisjs.md +10 -0
- package/docs/en/intlayer_with_express.md +10 -0
- package/docs/en/intlayer_with_fastify.md +10 -0
- package/docs/en/intlayer_with_hono.md +10 -0
- package/docs/en/intlayer_with_nestjs.md +1 -1
- package/docs/en-GB/dictionary/html.md +4 -2
- package/docs/en-GB/dictionary/insertion.md +119 -65
- package/docs/en-GB/intlayer_with_adonisjs.md +10 -0
- package/docs/en-GB/intlayer_with_express.md +10 -0
- package/docs/en-GB/intlayer_with_fastify.md +10 -0
- package/docs/en-GB/intlayer_with_hono.md +10 -0
- package/docs/en-GB/intlayer_with_nestjs.md +11 -1
- package/docs/es/dictionary/html.md +4 -2
- package/docs/es/dictionary/insertion.md +113 -59
- package/docs/es/intlayer_with_adonisjs.md +10 -0
- package/docs/es/intlayer_with_express.md +10 -0
- package/docs/es/intlayer_with_fastify.md +10 -0
- package/docs/es/intlayer_with_hono.md +10 -0
- package/docs/es/intlayer_with_nestjs.md +11 -1
- package/docs/fr/dictionary/html.md +4 -2
- package/docs/fr/dictionary/insertion.md +113 -59
- package/docs/fr/intlayer_with_adonisjs.md +10 -0
- package/docs/fr/intlayer_with_express.md +10 -0
- package/docs/fr/intlayer_with_fastify.md +10 -0
- package/docs/fr/intlayer_with_hono.md +10 -0
- package/docs/fr/intlayer_with_nestjs.md +11 -1
- package/docs/hi/dictionary/html.md +4 -2
- package/docs/hi/dictionary/insertion.md +119 -17
- package/docs/hi/intlayer_with_adonisjs.md +10 -0
- package/docs/hi/intlayer_with_express.md +10 -0
- package/docs/hi/intlayer_with_fastify.md +10 -0
- package/docs/hi/intlayer_with_hono.md +10 -0
- package/docs/hi/intlayer_with_nestjs.md +11 -1
- package/docs/id/dictionary/html.md +4 -2
- package/docs/id/dictionary/insertion.md +119 -17
- package/docs/id/intlayer_with_adonisjs.md +10 -0
- package/docs/id/intlayer_with_express.md +10 -0
- package/docs/id/intlayer_with_fastify.md +10 -0
- package/docs/id/intlayer_with_hono.md +10 -0
- package/docs/it/dictionary/html.md +4 -2
- package/docs/it/dictionary/insertion.md +113 -59
- package/docs/it/intlayer_with_adonisjs.md +10 -0
- package/docs/it/intlayer_with_express.md +10 -0
- package/docs/it/intlayer_with_fastify.md +10 -0
- package/docs/it/intlayer_with_hono.md +10 -0
- package/docs/it/intlayer_with_nestjs.md +11 -1
- package/docs/ja/dictionary/html.md +4 -2
- package/docs/ja/dictionary/insertion.md +119 -65
- package/docs/ja/intlayer_with_adonisjs.md +10 -0
- package/docs/ja/intlayer_with_express.md +10 -0
- package/docs/ja/intlayer_with_fastify.md +10 -0
- package/docs/ja/intlayer_with_hono.md +10 -0
- package/docs/ja/intlayer_with_nestjs.md +11 -1
- package/docs/ko/dictionary/html.md +4 -2
- package/docs/ko/dictionary/insertion.md +119 -65
- package/docs/ko/intlayer_with_adonisjs.md +10 -0
- package/docs/ko/intlayer_with_express.md +10 -0
- package/docs/ko/intlayer_with_fastify.md +10 -0
- package/docs/ko/intlayer_with_hono.md +10 -0
- package/docs/ko/intlayer_with_nestjs.md +11 -1
- package/docs/pl/dictionary/html.md +4 -2
- package/docs/pl/dictionary/insertion.md +113 -15
- package/docs/pl/intlayer_with_adonisjs.md +10 -0
- package/docs/pl/intlayer_with_express.md +10 -0
- package/docs/pl/intlayer_with_fastify.md +10 -0
- package/docs/pl/intlayer_with_hono.md +10 -0
- package/docs/pt/dictionary/html.md +4 -2
- package/docs/pt/dictionary/insertion.md +119 -18
- package/docs/pt/intlayer_with_adonisjs.md +10 -0
- package/docs/pt/intlayer_with_express.md +10 -0
- package/docs/pt/intlayer_with_fastify.md +10 -0
- package/docs/pt/intlayer_with_hono.md +10 -0
- package/docs/pt/intlayer_with_nestjs.md +11 -1
- package/docs/ru/dictionary/html.md +4 -2
- package/docs/ru/dictionary/insertion.md +113 -59
- package/docs/ru/intlayer_with_adonisjs.md +10 -0
- package/docs/ru/intlayer_with_express.md +10 -0
- package/docs/ru/intlayer_with_fastify.md +10 -0
- package/docs/ru/intlayer_with_hono.md +10 -0
- package/docs/ru/intlayer_with_nestjs.md +11 -1
- package/docs/tr/dictionary/html.md +4 -2
- package/docs/tr/dictionary/insertion.md +113 -59
- package/docs/tr/intlayer_with_adonisjs.md +10 -0
- package/docs/tr/intlayer_with_express.md +10 -0
- package/docs/tr/intlayer_with_fastify.md +10 -0
- package/docs/tr/intlayer_with_hono.md +10 -0
- package/docs/tr/intlayer_with_nestjs.md +11 -1
- package/docs/uk/dictionary/html.md +4 -2
- package/docs/uk/dictionary/insertion.md +113 -59
- package/docs/uk/intlayer_with_adonisjs.md +10 -0
- package/docs/uk/intlayer_with_express.md +10 -0
- package/docs/uk/intlayer_with_fastify.md +10 -0
- package/docs/uk/intlayer_with_hono.md +10 -0
- package/docs/vi/dictionary/html.md +4 -2
- package/docs/vi/dictionary/insertion.md +113 -14
- package/docs/vi/intlayer_with_adonisjs.md +10 -0
- package/docs/vi/intlayer_with_express.md +10 -0
- package/docs/vi/intlayer_with_fastify.md +10 -0
- package/docs/vi/intlayer_with_hono.md +10 -0
- package/docs/zh/dictionary/html.md +4 -2
- package/docs/zh/dictionary/insertion.md +117 -63
- package/docs/zh/intlayer_with_adonisjs.md +10 -0
- package/docs/zh/intlayer_with_express.md +10 -0
- package/docs/zh/intlayer_with_fastify.md +10 -0
- package/docs/zh/intlayer_with_hono.md +10 -0
- package/docs/zh/intlayer_with_nestjs.md +11 -1
- package/package.json +6 -6
|
@@ -35,65 +35,119 @@ Cuando se integra con React Intlayer o Next Intlayer, simplemente puedes proporc
|
|
|
35
35
|
|
|
36
36
|
## Configuración del Contenido de Inserción
|
|
37
37
|
|
|
38
|
-
Para configurar contenido de inserción en tu proyecto Intlayer, crea un módulo de contenido que incluya tus definiciones de inserción.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
```
|
|
38
|
+
Para configurar contenido de inserción en tu proyecto Intlayer, crea un módulo de contenido que incluya tus definiciones de inserción.
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<Tab label="Envoltura Manual" value="manual-wrapping">
|
|
42
|
+
Utilice la función `insert` para declarar explícitamente el contenido de inserción.
|
|
43
|
+
|
|
44
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
45
|
+
import { insert, type Dictionary } from "intlayer";
|
|
46
|
+
|
|
47
|
+
const myInsertionContent = {
|
|
48
|
+
key: "my_key",
|
|
49
|
+
content: {
|
|
50
|
+
myInsertion: insert("Hola, mi nombre es {{name}} y tengo {{age}} años."),
|
|
51
|
+
},
|
|
52
|
+
} satisfies Dictionary;
|
|
53
|
+
|
|
54
|
+
export default myInsertionContent;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
58
|
+
import { insert } from "intlayer";
|
|
59
|
+
|
|
60
|
+
/** @type {import('intlayer').Dictionary} */
|
|
61
|
+
const myInsertionContent = {
|
|
62
|
+
key: "my_key",
|
|
63
|
+
content: {
|
|
64
|
+
myInsertion: insert("Hola, mi nombre es {{name}} y tengo {{age}} años."),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default myInsertionContent;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
72
|
+
const { insert } = require("intlayer");
|
|
73
|
+
|
|
74
|
+
/** @type {import('intlayer').Dictionary} */
|
|
75
|
+
const myInsertionContent = {
|
|
76
|
+
key: "my_key",
|
|
77
|
+
content: {
|
|
78
|
+
myInsertion: insert("Hola, mi nombre es {{name}} y tengo {{age}} años."),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
module.exports = myInsertionContent;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
86
|
+
{
|
|
87
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
88
|
+
"key": "my_key",
|
|
89
|
+
"content": {
|
|
90
|
+
"myInsertion": {
|
|
91
|
+
"nodeType": "insertion",
|
|
92
|
+
"insertion": "Hola, mi nombre es {{name}} y tengo {{age}} años.",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</Tab>
|
|
99
|
+
<Tab label="Detección Automática" value="automatic-detection">
|
|
100
|
+
Si la cadena contiene indicadores de inserción comunes (como `{{name}}`), Intlayer la transformará automáticamente.
|
|
101
|
+
|
|
102
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
103
|
+
import { type Dictionary } from "intlayer";
|
|
104
|
+
|
|
105
|
+
const myInsertionContent = {
|
|
106
|
+
key: "my_key",
|
|
107
|
+
content: {
|
|
108
|
+
myInsertion: "Hola, mi nombre es {{name}} y tengo {{age}} años.",
|
|
109
|
+
},
|
|
110
|
+
} satisfies Dictionary;
|
|
111
|
+
|
|
112
|
+
export default myInsertionContent;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
116
|
+
/** @type {import('intlayer').Dictionary} */
|
|
117
|
+
const myInsertionContent = {
|
|
118
|
+
key: "my_key",
|
|
119
|
+
content: {
|
|
120
|
+
myInsertion: "Hola, mi nombre es {{name}} y tengo {{age}} años.",
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default myInsertionContent;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
128
|
+
/** @type {import('intlayer').Dictionary} */
|
|
129
|
+
const myInsertionContent = {
|
|
130
|
+
key: "my_key",
|
|
131
|
+
content: {
|
|
132
|
+
myInsertion: "Hola, mi nombre es {{name}} y tengo {{age}} años.",
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
module.exports = myInsertionContent;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
140
|
+
{
|
|
141
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
142
|
+
"key": "my_key",
|
|
143
|
+
"content": {
|
|
144
|
+
"myInsertion": "Hola, mi nombre es {{name}} y tengo {{age}} años.",
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</Tab>
|
|
150
|
+
</Tabs>
|
|
97
151
|
|
|
98
152
|
## Uso de contenido de inserción con React Intlayer
|
|
99
153
|
|
|
@@ -41,6 +41,16 @@ Al internacionalizar el backend, tu aplicación no solo respeta las diferencias
|
|
|
41
41
|
|
|
42
42
|
## Primeros Pasos
|
|
43
43
|
|
|
44
|
+
<iframe
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonisjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
|
+
loading="lazy"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
Ver la [Plantilla de la Aplicación](https://github.com/aymericzip/intlayer-adonisjs-template) en GitHub.
|
|
53
|
+
|
|
44
54
|
### Instalación
|
|
45
55
|
|
|
46
56
|
Para comenzar a usar `adonis-intlayer`, instala el paquete usando npm:
|
|
@@ -46,6 +46,16 @@ Internacionalizar tu backend es esencial para atender eficazmente a una audienci
|
|
|
46
46
|
|
|
47
47
|
## Comenzando
|
|
48
48
|
|
|
49
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-express-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
Ver la [Plantilla de la Aplicación](https://github.com/aymericzip/intlayer-express-template) en GitHub.
|
|
58
|
+
|
|
49
59
|
### Instalación
|
|
50
60
|
|
|
51
61
|
Para comenzar a usar `express-intlayer`, instala el paquete usando npm:
|
|
@@ -46,6 +46,16 @@ Al internacionalizar el backend, tu aplicación no solo respeta las diferencias
|
|
|
46
46
|
|
|
47
47
|
## Primeros pasos
|
|
48
48
|
|
|
49
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-fastify-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
Ver la [Plantilla de la Aplicación](https://github.com/aymericzip/intlayer-fastify-template) en GitHub.
|
|
58
|
+
|
|
49
59
|
### Instalación
|
|
50
60
|
|
|
51
61
|
Para comenzar a usar `fastify-intlayer`, instala el paquete usando npm:
|
|
@@ -44,6 +44,16 @@ Al internacionalizar el backend, su aplicación no solo respeta las diferencias
|
|
|
44
44
|
|
|
45
45
|
## Primeros Pasos
|
|
46
46
|
|
|
47
|
+
<iframe
|
|
48
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-hono-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
49
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
50
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
51
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
|
+
loading="lazy"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
Ver la [Plantilla de la Aplicación](https://github.com/aymericzip/intlayer-hono-template) en GitHub.
|
|
56
|
+
|
|
47
57
|
### Instalación
|
|
48
58
|
|
|
49
59
|
Para comenzar a usar `hono-intlayer`, instale el paquete usando npm:
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- nest
|
|
17
|
-
applicationTemplate: https://github.com/
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-nestjs-template
|
|
18
18
|
author: AydinTheFirst
|
|
19
19
|
history:
|
|
20
20
|
- version: 7.5.9
|
|
@@ -49,6 +49,16 @@ Al internacionalizar el backend, su aplicación no solo respeta las diferencias
|
|
|
49
49
|
|
|
50
50
|
## Comenzando
|
|
51
51
|
|
|
52
|
+
<iframe
|
|
53
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nestjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
54
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
55
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
56
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
57
|
+
loading="lazy"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
Ver la [Plantilla de la Aplicación](https://github.com/aymericzip/intlayer-nestjs-template) en GitHub.
|
|
61
|
+
|
|
52
62
|
### Crear un nuevo proyecto NestJS
|
|
53
63
|
|
|
54
64
|
```bash packageManager="npm"
|
|
@@ -44,8 +44,9 @@ Vous pouvez déclarer du contenu HTML à l'aide de la fonction `html` ou simplem
|
|
|
44
44
|
|
|
45
45
|
const htmlDictionary = {
|
|
46
46
|
key: "app",
|
|
47
|
+
contentAutoTransformation: true, // peut être défini dans le fichier de configuration
|
|
47
48
|
content: {
|
|
48
|
-
myHtmlContent:
|
|
49
|
+
myHtmlContent: html("<p>Hello <strong>World</strong></p>"),
|
|
49
50
|
},
|
|
50
51
|
} satisfies Dictionary;
|
|
51
52
|
|
|
@@ -59,8 +60,9 @@ Vous pouvez déclarer du contenu HTML à l'aide de la fonction `html` ou simplem
|
|
|
59
60
|
```typescript fileName="htmlDictionary.content.ts"
|
|
60
61
|
export default {
|
|
61
62
|
key: "app",
|
|
63
|
+
contentAutoTransformation: true, // peut être défini dans le fichier de configuration
|
|
62
64
|
content: {
|
|
63
|
-
myHtmlContent:
|
|
65
|
+
myHtmlContent: "<p>Hello <strong>World</strong></p>",
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
```
|
|
@@ -35,65 +35,119 @@ Lorsqu'elle est intégrée avec React Intlayer ou Next Intlayer, il vous suffit
|
|
|
35
35
|
|
|
36
36
|
## Configuration du Contenu d'Insertion
|
|
37
37
|
|
|
38
|
-
Pour configurer le contenu d'insertion dans votre projet Intlayer, créez un module de contenu qui inclut vos définitions d'insertion.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
```
|
|
38
|
+
Pour configurer le contenu d'insertion dans votre projet Intlayer, créez un module de contenu qui inclut vos définitions d'insertion.
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<Tab label="Enveloppement Manuel" value="manual-wrapping">
|
|
42
|
+
Utilisez la fonction `insert` pour déclarer explicitement du contenu d'insertion.
|
|
43
|
+
|
|
44
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
45
|
+
import { insert, type Dictionary } from "intlayer";
|
|
46
|
+
|
|
47
|
+
const myInsertionContent = {
|
|
48
|
+
key: "my_key",
|
|
49
|
+
content: {
|
|
50
|
+
myInsertion: insert("Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !"),
|
|
51
|
+
},
|
|
52
|
+
} satisfies Dictionary;
|
|
53
|
+
|
|
54
|
+
export default myInsertionContent;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
58
|
+
import { insert } from "intlayer";
|
|
59
|
+
|
|
60
|
+
/** @type {import('intlayer').Dictionary} */
|
|
61
|
+
const myInsertionContent = {
|
|
62
|
+
key: "my_key",
|
|
63
|
+
content: {
|
|
64
|
+
myInsertion: insert("Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !"),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default myInsertionContent;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
72
|
+
const { insert } = require("intlayer");
|
|
73
|
+
|
|
74
|
+
/** @type {import('intlayer').Dictionary} */
|
|
75
|
+
const myInsertionContent = {
|
|
76
|
+
key: "my_key",
|
|
77
|
+
content: {
|
|
78
|
+
myInsertion: insert("Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !"),
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
module.exports = myInsertionContent;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
86
|
+
{
|
|
87
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
88
|
+
"key": "my_key",
|
|
89
|
+
"content": {
|
|
90
|
+
"myInsertion": {
|
|
91
|
+
"nodeType": "insertion",
|
|
92
|
+
"insertion": "Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</Tab>
|
|
99
|
+
<Tab label="Détection Automatique" value="automatic-detection">
|
|
100
|
+
Si la chaîne contient des indicateurs d'insertion courants (comme `{{name}}`), Intlayer la transformera automatiquement.
|
|
101
|
+
|
|
102
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
103
|
+
import { type Dictionary } from "intlayer";
|
|
104
|
+
|
|
105
|
+
const myInsertionContent = {
|
|
106
|
+
key: "my_key",
|
|
107
|
+
content: {
|
|
108
|
+
myInsertion: "Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !",
|
|
109
|
+
},
|
|
110
|
+
} satisfies Dictionary;
|
|
111
|
+
|
|
112
|
+
export default myInsertionContent;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
116
|
+
/** @type {import('intlayer').Dictionary} */
|
|
117
|
+
const myInsertionContent = {
|
|
118
|
+
key: "my_key",
|
|
119
|
+
content: {
|
|
120
|
+
myInsertion: "Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !",
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default myInsertionContent;
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
128
|
+
/** @type {import('intlayer').Dictionary} */
|
|
129
|
+
const myInsertionContent = {
|
|
130
|
+
key: "my_key",
|
|
131
|
+
content: {
|
|
132
|
+
myInsertion: "Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !",
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
module.exports = myInsertionContent;
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
140
|
+
{
|
|
141
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
142
|
+
"key": "my_key",
|
|
143
|
+
"content": {
|
|
144
|
+
"myInsertion": "Bonjour, je m'appelle {{name}} et j'ai {{age}} ans !",
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</Tab>
|
|
150
|
+
</Tabs>
|
|
97
151
|
|
|
98
152
|
## Utilisation du contenu d'insertion avec React Intlayer
|
|
99
153
|
|
|
@@ -41,6 +41,16 @@ En internationalisant le backend, votre application non seulement respecte les d
|
|
|
41
41
|
|
|
42
42
|
## Commencer
|
|
43
43
|
|
|
44
|
+
<iframe
|
|
45
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-adonisjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
46
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
47
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
48
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
49
|
+
loading="lazy"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
Voir le [Modèle d’Application](https://github.com/aymericzip/intlayer-adonisjs-template) sur GitHub.
|
|
53
|
+
|
|
44
54
|
### Installation
|
|
45
55
|
|
|
46
56
|
Pour commencer à utiliser `adonis-intlayer`, installez le package via npm :
|
|
@@ -46,6 +46,16 @@ Internationaliser votre backend est essentiel pour servir efficacement un public
|
|
|
46
46
|
|
|
47
47
|
## Démarrage
|
|
48
48
|
|
|
49
|
+
<iframe
|
|
50
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-express-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
51
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
52
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
53
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
54
|
+
loading="lazy"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
Voir le [Modèle d’Application](https://github.com/aymericzip/intlayer-express-template) sur GitHub.
|
|
58
|
+
|
|
49
59
|
### Installation
|
|
50
60
|
|
|
51
61
|
Pour commencer à utiliser `express-intlayer`, installez le package avec npm :
|
|
@@ -40,6 +40,16 @@ En internationalisant le backend, votre application non seulement respecte les d
|
|
|
40
40
|
|
|
41
41
|
## Prise en main
|
|
42
42
|
|
|
43
|
+
<iframe
|
|
44
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-fastify-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
45
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
46
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
47
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
48
|
+
loading="lazy"
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
Voir le [Modèle d’Application](https://github.com/aymericzip/intlayer-fastify-template) sur GitHub.
|
|
52
|
+
|
|
43
53
|
### Installation
|
|
44
54
|
|
|
45
55
|
Pour commencer à utiliser `fastify-intlayer`, installez le package en utilisant npm :
|
|
@@ -44,6 +44,16 @@ En internationalisant le backend, votre application respecte non seulement les d
|
|
|
44
44
|
|
|
45
45
|
## Mise en Route
|
|
46
46
|
|
|
47
|
+
<iframe
|
|
48
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-hono-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
49
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
50
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
51
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
52
|
+
loading="lazy"
|
|
53
|
+
/>
|
|
54
|
+
|
|
55
|
+
Voir le [Modèle d’Application](https://github.com/aymericzip/intlayer-hono-template) sur GitHub.
|
|
56
|
+
|
|
47
57
|
### Installation
|
|
48
58
|
|
|
49
59
|
Pour commencer à utiliser `hono-intlayer`, installez le paquet en utilisant npm :
|
|
@@ -14,7 +14,7 @@ slugs:
|
|
|
14
14
|
- doc
|
|
15
15
|
- environment
|
|
16
16
|
- nest
|
|
17
|
-
applicationTemplate: https://github.com/
|
|
17
|
+
applicationTemplate: https://github.com/aymericzip/intlayer-nestjs-template
|
|
18
18
|
author: AydinTheFirst
|
|
19
19
|
history:
|
|
20
20
|
- version: 7.5.9
|
|
@@ -49,6 +49,16 @@ En internationalisant le backend, votre application respecte non seulement les d
|
|
|
49
49
|
|
|
50
50
|
## Pour commencer
|
|
51
51
|
|
|
52
|
+
<iframe
|
|
53
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-nestjs-template?embed=1&ctl=1&file=intlayer.config.ts"
|
|
54
|
+
className="m-auto overflow-hidden rounded-lg border-0 max-md:size-full max-md:h-[700px] md:aspect-16/9 md:w-full"
|
|
55
|
+
title="Demo CodeSandbox - How to Internationalize your application using Intlayer"
|
|
56
|
+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
|
|
57
|
+
loading="lazy"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
Voir le [Modèle d’Application](https://github.com/aymericzip/intlayer-nestjs-template) sur GitHub.
|
|
61
|
+
|
|
52
62
|
### Créer un nouveau projet NestJS
|
|
53
63
|
|
|
54
64
|
```bash packageManager="npm"
|
|
@@ -44,8 +44,9 @@ Intlayer HTML सामग्री का समर्थन करता ह
|
|
|
44
44
|
|
|
45
45
|
const htmlDictionary = {
|
|
46
46
|
key: "app",
|
|
47
|
+
contentAutoTransformation: true, // कॉन्फ़िग फ़ाइल में सेट किया जा सकता है
|
|
47
48
|
content: {
|
|
48
|
-
myHtmlContent:
|
|
49
|
+
myHtmlContent: html("<p>हैलो <strong>वर्ल्ड</strong></p>"),
|
|
49
50
|
},
|
|
50
51
|
} satisfies Dictionary;
|
|
51
52
|
|
|
@@ -59,8 +60,9 @@ Intlayer HTML सामग्री का समर्थन करता ह
|
|
|
59
60
|
```typescript fileName="htmlDictionary.content.ts"
|
|
60
61
|
export default {
|
|
61
62
|
key: "app",
|
|
63
|
+
contentAutoTransformation: true, // कॉन्फ़िग फ़ाइल में सेट किया जा सकता है
|
|
62
64
|
content: {
|
|
63
|
-
myHtmlContent:
|
|
65
|
+
myHtmlContent: "<p>हैलो <strong>वर्ल्ड</strong></p>",
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
```
|