Skip to content

Commit

Permalink
Patterns: Improve sentence case consistency of labels and notices (#5…
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored and mikachan committed Sep 26, 2023
1 parent 00e7e2f commit 8602fc1
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function BlockPatternList(
onHover,
onClickPattern,
orientation,
label = __( 'Block Patterns' ),
label = __( 'Block patterns' ),
showTitlesAsTooltip,
pagingProps,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const noop = () => {};

export const allPatternsCategory = {
name: 'allPatterns',
label: __( 'All Patterns' ),
label: __( 'All patterns' ),
};

export const myPatternsCategory = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function InserterSearchResults( {
const patternsUI = !! filteredBlockPatterns.length && (
<InserterPanel
title={
<VisuallyHidden>{ __( 'Block Patterns' ) }</VisuallyHidden>
<VisuallyHidden>{ __( 'Block patterns' ) }</VisuallyHidden>
}
>
<div className="block-editor-inserter__quick-inserter-patterns">
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/create-reusable-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createReusableBlock = async ( content, title ) => {

// Wait for creation to finish
await page.waitForXPath(
'//*[contains(@class, "components-snackbar")]/*[contains(text(),"Pattern created:")]'
'//*[contains(@class, "components-snackbar")]/*[contains(text(),"pattern created:")]'
);

// Check that we have a reusable block on the page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ describe( 'Pattern blocks', () => {

// Wait for creation to finish.
await page.waitForXPath(
'//*[contains(@class, "components-snackbar")]/*[contains(text(),"Pattern created:")]'
'//*[contains(@class, "components-snackbar")]/*[contains(text(),"pattern created:")]'
);

await clearAllBlocks();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ function ImportForm( { instanceId, onUpload } ) {
case 'Invalid JSON file':
uiMessage = __( 'Invalid JSON file' );
break;
case 'Invalid Pattern JSON file':
uiMessage = __( 'Invalid Pattern JSON file' );
case 'Invalid pattern JSON file':
uiMessage = __( 'Invalid pattern JSON file' );
break;
default:
uiMessage = __( 'Unknown error' );
Expand Down
2 changes: 1 addition & 1 deletion packages/list-reusable-blocks/src/utils/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function importReusableBlock( file ) {
( parsedContent.syncStatus &&
typeof parsedContent.syncStatus !== 'string' )
) {
throw new Error( 'Invalid Pattern JSON file' );
throw new Error( 'Invalid pattern JSON file' );
}
const postType = await apiFetch( { path: `/wp/v2/types/wp_block` } );
const reusableBlock = await apiFetch( {
Expand Down
4 changes: 2 additions & 2 deletions packages/patterns/src/components/pattern-convert-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ export default function PatternConvertButton( { clientIds, rootClientId } ) {
pattern.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced
? sprintf(
// translators: %s: the name the user has given to the pattern.
__( 'Unsynced Pattern created: %s' ),
__( 'Unsynced pattern created: %s' ),
pattern.title.raw
)
: sprintf(
// translators: %s: the name the user has given to the pattern.
__( 'Synced Pattern created: %s' ),
__( 'Synced pattern created: %s' ),
pattern.title.raw
),
{
Expand Down
2 changes: 1 addition & 1 deletion packages/patterns/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const createPatternFromFile =
( parsedContent.syncStatus &&
typeof parsedContent.syncStatus !== 'string' )
) {
throw new Error( 'Invalid Pattern JSON file' );
throw new Error( 'Invalid pattern JSON file' );
}

const pattern = await dispatch.createPattern(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ export default function ReusableBlockConvertButton( {
! syncType
? sprintf(
// translators: %s: the name the user has given to the pattern.
__( 'Synced Pattern created: %s' ),
__( 'Synced pattern created: %s' ),
reusableBlockTitle
)
: sprintf(
// translators: %s: the name the user has given to the pattern.
__( 'Unsynced Pattern created: %s' ),
__( 'Unsynced pattern created: %s' ),
reusableBlockTitle
),
{
Expand Down
2 changes: 1 addition & 1 deletion packages/reusable-blocks/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const __experimentalConvertBlocksToReusable =
: undefined;

const reusableBlock = {
title: title || __( 'Untitled Pattern block' ),
title: title || __( 'Untitled pattern block' ),
content: serialize(
registry
.select( blockEditorStore )
Expand Down

0 comments on commit 8602fc1

Please sign in to comment.