Skip to content

Commit

Permalink
Reword the notices
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin940726 committed Jan 9, 2023
1 parent a918587 commit 991f685
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/block-editor/src/components/use-paste-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,11 @@ export default function usePasteStyles() {
let html = '';
try {
// `http:` sites won't have the clipboard property on navigator.
// (with the exception of localhost.)
if ( ! window.navigator.clipboard ) {
createErrorNotice(
__(
'Reading from the clipboard is only available in secure contexts (HTTPS) in supporting browsers.'
'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'
),
{ type: 'snackbar' }
);
Expand All @@ -153,7 +154,9 @@ export default function usePasteStyles() {
} catch ( error ) {
// Possibly the permission is denied.
createErrorNotice(
__( 'Permission denied: Unable to read from clipboard.' ),
__(
'Unable to paste styles. Please allow browser clipboard permissions before continuing.'
),
{
type: 'snackbar',
}
Expand All @@ -164,7 +167,9 @@ export default function usePasteStyles() {
// Abort if the copied text is empty or doesn't look like serialized blocks.
if ( ! html || ! hasSerializedBlocks( html ) ) {
createWarningNotice(
__( "The copied data doesn't appear to be blocks." ),
__(
"Unable to paste styles. Block styles couldn't be found within the copied content."
),
{
type: 'snackbar',
}
Expand Down

0 comments on commit 991f685

Please sign in to comment.