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

Fix i18n issues in the image-editor component. #48196

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { check, aspectRatio as aspectRatioIcon } from '@wordpress/icons';
import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -39,7 +39,7 @@ export default function AspectRatioDropdown( { toggleProps } ) {
return (
<DropdownMenu
icon={ aspectRatioIcon }
label={ __( 'Aspect Ratio' ) }
label={ __( 'Aspect ratio' ) }
popoverProps={ POPOVER_PROPS }
toggleProps={ toggleProps }
className="wp-block-image__aspect-ratio"
Expand All @@ -56,11 +56,11 @@ export default function AspectRatioDropdown( { toggleProps } ) {
aspectRatios={ [
// All ratios should be mirrored in PostFeaturedImage in @wordpress/block-library
{
title: __( 'Original' ),
title: _x( 'Original', 'aspect ratio' ),
aspect: defaultAspect,
},
{
title: __( 'Square' ),
title: _x( 'Square', 'aspect ratio' ),
aspect: 1,
},
] }
Expand All @@ -75,19 +75,19 @@ export default function AspectRatioDropdown( { toggleProps } ) {
value={ aspect }
aspectRatios={ [
{
title: __( '16:10' ),
title: _x( '16:10', 'aspect ratio' ),
aspect: 16 / 10,
},
{
title: __( '16:9' ),
title: _x( '16:9', 'aspect ratio' ),
aspect: 16 / 9,
},
{
title: __( '4:3' ),
title: _x( '4:3', 'aspect ratio' ),
aspect: 4 / 3,
},
{
title: __( '3:2' ),
title: _x( '3:2', 'aspect ratio' ),
aspect: 3 / 2,
},
] }
Expand All @@ -102,19 +102,19 @@ export default function AspectRatioDropdown( { toggleProps } ) {
value={ aspect }
aspectRatios={ [
{
title: __( '10:16' ),
title: _x( '10:16', 'aspect ratio' ),
aspect: 10 / 16,
},
{
title: __( '9:16' ),
title: _x( '9:16', 'aspect ratio' ),
aspect: 9 / 16,
},
{
title: __( '3:4' ),
title: _x( '3:4', 'aspect ratio' ),
aspect: 3 / 4,
},
{
title: __( '2:3' ),
title: _x( '2:3', 'aspect ratio' ),
aspect: 2 / 3,
},
] }
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/blocks/image.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ test.describe( 'Image', () => {

// Zoom in to twice the amount using the zoom input.
await editor.clickBlockToolbarButton( 'Crop' );
await editor.clickBlockToolbarButton( 'Aspect Ratio' );
await editor.clickBlockToolbarButton( 'Aspect ratio' );
await page.click(
'role=menu[name="Aspect Ratio"i] >> role=menuitemradio[name="16:10"i]'
'role=menu[name="Aspect ratio"i] >> role=menuitemradio[name="16:10"i]'
);
await editor.clickBlockToolbarButton( 'Apply' );

Expand Down