diff --git a/packages/block-library/src/image/edit.js b/packages/block-library/src/image/edit.js index c7b3b034deb42..489343e1dfef7 100644 --- a/packages/block-library/src/image/edit.js +++ b/packages/block-library/src/image/edit.js @@ -351,11 +351,13 @@ export function ImageEdit( { !! metadata?.bindings?.url && ( ! blockBindingsSource || blockBindingsSource?.lockAttributesEditing ), - lockUrlControlsMessage: sprintf( - /* translators: %s: Label of the bindings source if exists */ - __( 'Connected to %s' ), - blockBindingsSource?.label || __( 'dynamic data' ) - ), + lockUrlControlsMessage: blockBindingsSource?.label + ? sprintf( + /* translators: %s: Label of the bindings source. */ + __( 'Connected to %s' ), + blockBindingsSource.label + ) + : __( 'Connected to dynamic data' ), }; }, [ isSingleSelected ] diff --git a/packages/block-library/src/image/image.js b/packages/block-library/src/image/image.js index 3b17f25cf9bd9..e55f6bfa03d73 100644 --- a/packages/block-library/src/image/image.js +++ b/packages/block-library/src/image/image.js @@ -456,20 +456,24 @@ export default function Image( { !! altBinding && ( ! altBindingSource || altBindingSource?.lockAttributesEditing ), - lockAltControlsMessage: sprintf( - /* translators: %s: Label of the bindings source if exists */ - __( 'Connected to %s' ), - altBindingSource?.label || __( 'dynamic data' ) - ), + lockAltControlsMessage: altBindingSource?.label + ? sprintf( + /* translators: %s: Label of the bindings source. */ + __( 'Connected to %s' ), + altBindingSource.label + ) + : __( 'Connected to dynamic data' ), lockTitleControls: !! titleBinding && ( ! titleBindingSource || titleBindingSource?.lockAttributesEditing ), - lockTitleControlsMessage: sprintf( - /* translators: %s: Label of the bindings source if exists */ - __( 'Connected to %s' ), - titleBindingSource?.label || __( 'dynamic data' ) - ), + lockTitleControlsMessage: titleBindingSource?.label + ? sprintf( + /* translators: %s: Label of the bindings source. */ + __( 'Connected to %s' ), + titleBindingSource.label + ) + : __( 'Connected to dynamic data' ), }; }, [ clientId, isSingleSelected, metadata?.bindings ]