Skip to content

Commit 21f2c66

Browse files
[add] Simplified Chinese (zh) documentation translation
- translate all 80 docs articles to Chinese into i18n/zh current - preserve @getshort macros, code, links, slugs and heading anchors - add explicit Chinese admonition titles (信息/注意/提示/警告/...) - apply CJK/Latin spacing convention; copy assets; write .sync marker - zh build is clean: 0 broken links, macros expand, lang=zh-CN
1 parent d2254b4 commit 21f2c66

90 files changed

Lines changed: 6604 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d2254b4abb64b5c703b5a2619d22babc37ec0228
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
sidebar_label: defaultStyles
3+
title: defaultStyles 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 defaultStyles 配置项。浏览开发指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX RichText 的 30 天免费评估版本。
5+
---
6+
7+
# defaultStyles
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。为特定块类型指定默认样式值
12+
13+
### 用法 {#usage}
14+
15+
~~~jsx {}
16+
defaultStyles?: {
17+
"*"?: { // affects all blocks, allowing you to set common properties for all of these blocks
18+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
19+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
20+
color?: string;
21+
background?: string;
22+
},
23+
p?: {
24+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
25+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
26+
color?: string;
27+
background?: string;
28+
},
29+
blockquote?: {
30+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
31+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
32+
color?: string;
33+
background?: string;
34+
},
35+
h1?: {
36+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
37+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
38+
color?: string;
39+
background?: string;
40+
},
41+
h2?: {
42+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
43+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
44+
color?: string;
45+
background?: string;
46+
},
47+
h3?: {
48+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
49+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
50+
color?: string;
51+
background?: string;
52+
},
53+
h4?: {
54+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
55+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
56+
color?: string;
57+
background?: string;
58+
},
59+
h5?: {
60+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
61+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
62+
color?: string;
63+
background?: string;
64+
},
65+
h6?: {
66+
"font-family"?: string; // "Roboto"| "Arial" | "Georgia" | "Tahoma" | "Times New Roman" | "Verdana"
67+
"font-size"?: string; // "12px" | "14px" | "16px" | "18px" | "20px" | "24px" | "28px" | "32px" | "36px"
68+
color?: string;
69+
background?: string;
70+
}
71+
};
72+
~~~
73+
74+
:::important[重要]
75+
`defaultStyles` 属性**不会**将实际的 CSS 应用到受影响的块上。CSS 样式需要单独应用:
76+
77+
```jsx title="index.js"
78+
new richtext.Richtext("#root", {
79+
defaultStyles: {
80+
h2: {
81+
"font-family": "Roboto",
82+
"font-size": "28px",
83+
color: "purple",
84+
background: "#FFC0CB"
85+
}
86+
}
87+
});
88+
```
89+
90+
```css title="index.css"
91+
<style>
92+
#root h2 {
93+
font-family: Roboto;
94+
font-size: 28px;
95+
color: purple;
96+
background: #FFC0CB;
97+
}
98+
</style>
99+
```
100+
101+
在此示例中,所有 `h2` 块均被指定为 `"Roboto"` 字体,字号为 28px,同时更改了前景色和背景色。CSS 样式也同样应用于 `h2` 块。
102+
:::
103+
104+
### 默认配置 {#default-config}
105+
106+
~~~jsx
107+
const defaultStyles = {
108+
"*": { "font-family": "Arial" },
109+
p: { "font-size": "14px" },
110+
blockquote: { "font-size": "14px" },
111+
h1: { "font-size": "32px" },
112+
h2: { "font-size": "24px" },
113+
h3: { "font-size": "18px" },
114+
h4: { "font-size": "16px" },
115+
h5: { "font-size": "14px" },
116+
h6: { "font-size": "12px" }
117+
};
118+
~~~
119+
120+
### 示例 {#example}
121+
122+
~~~jsx {3-13}
123+
// 初始化 RichText
124+
new richtext.Richtext("#root", {
125+
defaultStyles: {
126+
h4: {
127+
"font-family": "Roboto"
128+
},
129+
h5: {
130+
"font-family": "Roboto"
131+
},
132+
h6: {
133+
"font-family": "Roboto"
134+
}
135+
},
136+
// 其他配置属性
137+
});
138+
~~~
139+
140+
**更新日志:** 该属性在 v2.0 中进行了更新
141+
142+
**相关文章:** [配置](guides/configuration.md)
143+
144+
**相关示例:** [RichText. 更改排版默认值(字体、字号等)](https://snippet.dhtmlx.com/6u3ti01s?tag=richtext)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
sidebar_label: fullscreenMode
3+
title: fullscreenMode 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 fullscreenMode 配置项。浏览开发者指南和 API 参考,试用代码示例和在线演示,并下载 DHTMLX RichText 的免费 30 天评估版本。
5+
---
6+
7+
# fullscreenMode
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。启用 RichText 全屏模式
12+
13+
### 用法 {#usage}
14+
15+
~~~jsx {}
16+
fullscreenMode?: boolean;
17+
~~~
18+
19+
### 默认配置 {#default-config}
20+
21+
~~~jsx
22+
fullscreenMode: false;
23+
~~~
24+
25+
### 示例 {#example}
26+
27+
~~~jsx {3}
28+
// 初始化 RichText
29+
new richtext.Richtext("#root", {
30+
fullscreenMode: true
31+
// 其他配置属性
32+
});
33+
~~~
34+
35+
**更新日志:** 该属性在 v2.0 中新增
36+
37+
**相关文章:** [配置](guides/configuration.md)
38+
39+
**相关示例:** [RichText. 完整工具栏](https://snippet.dhtmlx.com/ziynafp7?tag=richtext)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
sidebar_label: imageUploadUrl
3+
title: imageUploadUrl 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 imageUploadUrl 配置项。浏览开发者指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX RichText 的免费 30 天评估版本。
5+
---
6+
7+
# imageUploadUrl
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。指定用于图片上传(来自工具栏、菜单栏、剪贴板粘贴或拖放操作)的 URL
12+
13+
当该属性被设置时,RichText 会将每张插入的图片上传到指定端点,并插入服务器返回的 URL。
14+
15+
当该属性被省略或设置为假值(`""``null``undefined`)时,RichText 切换到**内联模式**:图片文件在客户端读取,并以 base64 数据 URL 的形式直接嵌入到内容中——无需服务器。大于 1024×800 的内联图片将按比例缩小以适应此限制。
16+
17+
:::note[注意]
18+
内联(base64)图片无法通过内置的 DOCX / PDF [导出](api/events/export.md)功能保留。如果您依赖导出功能,请提供 `imageUploadUrl`,使图片引用外部地址。
19+
:::
20+
21+
:::caution[谨慎]
22+
Base64 编码会使编码后的数据量相比原始文件增加约三分之一。包含多张大型内联图片的文档体积会相应增长,这将影响 [`getValue()`](api/methods/get-value.md) 返回值的大小、编辑器的内存占用,以及持久化或传输内容的开销。对于包含大量或大尺寸图片的文档,建议使用服务器端 `imageUploadUrl`
23+
:::
24+
25+
### 用法 {#usage}
26+
27+
~~~jsx {}
28+
imageUploadUrl?: string;
29+
~~~
30+
31+
### 示例 {#example}
32+
33+
将图片上传到服务器端点:
34+
35+
~~~jsx {3}
36+
// 初始化 RichText
37+
new richtext.Richtext("#root", {
38+
imageUploadUrl: "https://example.com/upload"
39+
// 其他配置属性
40+
});
41+
~~~
42+
43+
以 base64 方式内联插入图片(无需服务器)——省略该属性或传入空字符串:
44+
45+
~~~jsx {2}
46+
new richtext.Richtext("#root", {
47+
// imageUploadUrl 未设置,图片将以 base64 数据 URL 的形式插入
48+
// 其他配置属性
49+
});
50+
~~~
51+
52+
**更新日志:** 该属性在 v2.0 中新增。自 v2.1 起,该属性为可选:省略时,图片将以 base64 数据 URL 的形式内联插入。
53+
54+
**相关文章:** [配置](guides/configuration.md)[与服务器配合使用](guides/working_with_server.md)
55+
56+
**相关示例:** [RichText. 初始化](https://snippet.dhtmlx.com/t55alxiy?tag=richtext)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
sidebar_label: layoutMode
3+
title: layoutMode 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 layoutMode 配置项。浏览开发者指南和 API 参考,试用代码示例和在线演示,并下载 DHTMLX RichText 的免费 30 天评估版本。
5+
---
6+
7+
# layoutMode
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。指定主编辑区域的布局模式
12+
13+
### 用法 {#usage}
14+
15+
~~~jsx {}
16+
layoutMode: "classic" | "document";
17+
~~~
18+
19+
`"classic"` 模式将填充整个编辑区域。`"document"` 模式将编辑区域显示为文档页面。
20+
21+
### 默认配置 {#default-config}
22+
23+
~~~jsx
24+
layoutMode: "classic";
25+
~~~
26+
27+
### 示例 {#example}
28+
29+
~~~jsx {3}
30+
// 初始化 RichText
31+
new richtext.Richtext("#root", {
32+
layoutMode: "document" // 默认使用 "document" 模式初始化 RichText
33+
// 其他配置属性
34+
});
35+
~~~
36+
37+
**变更日志:** 该属性在 v2.0 中新增,用于替代已移除的 `mode` 属性
38+
39+
**相关文章:** [配置](guides/configuration.md)
40+
41+
**相关示例:** [RichText. 初始化](https://snippet.dhtmlx.com/t55alxiy?tag=richtext)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
sidebar_label: locale
3+
title: locale 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 locale 配置项。浏览开发者指南和 API 参考,查看代码示例和在线演示,并下载 DHTMLX RichText 的免费 30 天评估版本。
5+
---
6+
7+
# locale
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。一个包含 RichText 本地化标签的对象
12+
13+
:::info[信息]
14+
**locale** 对象需要包含 RichText 的所有标签及对应的翻译内容。
15+
:::
16+
17+
### 用法 {#usage}
18+
19+
~~~jsx {}
20+
locale?: object;
21+
~~~
22+
23+
### 默认配置 {#default-config}
24+
25+
默认情况下,RichText 使用**英语**语言包。您也可以将其设置为自定义语言包。
26+
27+
:::tip[提示]
28+
如需动态切换当前语言包,可以使用 RichText 的 [**setLocale()**](api/methods/set-locale.md) 方法
29+
:::
30+
31+
### 示例 {#example}
32+
33+
~~~jsx {3}
34+
// initialize RichText
35+
const editor = new richtext.RichText("#root", {
36+
locale: richtext.locales.cn // the Chineese locale will be set initially
37+
// locale: richtext.locales.en // the English locale will be set initially
38+
// locale: richtext.locales.de // the Germany locale will be set initially
39+
// other configuration properties
40+
});
41+
~~~
42+
43+
**变更日志:** 该属性在 v2.0 版本中新增
44+
45+
**相关文章:** [本地化](guides/localization.md)
46+
47+
**相关示例:** [RichText. 本地化](https://snippet.dhtmlx.com/zxjrin3i?tag=richtext)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
sidebar_label: menubar
3+
title: menubar 配置项
4+
description: 您可以在 DHTMLX JavaScript RichText 库的文档中了解 menubar 配置项。浏览开发指南和 API 参考,体验代码示例和在线演示,并下载 DHTMLX RichText 的 30 天免费评估版本。
5+
---
6+
7+
# menubar
8+
9+
### 描述 {#description}
10+
11+
@short: 可选。启用 RichText 顶部菜单栏
12+
13+
### 用法 {#usage}
14+
15+
~~~jsx {}
16+
menubar?: boolean;
17+
~~~
18+
19+
### 示例 {#example}
20+
21+
~~~jsx {3}
22+
// 初始化 RichText
23+
new richtext.Richtext("#root", {
24+
menubar: true
25+
// 其他配置属性
26+
});
27+
~~~
28+
29+
**更新日志:** 该属性在 v2.0 中新增
30+
31+
**相关文章:** [配置](guides/configuration.md)
32+
33+
**相关示例:** [RichText. 带菜单栏的初始化](https://snippet.dhtmlx.com/tjryzka7?tag=richtext)

0 commit comments

Comments
 (0)