File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -377,16 +377,31 @@ const ToggleBlockDialog = ( {
377377 onConfirm,
378378 onCancel,
379379} ) => {
380+ const DERIVED_BLOCKS = getAllBlocks ( )
381+
382+ const getBlockTitle = name => {
383+ for ( const category in DERIVED_BLOCKS ) {
384+ for ( const block of DERIVED_BLOCKS [ category ] ) {
385+ if ( block . name === name ) {
386+ return block . title
387+ }
388+ }
389+ }
390+ return name
391+ }
392+
393+ const blockTitle = getBlockTitle ( blockName )
394+
380395 return (
381396 < div className = "s-toggle-block-dialog" >
382397 < div className = "s-toggle-block-dialog-content" >
383398 { isDisabled
384- ? < p > { __ ( 'Disabling ' + blockName + ' will also disable the blocks that require it:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
385- : < p > { __ ( 'Enabling ' + blockName + ' will also enable its required innerblocks:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
399+ ? < p > { __ ( 'Disabling ' + blockTitle + ' will also disable the blocks that require it:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
400+ : < p > { __ ( 'Enabling ' + blockTitle + ' will also enable its required innerblocks:' , i18n ) } </ p > // eslint-disable-line @wordpress/i18n-no-variables
386401 }
387402 < ul >
388403 { blockList . map ( ( block , i ) => (
389- < li key = { i } > { block } </ li >
404+ < li key = { i } > { getBlockTitle ( block ) } </ li >
390405 ) ) }
391406 </ ul >
392407 { isDisabled
You can’t perform that action at this time.
0 commit comments