Skip to content
Merged
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
11 changes: 6 additions & 5 deletions packages/block-editor/src/components/block-mover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ToolbarGroup, ToolbarItem, Button } from '@wordpress/components';
import { getBlockType } from '@wordpress/blocks';
import { useState } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import { _n } from '@wordpress/i18n';

/**
* Internal dependencies
Expand All @@ -40,9 +40,6 @@ function BlockMover( {
return null;
}

const label =
clientIds.length === 1 ? __( 'Drag Block' ) : __( 'Drag Blocks' );

// We emulate a disabled state because forcefully applying the `disabled`
// attribute on the buttons while it has focus causes the screen to change
// to an unfocused state (body as active element) without firing blur on,
Expand All @@ -64,7 +61,11 @@ function BlockMover( {
icon={ dragHandle }
className="block-editor-block-mover__drag-handle"
aria-hidden="true"
label={ label }
label={ _n(
'Drag block',
'Drag blocks',
clientIds.length
) }
// Should not be able to tab to drag handle as this
// button can only be used with a pointer device.
tabIndex="-1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ export function BlockSettingsDropdown( {
shortcut={ shortcuts.remove }
>
{ _n(
'Remove Block',
'Remove Blocks',
'Remove block',
'Remove blocks',
count
) }
</MenuItem>
Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/specs/editor/plugins/cpt-locking.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe( 'cpt locking', () => {
);
await clickBlockToolbarButton( 'More options' );
expect(
await page.$x( '//button[contains(text(), "Remove Block")]' )
await page.$x( '//button[contains(text(), "Remove block")]' )
).toHaveLength( 0 );
};

Expand Down Expand Up @@ -172,7 +172,7 @@ describe( 'cpt locking', () => {
);
await clickBlockToolbarButton( 'More options' );
const [ removeBlock ] = await page.$x(
'//button[contains(text(), "Remove Block")]'
'//button[contains(text(), "Remove block")]'
);
await removeBlock.click();
expect( await getEditedPostContent() ).toMatchSnapshot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const clickOnBlockSettingsMenuRemoveBlockButton = async () => {
await page.keyboard.press( 'Tab' );

isRemoveButton = await page.evaluate( () => {
return document.activeElement.innerText.includes( 'Remove Block' );
return document.activeElement.innerText.includes( 'Remove block' );
} );

// Stop looping once we find the button
Expand Down