From 61f7d059dbd2a47f9954cea81d895d1c5ec10966 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Thu, 25 Jan 2024 16:58:41 +0400 Subject: [PATCH] Block Switcher: Use consistent labels (#58240) --- .../src/components/block-switcher/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/block-editor/src/components/block-switcher/index.js b/packages/block-editor/src/components/block-switcher/index.js index f3f976262ea588..f73a5de543bd4a 100644 --- a/packages/block-editor/src/components/block-switcher/index.js +++ b/packages/block-editor/src/components/block-switcher/index.js @@ -218,14 +218,20 @@ export const BlockSwitcher = ( { clientIds } ) => { if ( invalidBlocks ) { return null; } + + const isSingleBlock = clientIds.length === 1; + const blockSwitcherLabel = isSingleBlock + ? blockTitle + : __( 'Multiple blocks selected' ); const hideDropdown = ! hasBlockStyles && ! canRemove; + if ( hideDropdown ) { return ( @@ -240,10 +246,7 @@ export const BlockSwitcher = ( { clientIds } ) => { ); } - const isSingleBlock = clientIds.length === 1; - const blockSwitcherLabel = isSingleBlock - ? blockTitle - : __( 'Multiple blocks selected' ); + const blockSwitcherDescription = isSingleBlock ? __( 'Change block type or style' ) : sprintf(