Skip to content

Commit

Permalink
Update navigation title rendering to include block title and decode H…
Browse files Browse the repository at this point in the history
…TML entities
  • Loading branch information
yogeshbhutkar committed Jan 9, 2025
1 parent 9e5240d commit 453a690
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-library/src/navigation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { __, sprintf } from '@wordpress/i18n';
import { navigation as icon } from '@wordpress/icons';
import { select } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';

/**
* Internal dependencies
Expand Down Expand Up @@ -67,9 +68,10 @@ export const settings = {

return navigation?.title?.rendered
? sprintf(
/* translators: %s: menu title */
__( 'Navigation (%s)' ),
navigation.title.rendered
/* translators: %1$s: block title, %2$s: navigation menu title */
__( '%1$s (%2$s)' ),
metadata.title,
decodeEntities( navigation.title.rendered )
)
: __( 'Navigation' );
},
Expand Down

0 comments on commit 453a690

Please sign in to comment.