Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistent terminology: Patterns vs. Block Patterns #49617

Open
afercia opened this issue Apr 5, 2023 · 11 comments · May be fixed by #54708
Open

Consistent terminology: Patterns vs. Block Patterns #49617

afercia opened this issue Apr 5, 2023 · 11 comments · May be fixed by #54708
Assignees
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Edit Post /packages/edit-post [Package] Edit Site /packages/edit-site [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@afercia
Copy link
Contributor

afercia commented Apr 5, 2023

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 afercia added Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block library /packages/block-library [Package] Block editor /packages/block-editor [Package] Edit Post /packages/edit-post [a11y] Labelling [Package] Edit Site /packages/edit-site labels Apr 5, 2023
@afercia afercia changed the title Consistent terminologi: Patterns vs. Block Patterns Consistent terminology: Patterns vs. Block Patterns Apr 5, 2023
@afercia
Copy link
Contributor Author

afercia commented Apr 11, 2023

@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.

@richtabor
Copy link
Member

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

@xerpa43
Copy link
Contributor

xerpa43 commented Apr 21, 2023

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

@afercia
Copy link
Contributor Author

afercia commented May 3, 2023

@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! 🎉

@xerpa43
Copy link
Contributor

xerpa43 commented May 3, 2023

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

@Narcos101
Copy link

Hey @xerpa43 are you still working on this?

@xerpa43
Copy link
Contributor

xerpa43 commented Jun 2, 2023

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

@Narcos101
Copy link

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?

@priethor priethor added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed [a11y] Labelling labels Jul 24, 2023
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Jul 26, 2023
@jordesign
Copy link
Contributor

Hey @Narcos101 - are you still working on this?

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 22, 2023
@richtabor
Copy link
Member

Came here to report as well; saw this today:

Footers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Package] Edit Post /packages/edit-post [Package] Edit Site /packages/edit-site [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants