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

Make template part and reusable block creation language consistent #43032

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/reference-guides/filters/i18n-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Here is a simple example, using the `i18n.gettext` filter to override a specific
```jsx
// Define our filter callback.
function myPluginGettextFilter( translation, text, domain ) {
if ( text === 'Add to Reusable blocks' ) {
if ( text === 'Create Reusable block' ) {
return 'Save to MyOrg block library';
}
return translation;
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 @@ -19,7 +19,7 @@ export const createReusableBlock = async ( content, title ) => {
await page.keyboard.type( content );

await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Add to Reusable blocks' );
await clickMenuItem( 'Create Reusable block' );
const nameInput = await page.waitForSelector(
reusableBlockNameInputSelector
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe( 'block editor keyboard shortcuts', () => {
} );
it( 'should prevent deleting multiple selected blocks from inputs', async () => {
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Add to Reusable blocks' );
await clickMenuItem( 'Create Reusable block' );
const reusableBlockNameInputSelector =
'.reusable-blocks-menu-items__convert-modal .components-text-control__input';
const nameInput = await page.waitForSelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe( 'Reusable blocks', () => {

// Convert block to a reusable block.
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Add to Reusable blocks' );
await clickMenuItem( 'Create Reusable block' );

// Set title.
const nameInput = await page.waitForSelector(
Expand Down Expand Up @@ -373,7 +373,7 @@ describe( 'Reusable blocks', () => {

// Convert to reusable.
await clickBlockToolbarButton( 'Options' );
await clickMenuItem( 'Add to Reusable blocks' );
await clickMenuItem( 'Create Reusable block' );
const nameInput = await page.waitForSelector(
reusableBlockNameInputSelector
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { __ } from '@wordpress/i18n';
import { useState } from '@wordpress/element';
import { store as coreStore } from '@wordpress/core-data';
import { store as noticesStore } from '@wordpress/notices';
import { symbolFilled } from '@wordpress/icons';

/**
* Internal dependencies
Expand Down Expand Up @@ -65,11 +66,12 @@ export default function ConvertToTemplatePart( { clientIds, blocks } ) {
<BlockSettingsMenuControls>
{ () => (
<MenuItem
icon={ symbolFilled }
onClick={ () => {
setIsModalOpen( true );
} }
>
{ __( 'Make template part' ) }
{ __( 'Create Template part' ) }
</MenuItem>
) }
</BlockSettingsMenuControls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default function ReusableBlockConvertButton( {
setIsModalOpen( true );
} }
>
{ __( 'Add to Reusable blocks' ) }
{ __( 'Create Reusable block' ) }
</MenuItem>
{ isModalOpen && (
<Modal
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/site-editor/template-part.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test.describe( 'Template Part', () => {
await editor.selectBlocks( paragraphBlock );

// Convert block to a template part.
await editor.clickBlockOptionsMenuItem( 'Make template part' );
await editor.clickBlockOptionsMenuItem( 'Create Template part' );
await page.type( 'role=dialog >> role=textbox[name="Name"i]', 'Test' );
await page.keyboard.press( 'Enter' );

Expand Down Expand Up @@ -156,7 +156,7 @@ test.describe( 'Template Part', () => {
await editor.selectBlocks( paragraphBlock1, paragraphBlock2 );

// Convert block to a template part.
await editor.clickBlockOptionsMenuItem( 'Make template part' );
await editor.clickBlockOptionsMenuItem( 'Create Template part' );
await page.type( 'role=dialog >> role=textbox[name="Name"i]', 'Test' );
await page.keyboard.press( 'Enter' );

Expand Down