Skip to content

Commit dea2f9e

Browse files
Update configs
1 parent 1bf2916 commit dea2f9e

8 files changed

Lines changed: 71 additions & 20 deletions

File tree

docs/api/config/default-styles.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ const defaultStyles = {
117117

118118
### Example
119119

120-
~~~jsx {2-12}
120+
~~~jsx {3-13}
121+
// initialize RichText
121122
new richtext.Richtext("#root", {
122123
defaultStyles: {
123124
h4: {

docs/api/config/fullscreen.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the fullscreen config in the documentation of t
88

99
### Description
1010

11-
@short: Optional. Enables the editor fullscreen mode
11+
@short: Optional. Enables the RichText fullscreen mode
1212

1313
### Usage
1414

@@ -19,12 +19,13 @@ fullscreen?: boolean;
1919
### Default config
2020

2121
~~~jsx
22-
fullscreen: false
22+
fullscreen: false;
2323
~~~
2424

2525
### Example
2626

27-
~~~jsx {2}
27+
~~~jsx {3}
28+
// initialize RichText
2829
new richtext.Richtext("#root", {
2930
fullscreen: true
3031
// other parameters

docs/api/config/image-upload-url.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ imageUploadUrl?: string;
1818

1919
### Example
2020

21-
~~~jsx {2}
21+
~~~jsx {3}
22+
// initialize RichText
2223
new richtext.Richtext("#root", {
2324
imageUploadUrl: "some URL"
2425
// other parameters

docs/api/config/layout-mode.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ The `"classic"` mode represents the edit area that fits the entire page. The `"d
2121
### Default config
2222

2323
~~~jsx
24-
layoutMode: "classic"
24+
layoutMode: "classic";
2525
~~~
2626

2727
### Example
2828

29-
~~~jsx {2}
29+
~~~jsx {3}
30+
// initialize RichText
3031
new richtext.Richtext("#root", {
31-
layoutMode: "document" // initializes richtext with "document" mode by default
32+
layoutMode: "document" // initializes RichText with "document" mode by default
3233
// other parameters
3334
});
3435
~~~
3536

3637
**Change log:** The property was added in v2.0 instead of the deprecated `mode` property
3738

38-
**Related articles:** [Configuration](../../../guides/configuration)
39+
**Related articles:** [Configuration](guides/configuration.md)
3940

4041
**Related sample:** [RichText. Initialization](https://snippet.dhtmlx.com/t55alxiy)

docs/api/config/locale.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
sidebar_label: locale
3+
title: locale Config
4+
description: You can learn about the locale config in the documentation of the DHTMLX JavaScript RichText library. Browse developer guides and API reference, try out code examples and live demos, and download a free 30-day evaluation version of DHTMLX RichText.
5+
---
6+
7+
# locale
8+
9+
### Description
10+
11+
@short: Optional. An object that includes localization labels of RichText
12+
13+
:::info
14+
The **locale** object needs to include all labels of RichText with the corresponding translations.
15+
:::
16+
17+
### Usage
18+
19+
~~~jsx {}
20+
locale?: object;
21+
~~~
22+
23+
### Default config
24+
25+
By default, RichText uses the **English** locale. You can set it to the custom locale as well.
26+
27+
:::tip
28+
To change the current locale dynamically, you can use the [**setLocale()**](methods/set-locale.md) method of RichText
29+
:::
30+
31+
### Example
32+
33+
~~~jsx {3}
34+
// initialize RichText
35+
const editor = new richtext.RichText("#root", {
36+
locale: richtext.locale.cn // the Chineese locale will be set initially
37+
// locale: richtext.locale.en // the English locale will be set initially
38+
// locale: richtext.locale.de // the Germany locale will be set initially
39+
// other parameters
40+
});
41+
~~~
42+
43+
**Related articles:** [Localization](guides/localization.md)
44+
45+
**Related sample:** [RichText. Localization](https://snippet.dhtmlx.com/zxjrin3i)

docs/api/config/menubar.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the menubar config in the documentation of the
88

99
### Description
1010

11-
@short: Optional. Enables the top menubar
11+
@short: Optional. Enables the top menubar of RichText
1212

1313
### Usage
1414

@@ -18,7 +18,8 @@ menubar?: boolean;
1818

1919
### Example
2020

21-
~~~jsx {2}
21+
~~~jsx {3}
22+
// initialize RichText
2223
new richtext.Richtext("#root", {
2324
menubar: true
2425
// other parameters

docs/api/config/toolbar.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description: You can learn about the toolbar config in the documentation of the
88

99
### Description
1010

11-
@short: Optional. Shows or hides Toolbar and specifies buttons visible within Toolbar
11+
@short: Optional. Enables toolbar and specifies buttons displayed within Toolbar
1212

1313
### Usage
1414

@@ -18,7 +18,7 @@ toolbar?: boolean | Array<string | { id: string, type: string, label?: string, t
1818

1919
#### Available buttons within Toolbar
2020

21-
You can specify the following buttons in the Richtext Toolbar:
21+
You can specify the following buttons in the RichText toolbar:
2222

2323
| Button | Description |
2424
|---------------------|-----------------------------------------------------------------------------|
@@ -50,9 +50,9 @@ You can specify the following buttons in the Richtext Toolbar:
5050
| `fullscreen` | Toggles fullscreen mode. |
5151
| `mode` | Switches between different view modes (e.g., visual, HTML, Markdown). |
5252
| `shortcuts` | Displays a list of available keyboard shortcuts. |
53-
| `separator` | Adds a visual separator between Toolbar groups. |
53+
| `separator` | Adds a visual separator between toolbar groups. |
5454

55-
You can use this strings to configure Toolbar buttons as follow:
55+
You can use this strings to configure toolbar buttons as follow:
5656

5757
~~~jsx {2-7}
5858
new richtext.Richtext("#root", {
@@ -77,7 +77,7 @@ You can specify custom buttons as objects with the following parameters:
7777
- `css` - (optional) a css class name assigned to the control (default supported classes: wx-primary, wx-secondary)
7878
- `handler` - (optional) a callback function that executes when the button is clicked
7979

80-
You can specify custom buttons within a Toolbar as follow:
80+
You can specify custom buttons within a toolbar as follow:
8181

8282
~~~jsx {6-14}
8383
new richtext.Richtext("#root", {
@@ -102,7 +102,7 @@ new richtext.Richtext("#root", {
102102

103103
#### Hide Toolbar
104104

105-
If you need to hide Toolbar, set the `toolbar` property to `false` as follows:
105+
If you need to hide toolbar, set the `toolbar` property to `false` as follows:
106106

107107
~~~jsx {2}
108108
new richtext.Richtext("#root", {
@@ -152,7 +152,8 @@ const defaultToolbarButtons = {
152152

153153
### Example
154154

155-
~~~jsx {4}
155+
~~~jsx {3-18}
156+
// initialize RichText
156157
new richtext.Richtext("#root", {
157158
toolbar: [
158159
"bold",

docs/api/config/value.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ description: You can learn about the value config in the documentation of the DH
88

99
### Description
1010

11-
@short: Optional. Specifies the initial value (content) displayed within the editor area using the HTML format (default format)
11+
@short: Optional. Specifies the initial value (content) displayed within the editor area of RichText
1212

1313
:::tip
14-
If you want to set the value (content) using another format, use the built-in [`setValue()`](api/methods/set-value.md) method.
14+
If you want to set the value (content) using custom format, use the built-in [`setValue()`](api/methods/set-value.md) method.
1515
:::
1616

1717
### Usage

0 commit comments

Comments
 (0)