Skip to content

Commit

Permalink
End with period. Speak singular or plural
Browse files Browse the repository at this point in the history
  • Loading branch information
n2erjo00 committed Oct 29, 2024
1 parent e079648 commit 0556d58
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/block-editor/src/components/block-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordp
import { useRef } from '@wordpress/element';
import { switchToBlockType, store as blocksStore } from '@wordpress/blocks';
import { speak } from '@wordpress/a11y';
import { __ } from '@wordpress/i18n';
import { __, sprintf, _n } from '@wordpress/i18n';

/**
* Internal dependencies
Expand Down Expand Up @@ -108,7 +108,15 @@ export default function BlockTools( {
} else {
moveBlocksDown( clientIds, rootClientId );
}
speak( __( 'Block moved' ) );
const blockLength = Array.isArray( clientIds )
? clientIds.length
: 1;
const message = sprintf(
// translators: %s: term "block" in either singular or plural form.
_n( '%s moved.', '%s moved.', blockLength ),
blockLength > 1 ? __( 'Blocks' ) : __( 'Block' )
);
speak( message );
}
} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {
const clientIds = getSelectedBlockClientIds();
Expand Down

0 comments on commit 0556d58

Please sign in to comment.