Skip to content

Commit

Permalink
Update locked pattern tooltips (#52497)
Browse files Browse the repository at this point in the history
* Update locked pattern tooltips

* Update tooltips
  • Loading branch information
jameskoster authored Jul 17, 2023
1 parent 4a55288 commit d49757b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/edit-site/src/components/page-patterns/grid-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ function GridItem( { categoryId, item, ...props } ) {
}

if ( isNonUserPattern ) {
ariaDescriptions.push( __( 'Theme patterns cannot be edited.' ) );
ariaDescriptions.push(
__( 'Theme & plugin patterns cannot be edited.' )
);
}

const itemIcon =
Expand Down Expand Up @@ -208,9 +210,7 @@ function GridItem( { categoryId, item, ...props } ) {
{ item.type === PATTERNS && (
<Tooltip
position="top center"
text={ __(
'Theme patterns cannot be edited.'
) }
text={ __( 'This pattern cannot be edited.' ) }
>
<span className="edit-site-patterns__pattern-lock-icon">
<Icon icon={ lockSmall } size={ 24 } />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { useViewportMatch } from '@wordpress/compose';
import { useSelect } from '@wordpress/data';
import { getTemplatePartIcon } from '@wordpress/editor';
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { getQueryArgs } from '@wordpress/url';
import { file, starFilled, lockSmall } from '@wordpress/icons';

Expand Down Expand Up @@ -71,8 +71,10 @@ function ThemePatternsGroup( { categories, currentCategory, currentType } ) {
{ category.label }
<Tooltip
position="top center"
text={ __(
'Theme patterns cannot be edited.'
text={ sprintf(
// translators: %s: The pattern category name.
'"%s" patterns cannot be edited.',
category.label
) }
>
<span className="edit-site-sidebar-navigation-screen-pattern__lock-icon">
Expand Down

0 comments on commit d49757b

Please sign in to comment.