LanguageConfig
The configuration of the editor language.
ClassicEditor
.create( document.querySelector( '#editor' ), {
language: ... // The editor language configuration.
} )
.then( editor => {
console.log( editor );
} )
.catch( error => {
console.error( error );
} );
See all editor options.
Properties
-
content : string | undefined
module:core/editor/editorconfig~LanguageConfig#content
Allows to use a different language of the editor content.
The language codes are defined in the ISO 639-1 standard.
-
textPartLanguage : Array<TextPartLanguageOption> | undefined
module:core/editor/editorconfig~LanguageConfig#textPartLanguage
The available
TextPartLanguage
options that allow setting the language of parts of the content.This configuration option is available only with the text part language feature enabled.
Refer to the WCAG 3.1.2 Language of Parts specification to learn more.
To change the editor's UI language, refer to the Setting the UI language guide.
The default value is:
const config = [ { title: 'Arabic', languageCode: 'ar' }, { title: 'French', languageCode: 'fr' }, { title: 'Spanish', languageCode: 'es' } ];
The
title
property will be used by the text part language dropdown to render available options.The
languageCode
property is used for thelang
attribute in the ISO 639-1 format.You can also specify the optional
textDirection
property indicating the reading direction of the language. Correct values areltr
andrtl
. When thetextDirection
property is missing, the text part language feature will specify the text direction by itself. -
ui : string | undefined
module:core/editor/editorconfig~LanguageConfig#ui
Allows to use a different language for the editor UI.
The language codes are defined in the ISO 639-1 standard.