Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlignmentMatrixControl: keep the physical direction in RTL languages #43126

Merged
merged 9 commits into from
Aug 26, 2022
14 changes: 7 additions & 7 deletions packages/components/src/alignment-matrix-control/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, isRTL } from '@wordpress/i18n';

export const GRID = [
[ 'top left', 'top center', 'top right' ],
Expand All @@ -11,15 +11,15 @@ export const GRID = [

// Stored as map as i18n __() only accepts strings (not variables)
export const ALIGNMENT_LABEL = {
'top left': __( 'Top Left' ),
'top left': ! isRTL() ? __( 'Top Left' ) : __( 'Top Right' ),
mirka marked this conversation as resolved.
Show resolved Hide resolved
'top center': __( 'Top Center' ),
'top right': __( 'Top Right' ),
'center left': __( 'Center Left' ),
'top right': ! isRTL() ? __( 'Top Right' ) : __( 'Top Left' ),
'center left': ! isRTL() ? __( 'Center Left' ) : __( 'Center Right' ),
'center center': __( 'Center Center' ),
'center right': __( 'Center Right' ),
'bottom left': __( 'Bottom Left' ),
'center right': ! isRTL() ? __( 'Center Right' ) : __( 'Center Left' ),
'bottom left': ! isRTL() ? __( 'Bottom Left' ) : __( 'Bottom Right' ),
'bottom center': __( 'Bottom Center' ),
'bottom right': __( 'Bottom Right' ),
'bottom right': ! isRTL() ? __( 'Bottom Right' ) : __( 'Bottom Left' ),
};

// Transforms GRID into a flat Array of values.
Expand Down