@@ -682,6 +682,7 @@ export default class TableCellPropertiesView extends View {
682
682
// -- Horizontal ---------------------------------------------------
683
683
684
684
const horizontalAlignmentToolbar = new ToolbarView ( locale ) ;
685
+ const isContentRTL = this . locale . contentLanguageDirection === 'rtl' ;
685
686
686
687
horizontalAlignmentToolbar . set ( {
687
688
isCompact : true ,
@@ -695,7 +696,7 @@ export default class TableCellPropertiesView extends View {
695
696
labels : this . _horizontalAlignmentLabels ,
696
697
propertyName : 'horizontalAlignment' ,
697
698
nameToValue : name => {
698
- return name === ' left' ? '' : name ;
699
+ return name === ( isContentRTL ? 'right' : ' left' ) ? '' : name ;
699
700
}
700
701
} ) ;
701
702
@@ -781,14 +782,20 @@ export default class TableCellPropertiesView extends View {
781
782
* @type {Object.<String,String> }
782
783
*/
783
784
get _horizontalAlignmentLabels ( ) {
785
+ const locale = this . locale ;
784
786
const t = this . t ;
785
787
786
- return {
787
- left : t ( 'Align cell text to the left' ) ,
788
- center : t ( 'Align cell text to the center' ) ,
789
- right : t ( 'Align cell text to the right' ) ,
790
- justify : t ( 'Justify cell text' )
791
- } ;
788
+ const left = t ( 'Align cell text to the left' ) ;
789
+ const center = t ( 'Align cell text to the center' ) ;
790
+ const right = t ( 'Align cell text to the right' ) ;
791
+ const justify = t ( 'Justify cell text' ) ;
792
+
793
+ // Returns object with a proper order of labels.
794
+ if ( locale . uiLanguageDirection === 'rtl' ) {
795
+ return { right, center, left, justify } ;
796
+ } else {
797
+ return { left, center, right, justify } ;
798
+ }
792
799
}
793
800
794
801
/**
0 commit comments