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

Copy: "Detach pattern" instead of "Covert to regular block" #51993

Merged
merged 1 commit into from
Jun 28, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,12 @@ const BlockActionsMenu = ( {
id: 'convertToRegularBlocksOption',
label:
innerBlockCount > 1
? __( 'Convert to regular blocks' )
: __( 'Convert to regular block' ),
? __( 'Detach patterns' )
: __( 'Detach pattern' ),
value: 'convertToRegularBlocksOption',
onSelect: () => {
const successNotice =
innerBlockCount > 1
? /* translators: %s: name of the reusable block */
__( '%s converted to regular blocks' )
: /* translators: %s: name of the reusable block */
__( '%s converted to regular block' );
/* translators: %s: name of the synced block */
const successNotice = __( '%s detached' );
createSuccessNotice(
sprintf(
successNotice,
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/block/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
onClick={ () => convertBlockToStatic( clientId ) }
label={
innerBlockCount > 1
? __( 'Convert to regular blocks' )
: __( 'Convert to regular block' )
? __( 'Detach patterns' )
: __( 'Detach pattern' )
}
icon={ ungroup }
showTooltip
Expand Down
16 changes: 6 additions & 10 deletions packages/block-library/src/block/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,8 @@ export default function ReusableBlockEdit( {
}

const onConvertToRegularBlocks = useCallback( () => {
const successNotice =
innerBlockCount > 1
? /* translators: %s: name of the reusable block */
__( '%s converted to regular blocks' )
: /* translators: %s: name of the reusable block */
__( '%s converted to regular block' );
/* translators: %s: name of the synced block */
const successNotice = __( '%s detached' );
createSuccessNotice( sprintf( successNotice, title ) );

clearSelectedBlock();
Expand Down Expand Up @@ -182,17 +178,17 @@ export default function ReusableBlockEdit( {
<Text style={ [ infoTextStyle, infoDescriptionStyle ] }>
{ innerBlockCount > 1
? __(
'Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”.'
'Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”.'
)
: __(
'Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”.'
'Alternatively, you can detach and edit this block separately by tapping “Detach pattern”.'
) }
</Text>
<TextControl
label={
innerBlockCount > 1
? __( 'Convert to regular blocks' )
: __( 'Convert to regular block' )
? __( 'Detach patterns' )
: __( 'Detach pattern' )
}
separatorType="topFullWidth"
onPress={ onConvertToRegularBlocks }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ describe( 'Reusable blocks', () => {
await insertReusableBlock( 'Surprised greeting block' );

// Convert block to a regular block.
await clickBlockToolbarButton( 'Convert to regular block' );
await clickBlockToolbarButton( 'Detach pattern' );

// Check that we have a paragraph block on the page.
const paragraphBlock = await canvas().$(
Expand Down Expand Up @@ -221,7 +221,7 @@ describe( 'Reusable blocks', () => {
await insertReusableBlock( 'Multi-selection reusable block' );

// Convert block to a regular block.
await clickBlockToolbarButton( 'Convert to regular blocks' );
await clickBlockToolbarButton( 'Detach patterns' );

// Check that we have two paragraph blocks on the page.
expect( await getEditedPostContent() ).toMatchSnapshot();
Expand Down Expand Up @@ -353,7 +353,7 @@ describe( 'Reusable blocks', () => {

// Convert back to regular blocks.
await clickBlockToolbarButton( 'Select Pattern' );
await clickBlockToolbarButton( 'Convert to regular block' );
await clickBlockToolbarButton( 'Detach pattern' );
await page.waitForXPath( selector, {
hidden: true,
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function ReusableBlocksManageButton( { clientId } ) {
{ canRemove && (
<MenuItem onClick={ () => convertBlockToStatic( clientId ) }>
{ innerBlockCount > 1
? __( 'Convert to regular blocks' )
: __( 'Convert to regular block' ) }
? __( 'Detach patterns' )
: __( 'Detach pattern' ) }
</MenuItem>
) }
</BlockSettingsMenuControls>
Expand Down
Loading