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 incorrectly pluralised strings #26565

Merged
merged 2 commits into from
Oct 29, 2020
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: 5 additions & 6 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 { _n } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';

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

const dragHandleLabel =
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 @@ -61,11 +64,7 @@ function BlockMover( {
icon={ dragHandle }
className="block-editor-block-mover__drag-handle"
aria-hidden="true"
label={ _n(
'Drag block',
'Drag blocks',
clientIds.length
) }
label={ dragHandleLabel }
// 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 @@ -6,7 +6,7 @@ import { castArray, flow, noop } from 'lodash';
/**
* WordPress dependencies
*/
import { __, _n } from '@wordpress/i18n';
import { __ } from '@wordpress/i18n';
import {
DropdownMenu,
MenuGroup,
Expand Down Expand Up @@ -74,6 +74,9 @@ export function BlockSettingsDropdown( {
[ __experimentalSelectBlock ]
);

const removeBlockLabel =
count === 1 ? __( 'Remove block' ) : __( 'Remove blocks' );

return (
<BlockActions
clientIds={ clientIds }
Expand Down Expand Up @@ -185,11 +188,7 @@ export function BlockSettingsDropdown( {
) }
shortcut={ shortcuts.remove }
>
{ _n(
'Remove block',
'Remove blocks',
count
) }
{ removeBlockLabel }
</MenuItem>
) }
</MenuGroup>
Expand Down