Aleksander Nowodzinski пре 6 година
родитељ
комит
1363fe1fa6

+ 1 - 1
packages/ckeditor5-core/src/editor/editor.js

@@ -95,7 +95,7 @@ export default class Editor {
 		 * @readonly
 		 * @member {module:utils/locale~Locale}
 		 */
-		this.locale = new Locale( this.config.get( 'language' ) );
+		this.locale = new Locale( this.config.get( 'language' ), this.config.get( 'contentLanguage' ) );
 
 		/**
 		 * Shorthand for {@link module:utils/locale~Locale#t}.

+ 28 - 0
packages/ckeditor5-core/src/editor/editorconfig.jsdoc

@@ -195,9 +195,37 @@
  *
  * Check the {@glink features/ui-language UI language guide} for more information about the localization options and translation process.
  *
+ * TODO: What's the difference between #language and #contentLanguage? Also link to #contentLanguage.
+ *
  * @member {String} module:core/editor/editorconfig~EditorConfig#language
  */
 
+/**
+ * The editor content language.
+ *
+ * The language code is defined in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) standard.
+ *
+ * TODO: What is this setting and what's the difference between #language and #contentLanguage?  Also link to #language.
+ *
+ * Simple usage:
+ *
+ *		ClassicEditor
+ *			.create( document.querySelector( '#editor' ), {
+ *				language: 'de',
+ *				contentLanguage: 'ar'
+ *			} )
+ *			.then( editor => {
+ *				console.log( editor );
+ *			} )
+ *			.catch( error => {
+ *				console.error( error );
+ *			} );
+ *
+ * Check the {@glink features/ui-language UI language guide} for more information about the localization options and translation process.
+ *
+ * @member {String} module:core/editor/editorconfig~EditorConfig#contentLanguage
+ */
+
 /**
  * Specifies the text displayed in the editor when there is no content (editor is empty). It is intended to
  * help users locate the editor in the application (form) and prompt them to input the content. Work similarly