gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Consistent terminology: Patterns vs. Block Patterns

Open afercia opened this issue 3 years ago • 11 comments

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

afercia avatar Apr 05 '23 14:04 afercia

@afercia would you go for "Block Patterns"? Seems a bit more used also in the docs i found:

  • https://developer.wordpress.org/block-editor/reference-guides/block-api/block-patterns/
  • https://wordpress.com/support/wordpress-editor/block-pattern/
  • https://developer.wordpress.org/themes/advanced-topics/block-patterns/

masteradhoc avatar Apr 07 '23 20:04 masteradhoc

@masteradhoc thanks for the ping. Not sure the terminology used in the UI must necessarily match the one used in the docs in this case. To me, in the UI the shorter, the better. Not a strong preference though.

afercia avatar Apr 11 '23 12:04 afercia

I think "Pattern" and "Patterns" is fine.

richtabor avatar Apr 21 '23 16:04 richtabor

Hi, I would like to contribute to this, are we talking about changing the description of to Patterns or Pattern instead of Block pattern

xerpa43 avatar Apr 21 '23 17:04 xerpa43

@xerpa43 yes, it would be nice to change all the occurrences of 'Block Pattern/s' in the translatable strings to 'Pattern/s'. Would be good to have a look at the occurrences in the documentation as well, and change it where it makes sense.

Please do feel free to go ahead and submit a pull request! 🎉

afercia avatar May 03 '23 10:05 afercia

@afercia Thank you, I'll be working on it

xerpa43 avatar May 03 '23 14:05 xerpa43

Hey @xerpa43 are you still working on this?

Narcos101 avatar Jun 02 '23 13:06 Narcos101

@Narcos101 Have been caught with some other ones, you can work if you want.

xerpa43 avatar Jun 02 '23 18:06 xerpa43

Hey @afercia I am taking on this task. To be clear, i have to find and replace block pattern/s to pattern/s in docs,labels,comments and everywhere where i find out in the entire repo. Am I right?

Narcos101 avatar Jun 04 '23 12:06 Narcos101

Hey @Narcos101 - are you still working on this?

jordesign avatar Sep 20 '23 23:09 jordesign

Came here to report as well; saw this today:

Footers

richtabor avatar Oct 05 '23 21:10 richtabor