8
0
Просмотр исходного кода

Aligned the code to the latest Locale class API.

Aleksander Nowodzinski 6 лет назад
Родитель
Сommit
fb1229c408

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

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

+ 2 - 2
packages/ckeditor5-core/tests/editor/editor.js

@@ -196,14 +196,14 @@ describe( 'Editor', () => {
 		it( 'is configured with the config.language', () => {
 			const editor = new TestEditor( { language: 'pl' } );
 
-			expect( editor.locale.language ).to.equal( 'pl' );
+			expect( editor.locale.uiLanguage ).to.equal( 'pl' );
 			expect( editor.locale.contentLanguage ).to.equal( 'pl' );
 		} );
 
 		it( 'is configured with the config.contentLanguage', () => {
 			const editor = new TestEditor( { language: 'pl', contentLanguage: 'ar' } );
 
-			expect( editor.locale.language ).to.equal( 'pl' );
+			expect( editor.locale.uiLanguage ).to.equal( 'pl' );
 			expect( editor.locale.contentLanguage ).to.equal( 'ar' );
 		} );
 	} );