๐Ÿ’ฅ TRENDING: WordPress/gutenberg/issues/ - Full Archive

Skip to content

Consistent terminology: Patterns vs. Block Patternsย #49617

@afercia

Description

@afercia

Description

Looks like there's a bit of inconsistency in the labelling of the 'Patterns'. Sometimes it's 'Pattern', sometimes 'Block Patterns'. It would be good to use a consistent terminology everywhere, for better clarity and consistent user experience.

Note that some of these strings are visually hidden or used for aria-label attributes so you can't actually see them in the UI.

Searching the codebase for all occurrences of pattern in the translatable strings, here's the results:

51 results - 22 files

lib/compat/wordpress-6.1/class-gutenberg-rest-block-patterns-controller-6-1.php:
   69: 					'description' => __( 'The pattern name.', 'gutenberg' ),
   75: 					'description' => __( 'The pattern title, in human readable format.', 'gutenberg' ),
   81: 					'description' => __( 'The pattern detailed description.', 'gutenberg' ),
   87: 					'description' => __( 'The pattern viewport width for inserter preview.', 'gutenberg' ),
   93: 					'description' => __( 'Block types that the pattern is intended to be used with.', 'gutenberg' ),
   99: 					'description' => __( 'An array of post types that the pattern is restricted to be used with.', 'gutenberg' ),
  105: 					'description' => __( 'The pattern category slugs.', 'gutenberg' ),
  111: 					'description' => __( 'The pattern keywords.', 'gutenberg' ),
  117: 					'description' => __( 'The pattern content.', 'gutenberg' ),
  123: 					'description' => __( 'Determines whether the pattern is visible in inserter.', 'gutenberg' ),

lib/compat/wordpress-6.2/block-patterns.php:
   22: 			'description' => __( 'Patterns that contain buttons and call to actions.', 'gutenberg' ),
   29: 			'description' => __( 'Multi-column patterns with more complex layouts.', 'gutenberg' ),
   36: 			'description' => __( 'Patterns containing mostly text.', 'gutenberg' ),
   50: 			'description' => __( 'A set of high quality curated patterns.', 'gutenberg' ),
  213: 								__( 'Could not register file "%s" as a block pattern ("Slug" field missing)', 'gutenberg' ),
  226: 								__( 'Could not register file "%1$s" as a block pattern (invalid slug "%2$s")', 'gutenberg' ),
  244: 								__( 'Could not register file "%s" as a block pattern ("Title" field missing)', 'gutenberg' ),

lib/compat/wordpress-6.2/class-gutenberg-rest-block-patterns-controller-6-2.php:
   88: 					'description' => __( 'The pattern name.', 'gutenberg' ),
   94: 					'description' => __( 'The pattern title, in human readable format.', 'gutenberg' ),
  100: 					'description' => __( 'The pattern detailed description.', 'gutenberg' ),
  106: 					'description' => __( 'The pattern viewport width for inserter preview.', 'gutenberg' ),
  112: 					'description' => __( 'Block types that the pattern is intended to be used with.', 'gutenberg' ),
  118: 					'description' => __( 'An array of post types that the pattern is restricted to be used with.', 'gutenberg' ),
  124: 					'description' => __( 'The pattern category slugs.', 'gutenberg' ),
  130: 					'description' => __( 'The pattern keywords.', 'gutenberg' ),
  136: 					'description' => __( 'An array of template types where the pattern fits.', 'gutenberg' ),
  142: 					'description' => __( 'The pattern content.', 'gutenberg' ),
  148: 					'description' => __( 'Determines whether the pattern is visible in inserter.', 'gutenberg' ),

lib/compat/wordpress-6.2/rest-api.php:
  124: 				'description' => __( 'The block types which can use this pattern.', 'gutenberg' ),

packages/block-editor/src/components/block-draggable/draggable-chip.js:
  14: 	const patternLabel = isPattern && __( 'Pattern' );

packages/block-editor/src/components/block-pattern-setup/index.js:
  63: 				aria-label={ __( 'Patterns list' ) }

packages/block-editor/src/components/block-pattern-setup/setup-toolbar.js:
  35: 			label={ __( 'Previous pattern' ) }
  41: 			label={ __( 'Next pattern' ) }

packages/block-editor/src/components/block-patterns-list/index.js:
  125: 	label = __( 'Block Patterns' ),

packages/block-editor/src/components/block-switcher/pattern-transformations-menu.js:
  49: 				{ __( 'Patterns' ) }
  85: 			aria-label={ __( 'Patterns list' ) }

packages/block-editor/src/components/inserter/block-patterns-tab.js:
  215: 					<nav aria-label={ __( 'Block pattern categories' ) }>
  255: 									{ __( 'Explore all patterns' ) }

packages/block-editor/src/components/inserter/index.js:
  49: 		label = __( 'Add pattern' );

packages/block-editor/src/components/inserter/menu.js:
  253: 					label={ __( 'Search for blocks and patterns' ) }

packages/block-editor/src/components/inserter/quick-inserter.js:
  111: 					label={ __( 'Search for blocks and patterns' ) }

packages/block-editor/src/components/inserter/search-results.js:
  158: 				<VisuallyHidden>{ __( 'Block Patterns' ) }</VisuallyHidden>

packages/block-editor/src/components/inserter/tabs.js:
  17: 	title: __( 'Patterns' ),

packages/block-editor/src/components/inserter/block-patterns-explorer/explorer.js:
  40: 			title={ __( 'Patterns' ) }

packages/block-editor/src/components/inserter/block-patterns-explorer/sidebar.js:
  42: 				label={ __( 'Search for patterns' ) }

packages/block-editor/src/components/inserter/hooks/use-patterns-state.js:
  45: 				__( 'Block pattern "%s" inserted.' ),

packages/block-library/src/query/edit/pattern-selection-modal.js:
  63: 			title={ __( 'Choose a pattern' ) }
  72: 						label={ __( 'Search for patterns' ) }

packages/block-library/src/template-part/edit/selection-modal.js:
  113: 					<h2>{ __( 'Patterns' ) }</h2>

packages/edit-post/src/components/start-page-options/index.js:
  115: 			title={ __( 'Choose a pattern' ) }

packages/edit-site/src/components/start-template-options/index.js:
  120: 			title={ __( 'Choose a pattern' ) }

Step-by-step reproduction instructions

  • Search the codebase for all the translatable strings containing pattern.
  • Observe the inconsistent labelling / naming.
  • Hint: I used this simple regex: __\( .*pattern

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes