From 8c12ee508069448fa1bdcff7c0e63332f049f603 Mon Sep 17 00:00:00 2001 From: yogeshbhutkar Date: Mon, 30 Dec 2024 09:33:46 +0530 Subject: [PATCH] Read More: Update example to use localized text --- packages/block-library/src/read-more/block.json | 5 ----- packages/block-library/src/read-more/index.js | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/block-library/src/read-more/block.json b/packages/block-library/src/read-more/block.json index d4ab0dd8cace0..9e4fc84d193f7 100644 --- a/packages/block-library/src/read-more/block.json +++ b/packages/block-library/src/read-more/block.json @@ -15,11 +15,6 @@ "default": "_self" } }, - "example": { - "attributes": { - "content": "Read More" - } - }, "usesContext": [ "postId" ], "supports": { "html": false, diff --git a/packages/block-library/src/read-more/index.js b/packages/block-library/src/read-more/index.js index 497cd77f429e6..c6e825085d01a 100644 --- a/packages/block-library/src/read-more/index.js +++ b/packages/block-library/src/read-more/index.js @@ -1,6 +1,7 @@ /** * WordPress dependencies */ +import { _x } from '@wordpress/i18n'; import { link as icon } from '@wordpress/icons'; /** @@ -16,6 +17,11 @@ export { metadata, name }; export const settings = { icon, edit, + example: { + attributes: { + content: _x( 'Read More', 'Example text for the Read More block' ), + }, + }, }; export const init = () => initBlock( { name, metadata, settings } );