Skip to content

Commit

Permalink
Provide Nav block specific button label
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Jan 12, 2023
1 parent fa447b9 commit 2b2bd76
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { __, sprintf } from '@wordpress/i18n';
* Internal dependencies
*/
import { store as blockEditorStore } from '../../store';
import useBlockDisplayTitle from '../block-title/use-block-display-title';
import Inserter from '../inserter';

export const Appender = forwardRef(
Expand All @@ -32,14 +33,20 @@ export const Appender = forwardRef(
};
}, [] );

const blockTitle = useBlockDisplayTitle( {
clientId,
context: 'list-view',
} );

if ( hideInserter ) {
return null;
}

const descriptionId = `off-canvas-editor-appender__${ instanceId }`;
const description = sprintf(
/* translators: 1: The numerical position of the block. 2: The level of nesting for the block. */
__( 'Append at position %1$d, Level %2$d' ),
/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */
__( 'Append to %1$s block at position %2$d, Level %3$d' ),
blockTitle,
blockCount + 1,
nestingLevel
);
Expand Down

0 comments on commit 2b2bd76

Please sign in to comment.