From 8602fc1d8266accd7d23420c44a259323b6fc02d Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Tue, 26 Sep 2023 18:49:05 +1000 Subject: [PATCH] Patterns: Improve sentence case consistency of labels and notices (#54807) --- .../block-editor/src/components/block-patterns-list/index.js | 2 +- .../src/components/inserter/block-patterns-tab.js | 2 +- .../block-editor/src/components/inserter/search-results.js | 2 +- packages/e2e-test-utils/src/create-reusable-block.js | 2 +- .../e2e-tests/specs/editor/various/pattern-blocks.test.js | 2 +- .../list-reusable-blocks/src/components/import-form/index.js | 4 ++-- packages/list-reusable-blocks/src/utils/import.js | 2 +- packages/patterns/src/components/pattern-convert-button.js | 4 ++-- packages/patterns/src/store/actions.js | 2 +- .../reusable-block-convert-button.js | 4 ++-- packages/reusable-blocks/src/store/actions.js | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/block-editor/src/components/block-patterns-list/index.js b/packages/block-editor/src/components/block-patterns-list/index.js index 3ac0cc7018b3da..9ab7bbaf0bb445 100644 --- a/packages/block-editor/src/components/block-patterns-list/index.js +++ b/packages/block-editor/src/components/block-patterns-list/index.js @@ -149,7 +149,7 @@ function BlockPatternList( onHover, onClickPattern, orientation, - label = __( 'Block Patterns' ), + label = __( 'Block patterns' ), showTitlesAsTooltip, pagingProps, }, diff --git a/packages/block-editor/src/components/inserter/block-patterns-tab.js b/packages/block-editor/src/components/inserter/block-patterns-tab.js index 289ad4dfa47097..5d4b2684f1c70f 100644 --- a/packages/block-editor/src/components/inserter/block-patterns-tab.js +++ b/packages/block-editor/src/components/inserter/block-patterns-tab.js @@ -42,7 +42,7 @@ const noop = () => {}; export const allPatternsCategory = { name: 'allPatterns', - label: __( 'All Patterns' ), + label: __( 'All patterns' ), }; export const myPatternsCategory = { diff --git a/packages/block-editor/src/components/inserter/search-results.js b/packages/block-editor/src/components/inserter/search-results.js index 23a3cafc563ba6..edd99609ea916c 100644 --- a/packages/block-editor/src/components/inserter/search-results.js +++ b/packages/block-editor/src/components/inserter/search-results.js @@ -184,7 +184,7 @@ function InserterSearchResults( { const patternsUI = !! filteredBlockPatterns.length && ( { __( 'Block Patterns' ) } + { __( 'Block patterns' ) } } >
diff --git a/packages/e2e-test-utils/src/create-reusable-block.js b/packages/e2e-test-utils/src/create-reusable-block.js index ed756353310dd9..0b2e327a5c05c2 100644 --- a/packages/e2e-test-utils/src/create-reusable-block.js +++ b/packages/e2e-test-utils/src/create-reusable-block.js @@ -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 diff --git a/packages/e2e-tests/specs/editor/various/pattern-blocks.test.js b/packages/e2e-tests/specs/editor/various/pattern-blocks.test.js index 72f11f2c95e7a4..e0b3df5ef70a82 100644 --- a/packages/e2e-tests/specs/editor/various/pattern-blocks.test.js +++ b/packages/e2e-tests/specs/editor/various/pattern-blocks.test.js @@ -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(); diff --git a/packages/list-reusable-blocks/src/components/import-form/index.js b/packages/list-reusable-blocks/src/components/import-form/index.js index 9ba1589e52f39b..1f5e62f9115b36 100644 --- a/packages/list-reusable-blocks/src/components/import-form/index.js +++ b/packages/list-reusable-blocks/src/components/import-form/index.js @@ -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' ); diff --git a/packages/list-reusable-blocks/src/utils/import.js b/packages/list-reusable-blocks/src/utils/import.js index 465fb080ce8dfe..432948ce6d6dbc 100644 --- a/packages/list-reusable-blocks/src/utils/import.js +++ b/packages/list-reusable-blocks/src/utils/import.js @@ -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( { diff --git a/packages/patterns/src/components/pattern-convert-button.js b/packages/patterns/src/components/pattern-convert-button.js index b29af99248f7db..002dbbd8c0181d 100644 --- a/packages/patterns/src/components/pattern-convert-button.js +++ b/packages/patterns/src/components/pattern-convert-button.js @@ -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 ), { diff --git a/packages/patterns/src/store/actions.js b/packages/patterns/src/store/actions.js index 2861e4ce2dac06..dfa0326a709416 100644 --- a/packages/patterns/src/store/actions.js +++ b/packages/patterns/src/store/actions.js @@ -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( diff --git a/packages/reusable-blocks/src/components/reusable-blocks-menu-items/reusable-block-convert-button.js b/packages/reusable-blocks/src/components/reusable-blocks-menu-items/reusable-block-convert-button.js index de29a930e89f18..347638baeaf059 100644 --- a/packages/reusable-blocks/src/components/reusable-blocks-menu-items/reusable-block-convert-button.js +++ b/packages/reusable-blocks/src/components/reusable-blocks-menu-items/reusable-block-convert-button.js @@ -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 ), { diff --git a/packages/reusable-blocks/src/store/actions.js b/packages/reusable-blocks/src/store/actions.js index 292a3082146aaa..85fe31138652a4 100644 --- a/packages/reusable-blocks/src/store/actions.js +++ b/packages/reusable-blocks/src/store/actions.js @@ -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 )