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

Dropped the editor content dir="auto" support.

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

+ 6 - 4
packages/ckeditor5-utils/src/locale.js

@@ -46,7 +46,7 @@ export default class Locale {
 		this.contentLanguage = contentLanguage || this.language;
 
 		/**
-		 * Text direction of the {@link #language editor language}. Either `'ltr'` or `'rtl'`.
+		 * Text direction of the {@link #language editor UI language}. Either `'ltr'` or `'rtl'`.
 		 *
 		 * @readonly
 		 * @member {String}
@@ -57,15 +57,17 @@ export default class Locale {
 		 * Text direction of the {@link #contentLanguage editor content language}.
 		 *
 		 * If the content language was passed directly to the `Locale` constructor, this property represents the
-		 * direction of that language (either `'ltr'` or `'rtl'`).
+		 * direction of that language.
 		 *
 		 * If the {@link #contentLanguage editor content language} was derived from the {@link #language editor language},
-		 * the content language direction is set to `'auto'`.
+		 * the content language direction is the same as the {@link #languageDirection UI language direction}.
+		 *
+		 * The value is either `'ltr'` or `'rtl'`.
 		 *
 		 * @readonly
 		 * @member {String}
 		 */
-		this.contentLanguageDirection = contentLanguage ? getLanguageDirection( contentLanguage ) : 'auto';
+		this.contentLanguageDirection = getLanguageDirection( this.contentLanguage );
 
 		/**
 		 * Translates the given string to the {@link #language}. This method is also available in {@link module:core/editor/editor~Editor#t}

+ 3 - 3
packages/ckeditor5-utils/tests/locale.js

@@ -51,9 +51,9 @@ describe( 'Locale', () => {
 		} );
 
 		it( 'determines the #contentLanguageDirection (not passed)', () => {
-			expect( new Locale( 'pl' ) ).to.have.property( 'contentLanguageDirection', 'auto' );
-			expect( new Locale( 'en' ) ).to.have.property( 'contentLanguageDirection', 'auto' );
-			expect( new Locale( 'ar' ) ).to.have.property( 'contentLanguageDirection', 'auto' );
+			expect( new Locale( 'pl' ) ).to.have.property( 'contentLanguageDirection', 'ltr' );
+			expect( new Locale( 'en' ) ).to.have.property( 'contentLanguageDirection', 'ltr' );
+			expect( new Locale( 'ar' ) ).to.have.property( 'contentLanguageDirection', 'rtl' );
 		} );
 
 		it( 'determines the #contentLanguageDirection (passed)', () => {