From 382af6426d1d6de48a6adc3746a0fd29058d9b63 Mon Sep 17 00:00:00 2001 From: Yogesh Bhutkar Date: Thu, 2 Jan 2025 13:23:34 +0530 Subject: [PATCH] i18n: make example translatable in query-no-results (#68376) Co-authored-by: yogeshbhutkar Co-authored-by: t-hamano --- .../block-library/src/query-no-results/block.json | 10 ---------- packages/block-library/src/query-no-results/index.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/block-library/src/query-no-results/block.json b/packages/block-library/src/query-no-results/block.json index c7d3ff500e0f43..c2b7224aa40b14 100644 --- a/packages/block-library/src/query-no-results/block.json +++ b/packages/block-library/src/query-no-results/block.json @@ -8,16 +8,6 @@ "ancestor": [ "core/query" ], "textdomain": "default", "usesContext": [ "queryId", "query" ], - "example": { - "innerBlocks": [ - { - "name": "core/paragraph", - "attributes": { - "content": "No posts were found." - } - } - ] - }, "supports": { "align": true, "reusable": false, diff --git a/packages/block-library/src/query-no-results/index.js b/packages/block-library/src/query-no-results/index.js index 1c56638cdfdba8..fab5993148470e 100644 --- a/packages/block-library/src/query-no-results/index.js +++ b/packages/block-library/src/query-no-results/index.js @@ -1,6 +1,7 @@ /** * WordPress dependencies */ +import { __ } from '@wordpress/i18n'; import { loop as icon } from '@wordpress/icons'; /** @@ -18,6 +19,16 @@ export const settings = { icon, edit, save, + example: { + innerBlocks: [ + { + name: 'core/paragraph', + attributes: { + content: __( 'No posts were found.' ), + }, + }, + ], + }, }; export const init = () => initBlock( { name, metadata, settings } );