Skip to main content

locale

Description

Optional. An object that includes localization labels of RichText

info

The locale object needs to include all labels of RichText with the corresponding translations.

Usage

locale?: object;

Default config

By default, RichText uses the English locale. You can set it to the custom locale as well.

tip

To change the current locale dynamically, you can use the setLocale() method of RichText

Example

// initialize RichText
const editor = new richtext.RichText("#root", {
locale: richtext.locales.cn // the Chineese locale will be set initially
// locale: richtext.locales.en // the English locale will be set initially
// locale: richtext.locales.de // the Germany locale will be set initially
// other configuration properties
});

Change log: The property was added in v2.0

Related articles: Localization

Related sample: RichText. Localization