Skip to content

Commit

Permalink
Block Editor: Update strings in blocks 'RenameModal' component (#54887)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Sep 27, 2023
1 parent 4b10f65 commit e1ea986
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/block-editor/src/hooks/block-rename-ui.js
Expand Up @@ -44,17 +44,21 @@ function RenameModal( { blockName, originalBlockName, onClose, onSave } ) {
);

const handleSubmit = () => {
// Must be assertive to immediately announce change.
speak(
sprintf(
/* translators: %1$s: type of update (either reset of changed). %2$s: new name/label for the block */
__( 'Block name %1$s to: "%2$s".' ),
nameIsOriginal || nameIsEmpty ? __( 'reset' ) : __( 'changed' ),
editedBlockName
),
'assertive'
);
const message =
nameIsOriginal || nameIsEmpty
? sprintf(
/* translators: %s: new name/label for the block */
__( 'Block name reset to: "%s".' ),
editedBlockName
)
: sprintf(
/* translators: %s: new name/label for the block */
__( 'Block name changed to: "%s".' ),
editedBlockName
);

// Must be assertive to immediately announce change.
speak( message, 'assertive' );
onSave( editedBlockName );

// Immediate close avoids ability to hit save multiple times.
Expand Down

1 comment on commit e1ea986

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in e1ea986.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6330949109
📝 Reported issues:

Please sign in to comment.