Skip to content

Commit be810dd

Browse files
richtabortellthemachines
authored andcommitted
Patterns: Use "detached" copy consistently (#51993)
1 parent e29a7c2 commit be810dd

File tree

5 files changed

+17
-25
lines changed

5 files changed

+17
-25
lines changed

packages/block-editor/src/components/block-mobile-toolbar/block-actions-menu.native.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,12 @@ const BlockActionsMenu = ( {
213213
id: 'convertToRegularBlocksOption',
214214
label:
215215
innerBlockCount > 1
216-
? __( 'Convert to regular blocks' )
217-
: __( 'Convert to regular block' ),
216+
? __( 'Detach patterns' )
217+
: __( 'Detach pattern' ),
218218
value: 'convertToRegularBlocksOption',
219219
onSelect: () => {
220-
const successNotice =
221-
innerBlockCount > 1
222-
? /* translators: %s: name of the reusable block */
223-
__( '%s converted to regular blocks' )
224-
: /* translators: %s: name of the reusable block */
225-
__( '%s converted to regular block' );
220+
/* translators: %s: name of the synced block */
221+
const successNotice = __( '%s detached' );
226222
createSuccessNotice(
227223
sprintf(
228224
successNotice,

packages/block-library/src/block/edit.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export default function ReusableBlockEdit( { attributes: { ref }, clientId } ) {
119119
onClick={ () => convertBlockToStatic( clientId ) }
120120
label={
121121
innerBlockCount > 1
122-
? __( 'Convert to regular blocks' )
123-
: __( 'Convert to regular block' )
122+
? __( 'Detach patterns' )
123+
: __( 'Detach pattern' )
124124
}
125125
icon={ ungroup }
126126
showTooltip

packages/block-library/src/block/edit.native.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,8 @@ export default function ReusableBlockEdit( {
132132
}
133133

134134
const onConvertToRegularBlocks = useCallback( () => {
135-
const successNotice =
136-
innerBlockCount > 1
137-
? /* translators: %s: name of the reusable block */
138-
__( '%s converted to regular blocks' )
139-
: /* translators: %s: name of the reusable block */
140-
__( '%s converted to regular block' );
135+
/* translators: %s: name of the synced block */
136+
const successNotice = __( '%s detached' );
141137
createSuccessNotice( sprintf( successNotice, title ) );
142138

143139
clearSelectedBlock();
@@ -182,17 +178,17 @@ export default function ReusableBlockEdit( {
182178
<Text style={ [ infoTextStyle, infoDescriptionStyle ] }>
183179
{ innerBlockCount > 1
184180
? __(
185-
'Alternatively, you can detach and edit these blocks separately by tapping “Convert to regular blocks”.'
181+
'Alternatively, you can detach and edit these blocks separately by tapping “Detach patterns”.'
186182
)
187183
: __(
188-
'Alternatively, you can detach and edit this block separately by tapping “Convert to regular block”.'
184+
'Alternatively, you can detach and edit this block separately by tapping “Detach pattern”.'
189185
) }
190186
</Text>
191187
<TextControl
192188
label={
193189
innerBlockCount > 1
194-
? __( 'Convert to regular blocks' )
195-
: __( 'Convert to regular block' )
190+
? __( 'Detach patterns' )
191+
: __( 'Detach pattern' )
196192
}
197193
separatorType="topFullWidth"
198194
onPress={ onConvertToRegularBlocks }

packages/e2e-tests/specs/editor/various/reusable-blocks.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ describe( 'Reusable blocks', () => {
113113
await insertReusableBlock( 'Surprised greeting block' );
114114

115115
// Convert block to a regular block.
116-
await clickBlockToolbarButton( 'Convert to regular block' );
116+
await clickBlockToolbarButton( 'Detach pattern' );
117117

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

223223
// Convert block to a regular block.
224-
await clickBlockToolbarButton( 'Convert to regular blocks' );
224+
await clickBlockToolbarButton( 'Detach patterns' );
225225

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

354354
// Convert back to regular blocks.
355355
await clickBlockToolbarButton( 'Select Pattern' );
356-
await clickBlockToolbarButton( 'Convert to regular block' );
356+
await clickBlockToolbarButton( 'Detach pattern' );
357357
await page.waitForXPath( selector, {
358358
hidden: true,
359359
} );

packages/reusable-blocks/src/components/reusable-blocks-menu-items/reusable-blocks-manage-button.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ function ReusableBlocksManageButton( { clientId } ) {
5858
{ canRemove && (
5959
<MenuItem onClick={ () => convertBlockToStatic( clientId ) }>
6060
{ innerBlockCount > 1
61-
? __( 'Convert to regular blocks' )
62-
: __( 'Convert to regular block' ) }
61+
? __( 'Detach patterns' )
62+
: __( 'Detach pattern' ) }
6363
</MenuItem>
6464
) }
6565
</BlockSettingsMenuControls>

0 commit comments

Comments
 (0)