This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-4
lines changed
Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export default class Editor {
6363 * @readonly
6464 * @member {module:utils/locale~Locale}
6565 */
66- this . locale = new Locale ( this . config . get ( 'lang ' ) ) ;
66+ this . locale = new Locale ( this . config . get ( 'language ' ) ) ;
6767
6868 /**
6969 * Shorthand for {@link module:utils/locale~Locale#t}.
Original file line number Diff line number Diff line change 106106 *
107107 * @member {Array.<String>|Object} module:core/editor/editorconfig~EditorConfig#toolbar
108108 */
109+
110+ /**
111+ * Editor UI's language.
112+ *
113+ * The language code is defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
114+ * CKEditor 5 currently supports around 20 languages and the number is growing.
115+ *
116+ * Note: You don't have to specify this option if your build is optimized for one language or if it's the default language
117+ * (English is the default language for CDN builds).
118+ *
119+ * Simple usage:
120+ *
121+ * ClassicEditor
122+ * .create( document.querySelector( '#editor' ), {
123+ * language: 'de'
124+ * } )
125+ * .then( editor => {
126+ * console.log( editor );
127+ * } )
128+ * .catch( error => {
129+ * console.error( error );
130+ * } );
131+ *
132+ * After this step you need to attach the corresponding translation file. Translation files are available at CDN for predefined builds:
133+ * `<script src="https://cdn.ckeditor.com/ckeditor5/[version.number]/[distribution]/lang/[lang].js"></script>`
134+ *
135+ * But you can add them manually by coping from the `node_modules/@ckeditor/ckeditor5-build-[name]/build/lang/[lang].js'`.
136+ *
137+ * Check the {@glink features/ui-language UI language guide} for more information about the localization options and translation process.
138+ *
139+ * @member {String} module:core/editor/editorconfig~EditorConfig#language
140+ */
Original file line number Diff line number Diff line change @@ -151,10 +151,10 @@ describe( 'Editor', () => {
151151 expect ( editor . t ) . to . equal ( editor . locale . t ) ;
152152 } ) ;
153153
154- it ( 'is configured with the config.lang ' , ( ) => {
155- const editor = new Editor ( { lang : 'pl' } ) ;
154+ it ( 'is configured with the config.language ' , ( ) => {
155+ const editor = new Editor ( { language : 'pl' } ) ;
156156
157- expect ( editor . locale . lang ) . to . equal ( 'pl' ) ;
157+ expect ( editor . locale . language ) . to . equal ( 'pl' ) ;
158158 } ) ;
159159 } ) ;
160160
You can’t perform that action at this time.
0 commit comments