Skip to content

Commit

Permalink
Link Control: Simplify the sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
scruffian committed Feb 8, 2024
1 parent 7fde6a8 commit 6f118a4
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ export default function LinkPreview( {
<Button
icon={ copySmall }
label={ sprintf(
// Translators: %1$s is a placeholder for an optional colon, %2$s is a placeholder for the link URL (if present).
__( 'Copy link%1$s%2$s' ), // Ends up looking like "Copy link: https://example.com".
isEmptyURL ? '' : ': ',
value.url
// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).
__( 'Copy link%s' ), // Ends up looking like "Copy link: https://example.com".
isEmptyURL ? '' : ': ' + value.url
) }
ref={ ref }
disabled={ isEmptyURL }
Expand Down

0 comments on commit 6f118a4

Please sign in to comment.