@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,71 +35,125 @@ When integrated with React Intlayer or Next Intlayer, you can simply provide the
|
|
|
35
35
|
|
|
36
36
|
## Setting Up Insertion Content
|
|
37
37
|
|
|
38
|
-
To set up insertion content in your Intlayer project, create a content module that includes your insertion definitions.
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
```
|
|
38
|
+
To set up insertion content in your Intlayer project, create a content module that includes your insertion definitions.
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<Tab label="Manual Wrapping" value="manual-wrapping">
|
|
42
|
+
Use the `insert` function to explicitly declare insertion content.
|
|
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(
|
|
51
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
} satisfies Dictionary;
|
|
55
|
+
|
|
56
|
+
export default myInsertionContent;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
60
|
+
import { insert } from "intlayer";
|
|
61
|
+
|
|
62
|
+
/** @type {import('intlayer').Dictionary} */
|
|
63
|
+
const myInsertionContent = {
|
|
64
|
+
key: "my_key",
|
|
65
|
+
content: {
|
|
66
|
+
myInsertion: insert(
|
|
67
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
68
|
+
),
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default myInsertionContent;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
76
|
+
const { insert } = require("intlayer");
|
|
77
|
+
|
|
78
|
+
/** @type {import('intlayer').Dictionary} */
|
|
79
|
+
const myInsertionContent = {
|
|
80
|
+
key: "my_key",
|
|
81
|
+
content: {
|
|
82
|
+
myInsertion: insert(
|
|
83
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
84
|
+
),
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
module.exports = myInsertionContent;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
92
|
+
{
|
|
93
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
94
|
+
"key": "my_key",
|
|
95
|
+
"content": {
|
|
96
|
+
"myInsertion": {
|
|
97
|
+
"nodeType": "insertion",
|
|
98
|
+
"insertion": "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
</Tab>
|
|
105
|
+
<Tab label="Automatic Detection" value="automatic-detection">
|
|
106
|
+
If the string contains common insertion indicators (like `{{name}}`), Intlayer will automatically transform it.
|
|
107
|
+
|
|
108
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
109
|
+
import { type Dictionary } from "intlayer";
|
|
110
|
+
|
|
111
|
+
const myInsertionContent = {
|
|
112
|
+
key: "my_key",
|
|
113
|
+
content: {
|
|
114
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
115
|
+
},
|
|
116
|
+
} satisfies Dictionary;
|
|
117
|
+
|
|
118
|
+
export default myInsertionContent;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
122
|
+
/** @type {import('intlayer').Dictionary} */
|
|
123
|
+
const myInsertionContent = {
|
|
124
|
+
key: "my_key",
|
|
125
|
+
content: {
|
|
126
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export default myInsertionContent;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
134
|
+
/** @type {import('intlayer').Dictionary} */
|
|
135
|
+
const myInsertionContent = {
|
|
136
|
+
key: "my_key",
|
|
137
|
+
content: {
|
|
138
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
module.exports = myInsertionContent;
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
146
|
+
{
|
|
147
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
148
|
+
"key": "my_key",
|
|
149
|
+
"content": {
|
|
150
|
+
"myInsertion": "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
</Tab>
|
|
156
|
+
</Tabs>
|
|
103
157
|
|
|
104
158
|
## Using Insertion Content with React Intlayer
|
|
105
159
|
|
|
@@ -41,6 +41,16 @@ By internationalizing the backend, your application not only respects cultural d
|
|
|
41
41
|
|
|
42
42
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonisjs-template) on GitHub.
|
|
53
|
+
|
|
44
54
|
### Installation
|
|
45
55
|
|
|
46
56
|
To begin using `adonis-intlayer`, install the package using npm:
|
|
@@ -44,6 +44,16 @@ By internationalizing the backend, your application not only respects cultural d
|
|
|
44
44
|
|
|
45
45
|
## Getting Started
|
|
46
46
|
|
|
47
|
+
<iframe
|
|
48
|
+
src="https://stackblitz.com/github/aymericzip/intlayer-express-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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-express-template) on GitHub.
|
|
56
|
+
|
|
47
57
|
### Installation
|
|
48
58
|
|
|
49
59
|
To begin using `express-intlayer`, install the package using npm:
|
|
@@ -40,6 +40,16 @@ By internationalizing the backend, your application not only respects cultural d
|
|
|
40
40
|
|
|
41
41
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-fastify-template) on GitHub.
|
|
52
|
+
|
|
43
53
|
### Installation
|
|
44
54
|
|
|
45
55
|
To begin using `fastify-intlayer`, install the package using npm:
|
|
@@ -44,6 +44,16 @@ By internationalizing the backend, your application not only respects cultural d
|
|
|
44
44
|
|
|
45
45
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-hono-template) on GitHub.
|
|
56
|
+
|
|
47
57
|
### Installation
|
|
48
58
|
|
|
49
59
|
To begin using `hono-intlayer`, install the package using npm:
|
|
@@ -44,8 +44,9 @@ You can declare HTML content using the `html` function or simply as a string.
|
|
|
44
44
|
|
|
45
45
|
const htmlDictionary = {
|
|
46
46
|
key: "app",
|
|
47
|
+
contentAutoTransformation: true, // can be set in config file
|
|
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 @@ You can declare HTML content using the `html` function or simply as a string.
|
|
|
59
60
|
```typescript fileName="htmlDictionary.content.ts"
|
|
60
61
|
export default {
|
|
61
62
|
key: "app",
|
|
63
|
+
contentAutoTransformation: true, // can be set in config file
|
|
62
64
|
content: {
|
|
63
|
-
myHtmlContent:
|
|
65
|
+
myHtmlContent: "<p>Hello <strong>World</strong></p>",
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
```
|
|
@@ -39,71 +39,125 @@ When integrated with React Intlayer or Next Intlayer, you can simply provide the
|
|
|
39
39
|
|
|
40
40
|
## Setting Up Insertion Content
|
|
41
41
|
|
|
42
|
-
To set up insertion content in your Intlayer project, create a content module that includes your insertion definitions.
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
```
|
|
42
|
+
To set up insertion content in your Intlayer project, create a content module that includes your insertion definitions.
|
|
43
|
+
|
|
44
|
+
<Tabs>
|
|
45
|
+
<Tab label="Manual Wrapping" value="manual-wrapping">
|
|
46
|
+
Use the `insert` function to explicitly declare insertion content.
|
|
47
|
+
|
|
48
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
49
|
+
import { insert, type Dictionary } from "intlayer";
|
|
50
|
+
|
|
51
|
+
const myInsertionContent = {
|
|
52
|
+
key: "my_key",
|
|
53
|
+
content: {
|
|
54
|
+
myInsertion: insert(
|
|
55
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
56
|
+
),
|
|
57
|
+
},
|
|
58
|
+
} satisfies Dictionary;
|
|
59
|
+
|
|
60
|
+
export default myInsertionContent;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
64
|
+
import { insert } from "intlayer";
|
|
65
|
+
|
|
66
|
+
/** @type {import('intlayer').Dictionary} */
|
|
67
|
+
const myInsertionContent = {
|
|
68
|
+
key: "my_key",
|
|
69
|
+
content: {
|
|
70
|
+
myInsertion: insert(
|
|
71
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
72
|
+
),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default myInsertionContent;
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
80
|
+
const { insert } = require("intlayer");
|
|
81
|
+
|
|
82
|
+
/** @type {import('intlayer').Dictionary} */
|
|
83
|
+
const myInsertionContent = {
|
|
84
|
+
key: "my_key",
|
|
85
|
+
content: {
|
|
86
|
+
myInsertion: insert(
|
|
87
|
+
"Hello, my name is {{name}} and I am {{age}} years old!"
|
|
88
|
+
),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
module.exports = myInsertionContent;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
96
|
+
{
|
|
97
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
98
|
+
"key": "my_key",
|
|
99
|
+
"content": {
|
|
100
|
+
"myInsertion": {
|
|
101
|
+
"nodeType": "insertion",
|
|
102
|
+
"insertion": "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
</Tab>
|
|
109
|
+
<Tab label="Automatic Detection" value="automatic-detection">
|
|
110
|
+
If the string contains common insertion indicators (like `{{name}}`), Intlayer will automatically transform it.
|
|
111
|
+
|
|
112
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
113
|
+
import { type Dictionary } from "intlayer";
|
|
114
|
+
|
|
115
|
+
const myInsertionContent = {
|
|
116
|
+
key: "my_key",
|
|
117
|
+
content: {
|
|
118
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
119
|
+
},
|
|
120
|
+
} satisfies Dictionary;
|
|
121
|
+
|
|
122
|
+
export default myInsertionContent;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
126
|
+
/** @type {import('intlayer').Dictionary} */
|
|
127
|
+
const myInsertionContent = {
|
|
128
|
+
key: "my_key",
|
|
129
|
+
content: {
|
|
130
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default myInsertionContent;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
138
|
+
/** @type {import('intlayer').Dictionary} */
|
|
139
|
+
const myInsertionContent = {
|
|
140
|
+
key: "my_key",
|
|
141
|
+
content: {
|
|
142
|
+
myInsertion: "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
module.exports = myInsertionContent;
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
150
|
+
{
|
|
151
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
152
|
+
"key": "my_key",
|
|
153
|
+
"content": {
|
|
154
|
+
"myInsertion": "Hello, my name is {{name}} and I am {{age}} years old!",
|
|
155
|
+
},
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
</Tab>
|
|
160
|
+
</Tabs>
|
|
107
161
|
|
|
108
162
|
## Using Insertion Content with React Intlayer
|
|
109
163
|
|
|
@@ -41,6 +41,16 @@ By internationalising the backend, your application not only respects cultural d
|
|
|
41
41
|
|
|
42
42
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-adonisjs-template) on GitHub.
|
|
53
|
+
|
|
44
54
|
### Installation
|
|
45
55
|
|
|
46
56
|
To begin using `adonis-intlayer`, install the package using npm:
|
|
@@ -46,6 +46,16 @@ Internationalising your backend is essential for serving a global audience effec
|
|
|
46
46
|
|
|
47
47
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-express-template) on GitHub.
|
|
58
|
+
|
|
49
59
|
### Installation
|
|
50
60
|
|
|
51
61
|
To begin using `express-intlayer`, install the package using npm:
|
|
@@ -40,6 +40,16 @@ By internationalising the backend, your application not only respects cultural d
|
|
|
40
40
|
|
|
41
41
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-fastify-template) on GitHub.
|
|
52
|
+
|
|
43
53
|
### Installation
|
|
44
54
|
|
|
45
55
|
To begin using `fastify-intlayer`, install the package using npm:
|
|
@@ -44,6 +44,16 @@ By internationalizing the backend, your application not only respects cultural d
|
|
|
44
44
|
|
|
45
45
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-hono-template) on GitHub.
|
|
56
|
+
|
|
47
57
|
### Installation
|
|
48
58
|
|
|
49
59
|
To begin using `hono-intlayer`, install the package using 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 @@ By internationalising the backend, your application not only respects cultural d
|
|
|
49
49
|
|
|
50
50
|
## Getting Started
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-nestjs-template) on GitHub.
|
|
61
|
+
|
|
52
62
|
### Create a new NestJS Project
|
|
53
63
|
|
|
54
64
|
```bash packageManager="npm"
|
|
@@ -44,8 +44,9 @@ Puedes declarar contenido HTML mediante la función `html` o simplemente como un
|
|
|
44
44
|
|
|
45
45
|
const htmlDictionary = {
|
|
46
46
|
key: "app",
|
|
47
|
+
contentAutoTransformation: true, // puede configurarse en el archivo de configuración
|
|
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 @@ Puedes declarar contenido HTML mediante la función `html` o simplemente como un
|
|
|
59
60
|
```typescript fileName="htmlDictionary.content.ts"
|
|
60
61
|
export default {
|
|
61
62
|
key: "app",
|
|
63
|
+
contentAutoTransformation: true, // puede configurarse en el archivo de configuración
|
|
62
64
|
content: {
|
|
63
|
-
myHtmlContent:
|
|
65
|
+
myHtmlContent: "<p>Hello <strong>World</strong></p>",
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
```
|