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 | undefinedmodule:core/editor/editorconfig~LanguageConfig#contentAllows to use a different language of the editor content.
The language codes are defined in the ISO 639-1 standard.
-
textPartLanguage : Array<TextPartLanguageOption> | undefinedmodule:core/editor/editorconfig~LanguageConfig#textPartLanguageThe available
TextPartLanguageoptions 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' } ];Copy codeThe
titleproperty will be used by the text part language dropdown to render available options.The
languageCodeproperty is used for thelangattribute in the ISO 639-1 format.You can also specify the optional
textDirectionproperty indicating the reading direction of the language. Correct values areltrandrtl. When thetextDirectionproperty is missing, the text part language feature will specify the text direction by itself. -
ui : string | undefinedmodule:core/editor/editorconfig~LanguageConfig#uiAllows to use a different language for the editor UI.
The language codes are defined in the ISO 639-1 standard.