@intlayer/docs 8.9.4 → 8.9.6-canary.0
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/benchmark/index.md +0 -3
- package/docs/ar/benchmark/nextjs.md +15 -6
- package/docs/ar/benchmark/solid.md +155 -0
- package/docs/ar/benchmark/svelte.md +148 -0
- package/docs/ar/benchmark/tanstack.md +12 -3
- package/docs/ar/benchmark/vue.md +160 -0
- package/docs/ar/configuration.md +16 -12
- package/docs/ar/dictionary/content_file.md +51 -1
- package/docs/ar/plugins/sync-po.md +0 -21
- package/docs/bn/configuration.md +16 -12
- package/docs/cs/configuration.md +16 -12
- package/docs/de/benchmark/index.md +0 -3
- package/docs/de/benchmark/nextjs.md +15 -6
- package/docs/de/benchmark/solid.md +155 -0
- package/docs/de/benchmark/svelte.md +148 -0
- package/docs/de/benchmark/tanstack.md +12 -3
- package/docs/de/benchmark/vue.md +160 -0
- package/docs/de/configuration.md +16 -12
- package/docs/de/dictionary/content_file.md +52 -2
- package/docs/de/plugins/sync-po.md +0 -22
- package/docs/en/benchmark/nextjs.md +11 -2
- package/docs/en/benchmark/solid.md +22 -4
- package/docs/en/benchmark/svelte.md +17 -5
- package/docs/en/benchmark/tanstack.md +18 -3
- package/docs/en/benchmark/vue.md +17 -11
- package/docs/en/configuration.md +16 -13
- package/docs/en/dictionary/content_file.md +51 -1
- package/docs/en/plugins/sync-po.md +0 -21
- package/docs/en-GB/benchmark/index.md +0 -3
- package/docs/en-GB/benchmark/nextjs.md +15 -6
- package/docs/en-GB/benchmark/solid.md +155 -0
- package/docs/en-GB/benchmark/svelte.md +148 -0
- package/docs/en-GB/benchmark/tanstack.md +12 -3
- package/docs/en-GB/benchmark/vue.md +160 -0
- package/docs/en-GB/configuration.md +15 -11
- package/docs/en-GB/dictionary/content_file.md +51 -1
- package/docs/en-GB/plugins/sync-po.md +0 -21
- package/docs/es/benchmark/index.md +0 -3
- package/docs/es/benchmark/nextjs.md +15 -6
- package/docs/es/benchmark/solid.md +155 -0
- package/docs/es/benchmark/svelte.md +148 -0
- package/docs/es/benchmark/tanstack.md +12 -3
- package/docs/es/benchmark/vue.md +160 -0
- package/docs/es/configuration.md +16 -12
- package/docs/es/dictionary/content_file.md +51 -1
- package/docs/es/plugins/sync-po.md +0 -21
- package/docs/fr/benchmark/index.md +0 -3
- package/docs/fr/benchmark/nextjs.md +15 -6
- package/docs/fr/benchmark/solid.md +155 -0
- package/docs/fr/benchmark/svelte.md +148 -0
- package/docs/fr/benchmark/tanstack.md +12 -3
- package/docs/fr/benchmark/vue.md +160 -0
- package/docs/fr/configuration.md +16 -12
- package/docs/fr/dictionary/content_file.md +51 -1
- package/docs/fr/plugins/sync-po.md +0 -21
- package/docs/hi/benchmark/nextjs.md +15 -6
- package/docs/hi/benchmark/solid.md +155 -0
- package/docs/hi/benchmark/svelte.md +148 -0
- package/docs/hi/benchmark/tanstack.md +12 -3
- package/docs/hi/benchmark/vue.md +160 -0
- package/docs/hi/configuration.md +16 -12
- package/docs/hi/dictionary/content_file.md +51 -1
- package/docs/hi/plugins/sync-po.md +0 -21
- package/docs/id/benchmark/index.md +0 -3
- package/docs/id/benchmark/nextjs.md +15 -6
- package/docs/id/benchmark/solid.md +155 -0
- package/docs/id/benchmark/svelte.md +148 -0
- package/docs/id/benchmark/tanstack.md +12 -3
- package/docs/id/benchmark/vue.md +160 -0
- package/docs/id/configuration.md +16 -12
- package/docs/id/dictionary/content_file.md +51 -1
- package/docs/id/plugins/sync-po.md +0 -21
- package/docs/it/benchmark/index.md +1 -4
- package/docs/it/benchmark/nextjs.md +15 -6
- package/docs/it/benchmark/solid.md +155 -0
- package/docs/it/benchmark/svelte.md +148 -0
- package/docs/it/benchmark/tanstack.md +12 -3
- package/docs/it/benchmark/vue.md +160 -0
- package/docs/it/configuration.md +16 -12
- package/docs/it/dictionary/content_file.md +51 -1
- package/docs/it/plugins/sync-po.md +0 -21
- package/docs/ja/benchmark/index.md +5 -5
- package/docs/ja/benchmark/nextjs.md +15 -6
- package/docs/ja/benchmark/solid.md +155 -0
- package/docs/ja/benchmark/svelte.md +148 -0
- package/docs/ja/benchmark/tanstack.md +12 -3
- package/docs/ja/benchmark/vue.md +160 -0
- package/docs/ja/configuration.md +16 -12
- package/docs/ja/dictionary/content_file.md +50 -2
- package/docs/ja/intlayer_with_nextjs_no_locale_path.md +4 -3
- package/docs/ja/plugins/sync-po.md +0 -21
- package/docs/ko/benchmark/nextjs.md +15 -6
- package/docs/ko/benchmark/solid.md +155 -0
- package/docs/ko/benchmark/svelte.md +148 -0
- package/docs/ko/benchmark/tanstack.md +12 -3
- package/docs/ko/benchmark/vue.md +160 -0
- package/docs/ko/configuration.md +16 -12
- package/docs/ko/dictionary/content_file.md +51 -1
- package/docs/ko/intlayer_with_nextjs_no_locale_path.md +3 -2
- package/docs/ko/plugins/sync-po.md +0 -21
- package/docs/nl/configuration.md +16 -12
- package/docs/pl/benchmark/index.md +0 -3
- package/docs/pl/benchmark/nextjs.md +15 -6
- package/docs/pl/benchmark/solid.md +155 -0
- package/docs/pl/benchmark/svelte.md +148 -0
- package/docs/pl/benchmark/tanstack.md +12 -3
- package/docs/pl/benchmark/vue.md +160 -0
- package/docs/pl/configuration.md +16 -12
- package/docs/pl/dictionary/content_file.md +51 -1
- package/docs/pl/plugins/sync-po.md +0 -21
- package/docs/pt/benchmark/index.md +0 -3
- package/docs/pt/benchmark/nextjs.md +16 -7
- package/docs/pt/benchmark/solid.md +155 -0
- package/docs/pt/benchmark/svelte.md +148 -0
- package/docs/pt/benchmark/tanstack.md +13 -4
- package/docs/pt/benchmark/vue.md +160 -0
- package/docs/pt/configuration.md +16 -12
- package/docs/pt/dictionary/content_file.md +51 -1
- package/docs/pt/plugins/sync-po.md +0 -21
- package/docs/ru/benchmark/nextjs.md +15 -6
- package/docs/ru/benchmark/solid.md +155 -0
- package/docs/ru/benchmark/svelte.md +148 -0
- package/docs/ru/benchmark/tanstack.md +12 -3
- package/docs/ru/benchmark/vue.md +160 -0
- package/docs/ru/configuration.md +16 -12
- package/docs/ru/dictionary/content_file.md +52 -2
- package/docs/ru/plugins/sync-po.md +0 -21
- package/docs/tr/benchmark/index.md +0 -3
- package/docs/tr/benchmark/nextjs.md +15 -6
- package/docs/tr/benchmark/solid.md +155 -0
- package/docs/tr/benchmark/svelte.md +148 -0
- package/docs/tr/benchmark/tanstack.md +12 -3
- package/docs/tr/benchmark/vue.md +160 -0
- package/docs/tr/configuration.md +16 -12
- package/docs/tr/dictionary/content_file.md +51 -1
- package/docs/tr/plugins/sync-po.md +0 -21
- package/docs/uk/benchmark/nextjs.md +15 -6
- package/docs/uk/benchmark/solid.md +155 -0
- package/docs/uk/benchmark/svelte.md +148 -0
- package/docs/uk/benchmark/tanstack.md +12 -3
- package/docs/uk/benchmark/vue.md +160 -0
- package/docs/uk/configuration.md +16 -12
- package/docs/uk/dictionary/content_file.md +51 -1
- package/docs/uk/plugins/sync-po.md +0 -21
- package/docs/ur/configuration.md +16 -12
- package/docs/vi/benchmark/index.md +0 -3
- package/docs/vi/benchmark/nextjs.md +15 -6
- package/docs/vi/benchmark/solid.md +155 -0
- package/docs/vi/benchmark/svelte.md +148 -0
- package/docs/vi/benchmark/tanstack.md +12 -3
- package/docs/vi/benchmark/vue.md +160 -0
- package/docs/vi/configuration.md +16 -12
- package/docs/vi/dictionary/content_file.md +51 -1
- package/docs/vi/intlayer_with_nextjs_15.md +10 -57
- package/docs/vi/plugins/sync-po.md +0 -21
- package/docs/zh/benchmark/nextjs.md +15 -6
- package/docs/zh/benchmark/solid.md +155 -0
- package/docs/zh/benchmark/svelte.md +148 -0
- package/docs/zh/benchmark/tanstack.md +12 -3
- package/docs/zh/benchmark/vue.md +160 -0
- package/docs/zh/configuration.md +16 -12
- package/docs/zh/dictionary/content_file.md +51 -3
- package/docs/zh/plugins/sync-po.md +0 -21
- package/frequent_questions/ar/intlayerNode.md +3 -3
- package/frequent_questions/de/intlayerNode.md +3 -3
- package/frequent_questions/en/intlayerNode.md +3 -3
- package/frequent_questions/en-GB/intlayerNode.md +3 -3
- package/frequent_questions/es/intlayerNode.md +3 -3
- package/frequent_questions/fr/intlayerNode.md +3 -3
- package/frequent_questions/hi/intlayerNode.md +3 -3
- package/frequent_questions/id/intlayerNode.md +3 -3
- package/frequent_questions/it/intlayerNode.md +3 -3
- package/frequent_questions/ja/intlayerNode.md +3 -3
- package/frequent_questions/ko/intlayerNode.md +3 -3
- package/frequent_questions/pl/intlayerNode.md +3 -3
- package/frequent_questions/pt/intlayerNode.md +3 -3
- package/frequent_questions/ru/intlayerNode.md +3 -3
- package/frequent_questions/tr/intlayerNode.md +3 -3
- package/frequent_questions/uk/intlayerNode.md +3 -3
- package/frequent_questions/vi/intlayerNode.md +3 -3
- package/frequent_questions/zh/intlayerNode.md +3 -3
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
createdAt: 2025-02-07
|
|
3
|
-
updatedAt: 2026-
|
|
3
|
+
updatedAt: 2026-05-12
|
|
4
4
|
title: 内容文件
|
|
5
5
|
description: 学习如何自定义内容声明文件的扩展。按照本指南高效地在项目中实现条件。
|
|
6
6
|
keywords:
|
|
@@ -12,6 +12,9 @@ slugs:
|
|
|
12
12
|
- concept
|
|
13
13
|
- content
|
|
14
14
|
history:
|
|
15
|
+
- version: 8.9.0
|
|
16
|
+
date: 2026-05-12
|
|
17
|
+
changes: "添加 `plural` 内容节点类型"
|
|
15
18
|
- version: 8.0.0
|
|
16
19
|
date: 2026-01-28
|
|
17
20
|
changes: "添加 `html` 内容节点类型"
|
|
@@ -66,6 +69,7 @@ import { type ReactNode } from "react";
|
|
|
66
69
|
import {
|
|
67
70
|
t,
|
|
68
71
|
enu,
|
|
72
|
+
plural,
|
|
69
73
|
cond,
|
|
70
74
|
nest,
|
|
71
75
|
md,
|
|
@@ -85,7 +89,8 @@ interface Content {
|
|
|
85
89
|
};
|
|
86
90
|
};
|
|
87
91
|
multilingualContent: string; // 多语言内容
|
|
88
|
-
quantityContent: string;
|
|
92
|
+
quantityContent: string;
|
|
93
|
+
pluralContent: string; // 数量内容
|
|
89
94
|
conditionalContent: string; // 条件内容
|
|
90
95
|
markdownContent: never; // Markdown 内容
|
|
91
96
|
htmlContent: never; // HTML 内容
|
|
@@ -121,6 +126,10 @@ export default {
|
|
|
121
126
|
"1": "一辆车",
|
|
122
127
|
">5": "几辆车",
|
|
123
128
|
">19": "许多车",
|
|
129
|
+
}),
|
|
130
|
+
pluralContent: plural({
|
|
131
|
+
one: "One car",
|
|
132
|
+
other: "{{count}} cars",
|
|
124
133
|
}), // 数量内容
|
|
125
134
|
conditionalContent: cond({
|
|
126
135
|
true: "验证已启用",
|
|
@@ -176,6 +185,13 @@ export default {
|
|
|
176
185
|
">5": "一些汽车",
|
|
177
186
|
">19": "许多汽车",
|
|
178
187
|
},
|
|
188
|
+
"pluralContent": {
|
|
189
|
+
"nodeType": "plural",
|
|
190
|
+
"plural": {
|
|
191
|
+
"one": "One car",
|
|
192
|
+
"other": "{{count}} cars",
|
|
193
|
+
},
|
|
194
|
+
},
|
|
179
195
|
},
|
|
180
196
|
"conditionalContent": {
|
|
181
197
|
"nodeType": "condition",
|
|
@@ -219,6 +235,7 @@ export default {
|
|
|
219
235
|
- **原始值**:字符串、数字、布尔值、null、undefined
|
|
220
236
|
- **类型化节点**:特殊内容类型,如翻译、条件、Markdown 等
|
|
221
237
|
- **函数**:可在运行时计算的动态内容 [参见函数获取](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/function_fetching.md)
|
|
238
|
+
- **复数内容**: 请参阅 复数内容 [请参阅 复数内容](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/plural.md)
|
|
222
239
|
- **嵌套内容**:对其他字典的引用
|
|
223
240
|
|
|
224
241
|
#### 内容类型
|
|
@@ -557,6 +574,8 @@ multilingualContent: t({
|
|
|
557
574
|
});
|
|
558
575
|
```
|
|
559
576
|
|
|
577
|
+
> 请参阅 [翻译内容 (`t`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/translation.md) 以获取更多信息。
|
|
578
|
+
|
|
560
579
|
### 条件内容 (`cond`)
|
|
561
580
|
|
|
562
581
|
基于布尔条件变化的内容:
|
|
@@ -570,6 +589,8 @@ conditionalContent: cond({
|
|
|
570
589
|
});
|
|
571
590
|
```
|
|
572
591
|
|
|
592
|
+
> 请参阅 [条件内容 (`cond`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/condition.md) 以获取更多信息。
|
|
593
|
+
|
|
573
594
|
### 枚举内容 (`enu`)
|
|
574
595
|
|
|
575
596
|
基于枚举值变化的内容:
|
|
@@ -584,7 +605,22 @@ statusContent: enu({
|
|
|
584
605
|
});
|
|
585
606
|
```
|
|
586
607
|
|
|
587
|
-
|
|
608
|
+
> 请参阅 [枚举内容 (`enu`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/enumeration.md) 以获取更多信息。
|
|
609
|
+
|
|
610
|
+
### Plural Content (`plural`)
|
|
611
|
+
|
|
612
|
+
Content that varies based on plural rules:
|
|
613
|
+
|
|
614
|
+
```typescript
|
|
615
|
+
import { plural } from "intlayer";
|
|
616
|
+
|
|
617
|
+
pluralContent: plural({
|
|
618
|
+
one: "One car",
|
|
619
|
+
other: "{{count}} cars",
|
|
620
|
+
});
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
> 请参阅 [Plural Content 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/plural.md) 以获取更多信息。### 插入内容 (`insert`)
|
|
588
624
|
|
|
589
625
|
可以插入到其他内容中的内容:
|
|
590
626
|
|
|
@@ -594,6 +630,8 @@ import { insert } from "intlayer";
|
|
|
594
630
|
insertionContent: insert("这段文本可以插入到任何地方");
|
|
595
631
|
```
|
|
596
632
|
|
|
633
|
+
> 请参阅 [插入内容 (`insert`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/insertion.md) 以获取更多信息。
|
|
634
|
+
|
|
597
635
|
### 嵌套内容 (`nest`)
|
|
598
636
|
|
|
599
637
|
引用其他字典:
|
|
@@ -604,6 +642,8 @@ import { nest } from "intlayer";
|
|
|
604
642
|
nestedContent: nest("about-page");
|
|
605
643
|
```
|
|
606
644
|
|
|
645
|
+
> 请参阅 [嵌套内容 (`nest`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/nesting.md) 以获取更多信息。
|
|
646
|
+
|
|
607
647
|
### Markdown 内容 (`md`)
|
|
608
648
|
|
|
609
649
|
Markdown 格式的富文本内容:
|
|
@@ -616,6 +656,8 @@ markdownContent: md(
|
|
|
616
656
|
);
|
|
617
657
|
```
|
|
618
658
|
|
|
659
|
+
> 请参阅 [Markdown 内容 (`md`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/markdown.md) 以获取更多信息。
|
|
660
|
+
|
|
619
661
|
### HTML 内容 (`html`)
|
|
620
662
|
|
|
621
663
|
可使用标准标签或自定义组件的富 HTML 内容:
|
|
@@ -633,6 +675,8 @@ localizedHtmlContent: t({
|
|
|
633
675
|
});
|
|
634
676
|
```
|
|
635
677
|
|
|
678
|
+
> 请参阅 [HTML 内容 (`html`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/html.md) 以获取更多信息。
|
|
679
|
+
|
|
636
680
|
### 性别内容 (`gender`)
|
|
637
681
|
|
|
638
682
|
根据性别变化的内容:
|
|
@@ -647,6 +691,8 @@ genderContent: gender({
|
|
|
647
691
|
});
|
|
648
692
|
```
|
|
649
693
|
|
|
694
|
+
> 请参阅 [性别内容 (`gender`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/gender.md) 以获取更多信息。
|
|
695
|
+
|
|
650
696
|
### 文件内容 (`file`)
|
|
651
697
|
|
|
652
698
|
引用外部文件:
|
|
@@ -657,6 +703,8 @@ import { file } from "intlayer";
|
|
|
657
703
|
fileContent: file("./path/to/content.txt");
|
|
658
704
|
```
|
|
659
705
|
|
|
706
|
+
> 请参阅 [文件内容 (`file`) 文档](https://github.com/aymericzip/intlayer/blob/main/docs/docs/zh/dictionary/file.md) 以获取更多信息。
|
|
707
|
+
|
|
660
708
|
## 创建内容文件
|
|
661
709
|
|
|
662
710
|
### 基本内容文件结构
|
|
@@ -160,30 +160,9 @@ syncPO({
|
|
|
160
160
|
source: ({ key, locale }) => string, // 必填
|
|
161
161
|
location?: string, // 可选标签,默认:"sync-po::path/to/source"
|
|
162
162
|
priority?: number, // 用于冲突解决的可选优先级,默认:0
|
|
163
|
-
format?: 'icu' | 'i18next' | 'vue-i18n', // 可选,仅当您的 msgstr 值使用特定插值语法时才需要
|
|
164
163
|
});
|
|
165
164
|
```
|
|
166
165
|
|
|
167
|
-
#### `format` ('icu' | 'i18next' | 'vue-i18n')
|
|
168
|
-
|
|
169
|
-
PO 文件始终是 Gettext Portable Object 文件 —— 这是固定的。此选项仅描述 `msgstr` 值内部使用的 **插值语法**,以便 Intlayer 可以在解析时(通过 `formatDictionary`)将其转换为自己的格式,并在写入输出时转换回来。
|
|
170
|
-
|
|
171
|
-
- `undefined` _(默认)_:`msgstr` 值被视为普通字符串 —— 不进行转换。大多数 PO 文件使用此选项。
|
|
172
|
-
- `'icu'`:`msgstr` 值使用 ICU 消息语法(例如 `{count, plural, one {# item} other {# items}}`)。
|
|
173
|
-
- `'i18next'`:`msgstr` 值使用 i18next 插值语法(例如 `{{variable}}`)。
|
|
174
|
-
- `'vue-i18n'`:`msgstr` 值使用 Vue I18n 语法。
|
|
175
|
-
|
|
176
|
-
> 转换由 `@intlayer/chokidar` 的 `formatDictionary` 在加载时应用,并在写入时通过 `formatDictionaryOutput` 反转。对于像 ICU 复数这样的复杂规则,不保证往返的保真度。
|
|
177
|
-
|
|
178
|
-
**示例 —— PO 文件包含 i18next 风格的插值:**
|
|
179
|
-
|
|
180
|
-
```ts
|
|
181
|
-
syncPO({
|
|
182
|
-
source: ({ key, locale }) => `./locales/${locale}/${key}.po`,
|
|
183
|
-
format: "i18next",
|
|
184
|
-
}),
|
|
185
|
-
```
|
|
186
|
-
|
|
187
166
|
### 多个 PO 源和优先级
|
|
188
167
|
|
|
189
168
|
您可以添加多个 `syncPO` 插件来同步不同的 PO 源。当您的项目中有多个翻译源或不同的 PO 结构时,这很有用。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: نوع IntlayerNode. ما هو؟
|
|
5
|
-
description: ما هو نوع IntlayerNode؟ لماذا يتم تحويل سلسلتي النصية إلى IntlayerNode
|
|
5
|
+
description: ما هو نوع IntlayerNode؟ لماذا يتم تحويل سلسلتي النصية إلى IntlayerNode<string>؟
|
|
6
6
|
keywords:
|
|
7
7
|
- مقدمة
|
|
8
8
|
- ابدأ الآن
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // يرجع النوع: IntlayerNode
|
|
60
|
+
return title; // يرجع النوع: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ const AppContent = () => {
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// حالة السلسلة النصية (String)
|
|
83
|
-
content.title; // يرجع IntlayerNode
|
|
83
|
+
content.title; // يرجع IntlayerNode<string>
|
|
84
84
|
content.title.value; // يرجع المحتوى الأساسي، هنا سلسلة نصية
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // يرجع سلسلة نصية
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode Typ. Was ist das?
|
|
5
|
-
description: Was ist der IntlayerNode-Typ? Warum wird mein String in einen IntlayerNode
|
|
5
|
+
description: Was ist der IntlayerNode-Typ? Warum wird mein String in einen IntlayerNode<string> umgewandelt?
|
|
6
6
|
keywords:
|
|
7
7
|
- Einführung
|
|
8
8
|
- Erste Schritte
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // gibt Typ zurück: IntlayerNode
|
|
60
|
+
return title; // gibt Typ zurück: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Zum Beispiel:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Fall von String
|
|
83
|
-
content.title; // Gibt IntlayerNode
|
|
83
|
+
content.title; // Gibt IntlayerNode<string> zurück
|
|
84
84
|
content.title.value; // Gibt den Basisinhalt zurück, hier ein String
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Gibt String zurück
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode type. What is it?
|
|
5
|
-
description: What is it the IntlayerNode type? Why my string is transformed as an IntlayerNode
|
|
5
|
+
description: What is it the IntlayerNode type? Why my string is transformed as an IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introduction
|
|
8
8
|
- Get started
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // returns type: IntlayerNode
|
|
60
|
+
return title; // returns type: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ For instance:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Case of String
|
|
83
|
-
content.title; // Returns IntlayerNode
|
|
83
|
+
content.title; // Returns IntlayerNode<string>
|
|
84
84
|
content.title.value; // Returns the base content, here a string
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Returns string
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode type. What is it?
|
|
5
|
-
description: What is it the IntlayerNode type? Why my string is transformed as an IntlayerNode
|
|
5
|
+
description: What is it the IntlayerNode type? Why my string is transformed as an IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introduction
|
|
8
8
|
- Get started
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // returns type: IntlayerNode
|
|
60
|
+
return title; // returns type: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ For instance:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Case of String
|
|
83
|
-
content.title; // Returns IntlayerNode
|
|
83
|
+
content.title; // Returns IntlayerNode<string>
|
|
84
84
|
content.title.value; // Returns the base content, here a string
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Returns string
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Tipo IntlayerNode. ¿Qué es?
|
|
5
|
-
description: ¿Qué es el tipo IntlayerNode? ¿Por qué mi cadena se transforma en un IntlayerNode
|
|
5
|
+
description: ¿Qué es el tipo IntlayerNode? ¿Por qué mi cadena se transforma en un IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introducción
|
|
8
8
|
- Empezar
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // devuelve tipo: IntlayerNode
|
|
60
|
+
return title; // devuelve tipo: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Por ejemplo:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Caso de cadena (String)
|
|
83
|
-
content.title; // Devuelve IntlayerNode
|
|
83
|
+
content.title; // Devuelve IntlayerNode<string>
|
|
84
84
|
content.title.value; // Devuelve el contenido base, aquí una cadena
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Devuelve cadena
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Type IntlayerNode. Qu'est-ce que c'est ?
|
|
5
|
-
description: Qu'est-ce que le type IntlayerNode ? Pourquoi ma chaîne est-elle transformée en IntlayerNode
|
|
5
|
+
description: Qu'est-ce que le type IntlayerNode ? Pourquoi ma chaîne est-elle transformée en IntlayerNode<string> ?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introduction
|
|
8
8
|
- Commencer
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // retourne le type : IntlayerNode
|
|
60
|
+
return title; // retourne le type : IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Par exemple :
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Cas d'une chaîne (String)
|
|
83
|
-
content.title; // Retourne IntlayerNode
|
|
83
|
+
content.title; // Retourne IntlayerNode<string>
|
|
84
84
|
content.title.value; // Retourne le contenu de base, ici une chaîne
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Retourne une chaîne
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode प्रकार। यह क्या है?
|
|
5
|
-
description: IntlayerNode प्रकार क्या है? मेरी स्ट्रिंग IntlayerNode
|
|
5
|
+
description: IntlayerNode प्रकार क्या है? मेरी स्ट्रिंग IntlayerNode<string> में क्यों बदल गई है?
|
|
6
6
|
keywords:
|
|
7
7
|
- परिचय
|
|
8
8
|
- शुरू करें
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // प्रकार लौटाता है: IntlayerNode
|
|
60
|
+
return title; // प्रकार लौटाता है: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Intlayer CMS / विजुअल एडिटर के संदर्भ म
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// स्ट्रिंग का मामला
|
|
83
|
-
content.title; // IntlayerNode
|
|
83
|
+
content.title; // IntlayerNode<string> लौटाता है
|
|
84
84
|
content.title.value; // बेस कंटेंट लौटाता है, यहाँ एक स्ट्रिंग
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // स्ट्रिंग लौटाता है
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Tipe IntlayerNode. Apa itu?
|
|
5
|
-
description: Apa itu tipe IntlayerNode? Mengapa string saya diubah menjadi IntlayerNode
|
|
5
|
+
description: Apa itu tipe IntlayerNode? Mengapa string saya diubah menjadi IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Pendahuluan
|
|
8
8
|
- Memulai
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // mengembalikan tipe: IntlayerNode
|
|
60
|
+
return title; // mengembalikan tipe: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Sebagai contoh:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Kasus String
|
|
83
|
-
content.title; // Mengembalikan IntlayerNode
|
|
83
|
+
content.title; // Mengembalikan IntlayerNode<string>
|
|
84
84
|
content.title.value; // Mengembalikan konten dasar, dalam hal ini sebuah string
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Mengembalikan string
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Tipo IntlayerNode. Cos'è?
|
|
5
|
-
description: Cos'è il tipo IntlayerNode? Perché la mia stringa viene trasformata in un IntlayerNode
|
|
5
|
+
description: Cos'è il tipo IntlayerNode? Perché la mia stringa viene trasformata in un IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introduzione
|
|
8
8
|
- Iniziare
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // restituisce il tipo: IntlayerNode
|
|
60
|
+
return title; // restituisce il tipo: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Per esempio:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Caso di una stringa
|
|
83
|
-
content.title; // Restituisce IntlayerNode
|
|
83
|
+
content.title; // Restituisce IntlayerNode<string>
|
|
84
84
|
content.title.value; // Restituisce il contenuto di base, in questo caso una stringa
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Restituisce una stringa
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode 型。これは何ですか?
|
|
5
|
-
description: IntlayerNode 型とは何ですか?なぜ私の文字列が IntlayerNode
|
|
5
|
+
description: IntlayerNode 型とは何ですか?なぜ私の文字列が IntlayerNode<string> に変換されるのですか?
|
|
6
6
|
keywords:
|
|
7
7
|
- 導入
|
|
8
8
|
- はじめる
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // 型: IntlayerNode
|
|
60
|
+
return title; // 型: IntlayerNode<string> を返します
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ IntlayerNode は、拡張された React/Vue/Preact/Solid/Angular/Svelte/Lit/Van
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// 文字列の場合
|
|
83
|
-
content.title; // IntlayerNode
|
|
83
|
+
content.title; // IntlayerNode<string> を返す
|
|
84
84
|
content.title.value; // ベースとなるコンテンツ(ここでは文字列)を返す
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // 文字列を返す
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode 타입. 무엇인가요?
|
|
5
|
-
description: IntlayerNode 타입은 무엇인가요? 왜 내 문자열이 IntlayerNode
|
|
5
|
+
description: IntlayerNode 타입은 무엇인가요? 왜 내 문자열이 IntlayerNode<string>으로 변환되나요?
|
|
6
6
|
keywords:
|
|
7
7
|
- 소개
|
|
8
8
|
- 시작하기
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // 타입 반환: IntlayerNode
|
|
60
|
+
return title; // 타입 반환: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ IntlayerNode는 강화된 React/Vue/Preact/Solid/Angular/Svelte/Lit/Vanilla 노
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// 문자열의 경우
|
|
83
|
-
content.title; // IntlayerNode
|
|
83
|
+
content.title; // IntlayerNode<string> 반환
|
|
84
84
|
content.title.value; // 기본 콘텐츠 반환, 여기서는 문자열
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // 문자열 반환
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Typ IntlayerNode. Co to jest?
|
|
5
|
-
description: Czym jest typ IntlayerNode? Dlaczego mój ciąg znaków jest przekształcany w IntlayerNode
|
|
5
|
+
description: Czym jest typ IntlayerNode? Dlaczego mój ciąg znaków jest przekształcany w IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Wprowadzenie
|
|
8
8
|
- Rozpoczęcie pracy
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // zwraca typ: IntlayerNode
|
|
60
|
+
return title; // zwraca typ: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Na przykład:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Przypadek ciągu znaków (String)
|
|
83
|
-
content.title; // Zwraca IntlayerNode
|
|
83
|
+
content.title; // Zwraca IntlayerNode<string>
|
|
84
84
|
content.title.value; // Zwraca bazową treść, tutaj ciąg znaków
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Zwraca ciąg znaków
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Tipo IntlayerNode. O que é?
|
|
5
|
-
description: O que é o tipo IntlayerNode? Por que minha string é transformada em um IntlayerNode
|
|
5
|
+
description: O que é o tipo IntlayerNode? Por que minha string é transformada em um IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Introdução
|
|
8
8
|
- Primeiros passos
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // retorna o tipo: IntlayerNode
|
|
60
|
+
return title; // retorna o tipo: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Por exemplo:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Caso de String
|
|
83
|
-
content.title; // Retorna IntlayerNode
|
|
83
|
+
content.title; // Retorna IntlayerNode<string>
|
|
84
84
|
content.title.value; // Retorna o conteúdo base, aqui uma string
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Retorna string
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Тип IntlayerNode. Что это такое?
|
|
5
|
-
description: Что такое тип IntlayerNode? Почему моя строка преобразуется в IntlayerNode
|
|
5
|
+
description: Что такое тип IntlayerNode? Почему моя строка преобразуется в IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Введение
|
|
8
8
|
- Начало работы
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // возвращает тип: IntlayerNode
|
|
60
|
+
return title; // возвращает тип: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ IntlayerNode — это расширенный узел React/Vue/Preact/Solid/A
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Случай со строкой
|
|
83
|
-
content.title; // Возвращает IntlayerNode
|
|
83
|
+
content.title; // Возвращает IntlayerNode<string>
|
|
84
84
|
content.title.value; // Возвращает базовое содержимое, в данном случае строку
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Возвращает строку
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: IntlayerNode tipi. Nedir bu?
|
|
5
|
-
description: IntlayerNode tipi nedir? Neden dizgim bir IntlayerNode
|
|
5
|
+
description: IntlayerNode tipi nedir? Neden dizgim bir IntlayerNode<string> olarak dönüştürülüyor?
|
|
6
6
|
keywords:
|
|
7
7
|
- Giriş
|
|
8
8
|
- Başlarken
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // şu tipi döndürür: IntlayerNode
|
|
60
|
+
return title; // şu tipi döndürür: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Bir IntlayerNode; zenginleştirilmiş bir React/Vue/Preact/Solid/Angular/Svelte/
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// String Durumu
|
|
83
|
-
content.title; // IntlayerNode
|
|
83
|
+
content.title; // IntlayerNode<string> döndürür
|
|
84
84
|
content.title.value; // Temel içeriği döndürür, burada bir string
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // String döndürür
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Тип IntlayerNode. Що це таке?
|
|
5
|
-
description: Що таке тип IntlayerNode? Чому мій рядок перетворюється на IntlayerNode
|
|
5
|
+
description: Що таке тип IntlayerNode? Чому мій рядок перетворюється на IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Вступ
|
|
8
8
|
- Початок роботи
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // повертає тип: IntlayerNode
|
|
60
|
+
return title; // повертає тип: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ IntlayerNode — це розширений вузол React/Vue/Preact/Solid/Ang
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Випадок з рядком (String)
|
|
83
|
-
content.title; // Повертає IntlayerNode
|
|
83
|
+
content.title; // Повертає IntlayerNode<string>
|
|
84
84
|
content.title.value; // Повертає базовий вміст, у даному випадку рядок
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Повертає рядок
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
createdAt: 2026-05-07
|
|
3
3
|
updatedAt: 2026-05-07
|
|
4
4
|
title: Kiểu IntlayerNode. Nó là gì?
|
|
5
|
-
description: Kiểu IntlayerNode là gì? Tại sao chuỗi của tôi lại được chuyển đổi thành IntlayerNode
|
|
5
|
+
description: Kiểu IntlayerNode là gì? Tại sao chuỗi của tôi lại được chuyển đổi thành IntlayerNode<string>?
|
|
6
6
|
keywords:
|
|
7
7
|
- Giới thiệu
|
|
8
8
|
- Bắt đầu
|
|
@@ -57,7 +57,7 @@ import { useIntlayer } from "react-intlayer";
|
|
|
57
57
|
const AppContent = () => {
|
|
58
58
|
const { title } = useIntlayer("app");
|
|
59
59
|
|
|
60
|
-
return title; // trả về kiểu: IntlayerNode
|
|
60
|
+
return title; // trả về kiểu: IntlayerNode<string>
|
|
61
61
|
};
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -80,7 +80,7 @@ Ví dụ:
|
|
|
80
80
|
const content = useIntlayer("app");
|
|
81
81
|
|
|
82
82
|
// Trường hợp là Chuỗi (String)
|
|
83
|
-
content.title; // Trả về IntlayerNode
|
|
83
|
+
content.title; // Trả về IntlayerNode<string>
|
|
84
84
|
content.title.value; // Trả về nội dung cơ bản, ở đây là một chuỗi
|
|
85
85
|
|
|
86
86
|
content.title.toString(); // Trả về chuỗi
|