@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,20 +35,119 @@ Khi tích hợp với React Intlayer hoặc Next Intlayer, bạn chỉ cần cun
|
|
|
35
35
|
|
|
36
36
|
## Thiết Lập Nội Dung Chèn
|
|
37
37
|
|
|
38
|
-
Để thiết lập nội dung chèn trong dự án Intlayer của bạn, hãy tạo một module nội dung bao gồm các định nghĩa chèn của bạn.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
Để thiết lập nội dung chèn trong dự án Intlayer của bạn, hãy tạo một module nội dung bao gồm các định nghĩa chèn của bạn.
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<Tab label="Bọc thủ công" value="manual-wrapping">
|
|
42
|
+
Sử dụng hàm `insert` để khai báo nội dung chèn một cách rõ ràng.
|
|
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("Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!"),
|
|
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("Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!"),
|
|
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("Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!"),
|
|
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": "Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
</Tab>
|
|
99
|
+
<Tab label="Phát hiện tự động" value="automatic-detection">
|
|
100
|
+
Nếu chuỗi chứa các chỉ báo chèn phổ biến (như `{{name}}`), Intlayer sẽ tự động chuyển đổi nó.
|
|
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: "Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!",
|
|
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: "Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!",
|
|
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: "Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!",
|
|
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": "Xin chào, tôi tên là {{name}} và tôi {{age}} tuổi!",
|
|
145
|
+
},
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
</Tab>
|
|
150
|
+
</Tabs>
|
|
52
151
|
|
|
53
152
|
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
54
153
|
import { insert } from "intlayer";
|
|
@@ -41,6 +41,16 @@ Bằng cách quốc tế hóa backend, ứng dụng của bạn không chỉ tô
|
|
|
41
41
|
|
|
42
42
|
## Bắt đầu
|
|
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
|
+
Xem [Application Template](https://github.com/aymericzip/intlayer-adonisjs-template) trên GitHub.
|
|
53
|
+
|
|
44
54
|
### Cài đặt
|
|
45
55
|
|
|
46
56
|
Để bắt đầu sử dụng `adonis-intlayer`, hãy cài đặt gói bằng npm:
|
|
@@ -44,6 +44,16 @@ Bằng cách quốc tế hóa backend, ứng dụng của bạn không chỉ tô
|
|
|
44
44
|
|
|
45
45
|
## Bắt Đầu
|
|
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
|
+
Xem [Application Template](https://github.com/aymericzip/intlayer-express-template) trên GitHub.
|
|
56
|
+
|
|
47
57
|
### Cài Đặt
|
|
48
58
|
|
|
49
59
|
Để bắt đầu sử dụng `express-intlayer`, hãy cài đặt gói bằng npm:
|
|
@@ -46,6 +46,16 @@ Bằng cách quốc tế hóa backend, ứng dụng của bạn không chỉ tô
|
|
|
46
46
|
|
|
47
47
|
## Bắt đầu
|
|
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
|
+
Xem [Application Template](https://github.com/aymericzip/intlayer-fastify-template) trên GitHub.
|
|
58
|
+
|
|
49
59
|
### Cài đặt
|
|
50
60
|
|
|
51
61
|
Để bắt đầu sử dụng `fastify-intlayer`, cài gói bằng npm:
|
|
@@ -44,6 +44,16 @@ Bằng cách quốc tế hóa backend, ứng dụng của bạn không chỉ tô
|
|
|
44
44
|
|
|
45
45
|
## Bắt đầu
|
|
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
|
+
Xem [Application Template](https://github.com/aymericzip/intlayer-hono-template) trên GitHub.
|
|
56
|
+
|
|
47
57
|
### Cài đặt
|
|
48
58
|
|
|
49
59
|
Để bắt đầu sử dụng `hono-intlayer`, hãy cài đặt gói bằng 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>Hello <strong>World</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>Hello <strong>World</strong></p>",
|
|
64
66
|
},
|
|
65
67
|
};
|
|
66
68
|
```
|
|
@@ -35,69 +35,123 @@ history:
|
|
|
35
35
|
|
|
36
36
|
## 设置插入内容
|
|
37
37
|
|
|
38
|
-
要在您的 Intlayer
|
|
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
|
-
```
|
|
38
|
+
要在您的 Intlayer 项目中设置插入内容,请创建一个包含插入定义的内容模块。
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<Tab label="手动包裹" value="manual-wrapping">
|
|
42
|
+
使用 `insert` 函数显式声明插入内容。
|
|
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
|
+
"你好,我的名字是 {{name}},我今年 {{age}} 岁!"
|
|
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
|
+
"你好,我的名字是 {{name}},我今年 {{age}} 岁!"
|
|
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("你好,我的名字是 {{name}},我今年 {{age}} 岁!"),
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
module.exports = myInsertionContent;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
90
|
+
{
|
|
91
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
92
|
+
"key": "my_key",
|
|
93
|
+
"content": {
|
|
94
|
+
"myInsertion": {
|
|
95
|
+
"nodeType": "insertion",
|
|
96
|
+
"insertion": "你好,我的名字是 {{name}},我今年 {{age}} 岁!",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
</Tab>
|
|
103
|
+
<Tab label="自动检测" value="automatic-detection">
|
|
104
|
+
如果字符串包含常见的插入指示符(如 `{{name}}`),Intlayer 将自动对其进行转换。
|
|
105
|
+
|
|
106
|
+
```typescript fileName="**/*.content.ts" contentDeclarationFormat="typescript"
|
|
107
|
+
import { type Dictionary } from "intlayer";
|
|
108
|
+
|
|
109
|
+
const myInsertionContent = {
|
|
110
|
+
key: "my_key",
|
|
111
|
+
content: {
|
|
112
|
+
myInsertion: "你好,我的名字是 {{name}},我今年 {{age}} 岁!",
|
|
113
|
+
},
|
|
114
|
+
} satisfies Dictionary;
|
|
115
|
+
|
|
116
|
+
export default myInsertionContent;
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```javascript fileName="**/*.content.mjs" contentDeclarationFormat="esm"
|
|
120
|
+
/** @type {import('intlayer').Dictionary} */
|
|
121
|
+
const myInsertionContent = {
|
|
122
|
+
key: "my_key",
|
|
123
|
+
content: {
|
|
124
|
+
myInsertion: "你好,我的名字是 {{name}},我今年 {{age}} 岁!",
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export default myInsertionContent;
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
```javascript fileName="**/*.content.cjs" contentDeclarationFormat="commonjs"
|
|
132
|
+
/** @type {import('intlayer').Dictionary} */
|
|
133
|
+
const myInsertionContent = {
|
|
134
|
+
key: "my_key",
|
|
135
|
+
content: {
|
|
136
|
+
myInsertion: "你好,我的名字是 {{name}},我今年 {{age}} 岁!",
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
module.exports = myInsertionContent;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```json5 fileName="**/*.content.json" contentDeclarationFormat="json"
|
|
144
|
+
{
|
|
145
|
+
"$schema": "https://intlayer.org/schema.json",
|
|
146
|
+
"key": "my_key",
|
|
147
|
+
"content": {
|
|
148
|
+
"myInsertion": "你好,我的名字是 {{name}},我今年 {{age}} 岁!",
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
</Tab>
|
|
154
|
+
</Tabs>
|
|
101
155
|
|
|
102
156
|
## 在 React Intlayer 中使用插入内容
|
|
103
157
|
|
|
@@ -41,6 +41,16 @@ history:
|
|
|
41
41
|
|
|
42
42
|
## 入门
|
|
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
|
### 安装
|
|
45
55
|
|
|
46
56
|
要开始使用 `adonis-intlayer`,请使用 npm 安装该包:
|
|
@@ -46,6 +46,16 @@ history:
|
|
|
46
46
|
|
|
47
47
|
## 入门
|
|
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
|
### 安装
|
|
50
60
|
|
|
51
61
|
要开始使用 `express-intlayer`,请使用 npm 安装该包:
|
|
@@ -46,6 +46,16 @@ history:
|
|
|
46
46
|
|
|
47
47
|
## 入门
|
|
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
|
+
See [Application Template](https://github.com/aymericzip/intlayer-fastify-template) on GitHub.
|
|
58
|
+
|
|
49
59
|
### 安装
|
|
50
60
|
|
|
51
61
|
要开始使用 `fastify-intlayer`,请使用 npm 安装该包:
|
|
@@ -44,6 +44,16 @@ history:
|
|
|
44
44
|
|
|
45
45
|
## 入门指南
|
|
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
|
### 安装
|
|
48
58
|
|
|
49
59
|
要开始使用 `hono-intlayer`,请使用 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 @@ history:
|
|
|
49
49
|
|
|
50
50
|
## 入门指南
|
|
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
|
### 创建一个新的 NestJS 项目
|
|
53
63
|
|
|
54
64
|
```bash packageManager="npm"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/docs",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Intlayer documentation",
|
|
6
6
|
"keywords": [
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"watch": "webpack --config ./webpack.config.ts --watch"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@intlayer/config": "8.0.
|
|
77
|
-
"@intlayer/core": "8.0.
|
|
78
|
-
"@intlayer/types": "8.0.
|
|
76
|
+
"@intlayer/config": "8.0.2",
|
|
77
|
+
"@intlayer/core": "8.0.2",
|
|
78
|
+
"@intlayer/types": "8.0.2"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@intlayer/api": "8.0.
|
|
82
|
-
"@intlayer/cli": "8.0.
|
|
81
|
+
"@intlayer/api": "8.0.2",
|
|
82
|
+
"@intlayer/cli": "8.0.2",
|
|
83
83
|
"@types/node": "25.0.10",
|
|
84
84
|
"@utils/ts-config": "1.0.4",
|
|
85
85
|
"@utils/ts-config-types": "1.0.4",
|