Skip to content

Commit

Permalink
Update standardisation of 'Navigation Menu' to have both words capita…
Browse files Browse the repository at this point in the history
…lised in user-facing menus (WordPress#60262)

* Update standardisation of 'Navigation Menu' to have both words capitilised in user-facing labels

* Fix capitalization of "Navigation Menus" in tests

Co-authored-by: xhemals <xhemals@git.wordpress.org>
Co-authored-by: c4rl0sbr4v0 <cbravobernal@git.wordpress.org>
  • Loading branch information
3 people committed Apr 9, 2024
1 parent 303f0d1 commit 95fda45
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
Expand Up @@ -12,7 +12,7 @@ import AccessibleDescription from './accessible-description';
export default function AccessibleMenuDescription( { id } ) {
const [ menuTitle ] = useEntityProp( 'postType', 'wp_navigation', 'title' );
/* translators: %s: Title of a Navigation Menu post. */
const description = sprintf( __( `Navigation menu: "%s"` ), menuTitle );
const description = sprintf( __( `Navigation Menu: "%s"` ), menuTitle );

return (
<AccessibleDescription id={ id }>{ description }</AccessibleDescription>
Expand Down
Expand Up @@ -11,7 +11,7 @@ function DeletedNavigationWarning( { onCreateNew } ) {
<Warning>
{ createInterpolateElement(
__(
'Navigation menu has been deleted or is unavailable. <button>Create a new menu?</button>'
'Navigation Menu has been deleted or is unavailable. <button>Create a new menu?</button>'
),
{
button: <Button onClick={ onCreateNew } variant="link" />,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/edit/index.js
Expand Up @@ -847,7 +847,7 @@ function Navigation( {
replaceInnerBlocks( clientId, [] );
showNavigationMenuStatusNotice(
__(
'Navigation menu successfully deleted.'
'Navigation Menu successfully deleted.'
)
);
} }
Expand Down
Expand Up @@ -102,7 +102,7 @@ const MainContent = ( {
const description = navigationMenu
? sprintf(
/* translators: %s: The name of a menu. */
__( 'Structure for navigation menu: %s' ),
__( 'Structure for Navigation Menu: %s' ),
navigationMenu?.title || __( 'Untitled menu' )
)
: __(
Expand All @@ -113,7 +113,7 @@ const MainContent = ( {
<div className="wp-block-navigation__menu-inspector-controls">
{ ! hasChildren && (
<p className="wp-block-navigation__menu-inspector-controls__empty-message">
{ __( 'This navigation menu is empty.' ) }
{ __( 'This Navigation Menu is empty.' ) }
</p>
) }
<PrivateListView
Expand Down
Expand Up @@ -43,7 +43,7 @@ export default function NavigationMenuDeleteControl( { onDelete } ) {
confirmButtonText={ __( 'Delete' ) }
>
{ __(
'Are you sure you want to delete this Navigation menu?'
'Are you sure you want to delete this Navigation Menu?'
) }
</ConfirmDialog>
) }
Expand Down
Expand Up @@ -113,7 +113,7 @@ function NavigationMenuSelector( {
selectorLabel = __( 'Loading…' );
} else if ( noMenuSelected || noBlockMenus || menuUnavailable ) {
// Note: classic Menus may be available.
selectorLabel = __( 'Choose or create a Navigation menu' );
selectorLabel = __( 'Choose or create a Navigation Menu' );
} else {
// Current Menu's title.
selectorLabel = currentTitle;
Expand Down
Expand Up @@ -89,7 +89,7 @@ describe( 'NavigationMenuSelector', () => {
).toBeInTheDocument();
} );

it( 'should show correct dropdown toggle prompt to choose a menu when navigation menus have resolved', async () => {
it( 'should show correct dropdown toggle prompt to choose a menu when Navigation Menus have resolved', async () => {
useNavigationMenu.mockReturnValue( {
navigationMenus: [],
hasResolvedNavigationMenus: true,
Expand All @@ -101,7 +101,7 @@ describe( 'NavigationMenuSelector', () => {

expect(
screen.getByRole( 'button', {
name: 'Choose or create a Navigation menu',
name: 'Choose or create a Navigation Menu',
} )
).toBeInTheDocument();
} );
Expand Down Expand Up @@ -159,7 +159,7 @@ describe( 'NavigationMenuSelector', () => {
render( <NavigationMenuSelector /> );

const toggleButton = screen.getByRole( 'button', {
name: 'Choose or create a Navigation menu',
name: 'Choose or create a Navigation Menu',
} );

await user.click( toggleButton );
Expand All @@ -169,7 +169,7 @@ describe( 'NavigationMenuSelector', () => {
expect( menuPopover ).toHaveAttribute(
'aria-label',
expect.stringContaining(
'Choose or create a Navigation menu'
'Choose or create a Navigation Menu'
)
);

Expand Down Expand Up @@ -324,7 +324,7 @@ describe( 'NavigationMenuSelector', () => {
} );
} );

describe( 'Navigation menus', () => {
describe( 'Navigation Menus', () => {
it( 'should not show a list of menus when menus exist but user does not have permission to switch menus', async () => {
const user = userEvent.setup();

Expand Down Expand Up @@ -445,7 +445,7 @@ describe( 'NavigationMenuSelector', () => {
expect( menuItem ).toBeChecked();
} );

it( 'should call the handler when the navigation menu is selected', async () => {
it( 'should call the handler when the Navigation Menu is selected', async () => {
const user = userEvent.setup();

const handler = jest.fn();
Expand Down

0 comments on commit 95fda45

Please sign in to comment.