From 1fa873aeeeb96f4171041f6eca102bf3905b81d6 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Fri, 23 Apr 2021 10:01:03 +0200 Subject: [PATCH] Block Library: Move translatable fields to `block.json` files --- packages/block-library/src/archives/block.json | 3 +++ packages/block-library/src/archives/index.js | 3 --- packages/block-library/src/audio/block.json | 4 ++++ packages/block-library/src/audio/index.js | 9 --------- packages/block-library/src/block/block.json | 3 +++ packages/block-library/src/block/index.js | 9 --------- packages/block-library/src/button/block.json | 8 ++++++++ packages/block-library/src/button/index.js | 11 +---------- packages/block-library/src/buttons/block.json | 4 ++++ packages/block-library/src/buttons/index.js | 7 +------ packages/block-library/src/calendar/block.json | 4 ++++ packages/block-library/src/calendar/index.js | 4 ---- .../block-library/src/categories/block.json | 3 +++ packages/block-library/src/categories/index.js | 3 --- packages/block-library/src/code/block.json | 3 +++ packages/block-library/src/code/index.js | 6 +----- packages/block-library/src/column/block.json | 3 +++ packages/block-library/src/column/index.js | 3 --- packages/block-library/src/columns/block.json | 3 +++ packages/block-library/src/columns/index.js | 6 +----- packages/block-library/src/cover/block.json | 3 +++ packages/block-library/src/cover/index.js | 6 +----- packages/block-library/src/embed/block.json | 3 +++ packages/block-library/src/embed/index.js | 9 --------- packages/block-library/src/file/block.json | 4 ++++ packages/block-library/src/file/index.js | 4 ---- packages/block-library/src/freeform/block.json | 3 +++ packages/block-library/src/freeform/index.js | 3 --- packages/block-library/src/gallery/block.json | 4 ++++ packages/block-library/src/gallery/index.js | 4 ---- packages/block-library/src/group/block.json | 4 ++++ packages/block-library/src/group/index.js | 10 +--------- packages/block-library/src/heading/block.json | 4 ++++ packages/block-library/src/heading/index.js | 7 +------ packages/block-library/src/html/block.json | 4 ++++ packages/block-library/src/html/index.js | 5 +---- packages/block-library/src/image/block.json | 12 ++++++++++++ packages/block-library/src/image/index.js | 17 +---------------- 38 files changed, 88 insertions(+), 117 deletions(-) diff --git a/packages/block-library/src/archives/block.json b/packages/block-library/src/archives/block.json index d35f8b05001c4b..799d050354c5f2 100644 --- a/packages/block-library/src/archives/block.json +++ b/packages/block-library/src/archives/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/archives", + "title": "Archives", "category": "widgets", + "description": "Display a monthly archive of your posts.", + "textdomain": "default", "attributes": { "displayAsDropdown": { "type": "boolean", diff --git a/packages/block-library/src/archives/index.js b/packages/block-library/src/archives/index.js index 6bfdbef7abce30..e1f01f30a71874 100644 --- a/packages/block-library/src/archives/index.js +++ b/packages/block-library/src/archives/index.js @@ -2,7 +2,6 @@ * WordPress dependencies */ import { archive as icon } from '@wordpress/icons'; -import { __, _x } from '@wordpress/i18n'; /** * Internal dependencies @@ -15,8 +14,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Archives', 'block title' ), - description: __( 'Display a monthly archive of your posts.' ), icon, example: {}, edit, diff --git a/packages/block-library/src/audio/block.json b/packages/block-library/src/audio/block.json index c8e6e8e19d693e..969a9e7e7c29b4 100644 --- a/packages/block-library/src/audio/block.json +++ b/packages/block-library/src/audio/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/audio", + "title": "Audio", "category": "media", + "description": "Embed a simple audio player.", + "keywords": [ "music", "sound", "podcast", "recording" ], + "textdomain": "default", "attributes": { "src": { "type": "string", diff --git a/packages/block-library/src/audio/index.js b/packages/block-library/src/audio/index.js index a06248ac245532..6ed1b116f06b29 100644 --- a/packages/block-library/src/audio/index.js +++ b/packages/block-library/src/audio/index.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; import { audio as icon } from '@wordpress/icons'; /** @@ -18,14 +17,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Audio', 'block title' ), - description: __( 'Embed a simple audio player.' ), - keywords: [ - __( 'music' ), - __( 'sound' ), - __( 'podcast' ), - __( 'recording' ), - ], icon, transforms, deprecated, diff --git a/packages/block-library/src/block/block.json b/packages/block-library/src/block/block.json index aece916ab601ba..006c85c0b5db67 100644 --- a/packages/block-library/src/block/block.json +++ b/packages/block-library/src/block/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/block", + "title": "Reusable block", "category": "reusable", + "description": "Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.", + "textdomain": "default", "attributes": { "ref": { "type": "number" diff --git a/packages/block-library/src/block/index.js b/packages/block-library/src/block/index.js index 0c6353eb1ebed7..d3f536a5676ade 100644 --- a/packages/block-library/src/block/index.js +++ b/packages/block-library/src/block/index.js @@ -1,8 +1,3 @@ -/** - * WordPress dependencies - */ -import { __, _x } from '@wordpress/i18n'; - /** * Internal dependencies */ @@ -14,9 +9,5 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Reusable block', 'block title' ), - description: __( - 'Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.' - ), edit, }; diff --git a/packages/block-library/src/button/block.json b/packages/block-library/src/button/block.json index a9b483981eccf7..3cb59a7fd653eb 100644 --- a/packages/block-library/src/button/block.json +++ b/packages/block-library/src/button/block.json @@ -1,8 +1,12 @@ { "apiVersion": 2, "name": "core/button", + "title": "Button", "category": "design", "parent": [ "core/buttons" ], + "description": "Prompt visitors to take action with a button-style link.", + "keywords": [ "link" ], + "textdomain": "default", "attributes": { "url": { "type": "string", @@ -66,6 +70,10 @@ "__experimentalFontFamily": true, "__experimentalSelector": ".wp-block-button__link" }, + "styles": [ + { "name": "fill", "label": "Fill", "isDefault": true }, + { "name": "outline", "label": "Outline" } + ], "editorStyle": "wp-block-button-editor", "style": "wp-block-button" } diff --git a/packages/block-library/src/button/index.js b/packages/block-library/src/button/index.js index de6f3c8e0b6d26..a62ee2180d76ae 100644 --- a/packages/block-library/src/button/index.js +++ b/packages/block-library/src/button/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { button as icon } from '@wordpress/icons'; /** @@ -17,12 +17,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Button', 'block title' ), - description: __( - 'Prompt visitors to take action with a button-style link.' - ), icon, - keywords: [ __( 'link' ) ], example: { attributes: { className: 'is-style-fill', @@ -30,10 +25,6 @@ export const settings = { text: __( 'Call to Action' ), }, }, - styles: [ - { name: 'fill', label: __( 'Fill' ), isDefault: true }, - { name: 'outline', label: __( 'Outline' ) }, - ], edit, save, deprecated, diff --git a/packages/block-library/src/buttons/block.json b/packages/block-library/src/buttons/block.json index 704b3a33b29a90..74eed0a4a0a54f 100644 --- a/packages/block-library/src/buttons/block.json +++ b/packages/block-library/src/buttons/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/buttons", + "title": "Buttons", "category": "design", + "description": "Prompt visitors to take action with a group of button-style links.", + "keywords": [ "link" ], + "textdomain": "default", "attributes": { "contentJustification": { "type": "string" diff --git a/packages/block-library/src/buttons/index.js b/packages/block-library/src/buttons/index.js index 9cade7c6dc2eb1..2ee8ca3d371d93 100644 --- a/packages/block-library/src/buttons/index.js +++ b/packages/block-library/src/buttons/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { buttons as icon } from '@wordpress/icons'; /** @@ -19,12 +19,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Buttons', 'block title' ), - description: __( - 'Prompt visitors to take action with a group of button-style links.' - ), icon, - keywords: [ __( 'link' ) ], example: { innerBlocks: [ { diff --git a/packages/block-library/src/calendar/block.json b/packages/block-library/src/calendar/block.json index edb73671e692a2..07938927f5ebab 100644 --- a/packages/block-library/src/calendar/block.json +++ b/packages/block-library/src/calendar/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/calendar", + "title": "Calendar", "category": "widgets", + "description": "A calendar of your site’s posts.", + "keywords": [ "posts", "archive" ], + "textdomain": "default", "attributes": { "month": { "type": "integer" diff --git a/packages/block-library/src/calendar/index.js b/packages/block-library/src/calendar/index.js index 5ad08622de378b..43fb2e50006065 100644 --- a/packages/block-library/src/calendar/index.js +++ b/packages/block-library/src/calendar/index.js @@ -2,7 +2,6 @@ * WordPress dependencies */ import { calendar as icon } from '@wordpress/icons'; -import { __, _x } from '@wordpress/i18n'; /** * Internal dependencies @@ -15,10 +14,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Calendar', 'block title' ), - description: __( 'A calendar of your site’s posts.' ), icon, - keywords: [ __( 'posts' ), __( 'archive' ) ], example: {}, edit, }; diff --git a/packages/block-library/src/categories/block.json b/packages/block-library/src/categories/block.json index 5fe562622c83e3..b238df42039e51 100644 --- a/packages/block-library/src/categories/block.json +++ b/packages/block-library/src/categories/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/categories", + "title": "Categories", "category": "widgets", + "description": "Display a list of all categories.", + "textdomain": "default", "attributes": { "displayAsDropdown": { "type": "boolean", diff --git a/packages/block-library/src/categories/index.js b/packages/block-library/src/categories/index.js index ad11522b3c5676..9698dacfdaff31 100644 --- a/packages/block-library/src/categories/index.js +++ b/packages/block-library/src/categories/index.js @@ -2,7 +2,6 @@ * WordPress dependencies */ import { category as icon } from '@wordpress/icons'; -import { __, _x } from '@wordpress/i18n'; /** * Internal dependencies @@ -15,8 +14,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Categories', 'block title' ), - description: __( 'Display a list of all categories.' ), icon, example: {}, edit, diff --git a/packages/block-library/src/code/block.json b/packages/block-library/src/code/block.json index 0f29cf33cc0307..8cb922288730f9 100644 --- a/packages/block-library/src/code/block.json +++ b/packages/block-library/src/code/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/code", + "title": "Code", "category": "text", + "description": "Display code snippets that respect your spacing and tabs.", + "textdomain": "default", "attributes": { "content": { "type": "string", diff --git a/packages/block-library/src/code/index.js b/packages/block-library/src/code/index.js index ed6e65c1dffb69..8301b13d9ff573 100644 --- a/packages/block-library/src/code/index.js +++ b/packages/block-library/src/code/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { code as icon } from '@wordpress/icons'; /** @@ -17,10 +17,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Code', 'block title' ), - description: __( - 'Display code snippets that respect your spacing and tabs.' - ), icon, example: { attributes: { diff --git a/packages/block-library/src/column/block.json b/packages/block-library/src/column/block.json index 92e76c6a5c1741..e949aa4f4fcace 100644 --- a/packages/block-library/src/column/block.json +++ b/packages/block-library/src/column/block.json @@ -1,8 +1,11 @@ { "apiVersion": 2, "name": "core/column", + "title": "Column", "category": "text", "parent": [ "core/columns" ], + "description": "A single column within a columns block.", + "textdomain": "default", "attributes": { "verticalAlignment": { "type": "string" diff --git a/packages/block-library/src/column/index.js b/packages/block-library/src/column/index.js index 955d82d8fcb2fe..e935e682f45caa 100644 --- a/packages/block-library/src/column/index.js +++ b/packages/block-library/src/column/index.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; import { column as icon } from '@wordpress/icons'; /** @@ -17,9 +16,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Column', 'block title' ), icon, - description: __( 'A single column within a columns block.' ), edit, save, deprecated, diff --git a/packages/block-library/src/columns/block.json b/packages/block-library/src/columns/block.json index d9f61692b7cf82..f3bc49d3d24971 100644 --- a/packages/block-library/src/columns/block.json +++ b/packages/block-library/src/columns/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/columns", + "title": "Columns", "category": "design", + "description": "Add a block that displays content in multiple columns, then add whatever content blocks you’d like.", + "textdomain": "default", "attributes": { "verticalAlignment": { "type": "string" diff --git a/packages/block-library/src/columns/index.js b/packages/block-library/src/columns/index.js index 5e00f018d0d295..4bee7eb6bc3963 100644 --- a/packages/block-library/src/columns/index.js +++ b/packages/block-library/src/columns/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { columns as icon } from '@wordpress/icons'; /** @@ -19,11 +19,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Columns', 'block title' ), icon, - description: __( - 'Add a block that displays content in multiple columns, then add whatever content blocks you’d like.' - ), variations, example: { innerBlocks: [ diff --git a/packages/block-library/src/cover/block.json b/packages/block-library/src/cover/block.json index 676fb581c2b958..3b3ad5d804417e 100644 --- a/packages/block-library/src/cover/block.json +++ b/packages/block-library/src/cover/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/cover", + "title": "Cover", "category": "media", + "description": "Add an image or video with a text overlay — great for headers.", + "textdomain": "default", "attributes": { "url": { "type": "string" diff --git a/packages/block-library/src/cover/index.js b/packages/block-library/src/cover/index.js index 331e2fb19c4af4..89576d2ae55e18 100644 --- a/packages/block-library/src/cover/index.js +++ b/packages/block-library/src/cover/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { cover as icon } from '@wordpress/icons'; /** @@ -18,10 +18,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Cover', 'block title' ), - description: __( - 'Add an image or video with a text overlay — great for headers.' - ), icon, example: { attributes: { diff --git a/packages/block-library/src/embed/block.json b/packages/block-library/src/embed/block.json index 8c270a0c0c60e3..cc0cb64c03fe6b 100644 --- a/packages/block-library/src/embed/block.json +++ b/packages/block-library/src/embed/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/embed", + "title": "Embed", "category": "embed", + "description": "Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.", + "textdomain": "default", "attributes": { "url": { "type": "string" diff --git a/packages/block-library/src/embed/index.js b/packages/block-library/src/embed/index.js index 3b1ed4d9bdb9cb..5f0e38c1aabf25 100644 --- a/packages/block-library/src/embed/index.js +++ b/packages/block-library/src/embed/index.js @@ -9,19 +9,10 @@ import variations from './variations'; import deprecated from './deprecated'; import { embedContentIcon } from './icons'; -/** - * WordPress dependencies - */ -import { __, _x } from '@wordpress/i18n'; - const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Embed', 'block title' ), - description: __( - 'Add a block that displays content pulled from other sites, like Twitter, Instagram or YouTube.' - ), icon: embedContentIcon, edit, save, diff --git a/packages/block-library/src/file/block.json b/packages/block-library/src/file/block.json index 530d856fa70872..4874eec3961d9b 100644 --- a/packages/block-library/src/file/block.json +++ b/packages/block-library/src/file/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/file", + "title": "File", "category": "media", + "description": "Add a link to a downloadable file.", + "keywords": [ "document", "pdf", "download" ], + "textdomain": "default", "attributes": { "id": { "type": "number" diff --git a/packages/block-library/src/file/index.js b/packages/block-library/src/file/index.js index a8e566c21eb44e..6dbb7446427bd0 100644 --- a/packages/block-library/src/file/index.js +++ b/packages/block-library/src/file/index.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; import { file as icon } from '@wordpress/icons'; /** @@ -17,10 +16,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'File', 'block title' ), - description: __( 'Add a link to a downloadable file.' ), icon, - keywords: [ __( 'document' ), __( 'pdf' ), __( 'download' ) ], transforms, edit, save, diff --git a/packages/block-library/src/freeform/block.json b/packages/block-library/src/freeform/block.json index a18cd84635004a..f3b2d45b00c489 100644 --- a/packages/block-library/src/freeform/block.json +++ b/packages/block-library/src/freeform/block.json @@ -1,7 +1,10 @@ { "apiVersion": 2, "name": "core/freeform", + "title": "Classic", "category": "text", + "description": "Use the classic WordPress editor.", + "textdomain": "default", "attributes": { "content": { "type": "string", diff --git a/packages/block-library/src/freeform/index.js b/packages/block-library/src/freeform/index.js index 89275ee2d1ebc4..b4d7cf715442b8 100644 --- a/packages/block-library/src/freeform/index.js +++ b/packages/block-library/src/freeform/index.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; import { classic as icon } from '@wordpress/icons'; /** @@ -16,8 +15,6 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Classic', 'block title' ), - description: __( 'Use the classic WordPress editor.' ), icon, edit, save, diff --git a/packages/block-library/src/gallery/block.json b/packages/block-library/src/gallery/block.json index 8beac02827f612..a87edb1eda9729 100644 --- a/packages/block-library/src/gallery/block.json +++ b/packages/block-library/src/gallery/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/gallery", + "title": "Gallery", "category": "media", + "description": "Display multiple images in a rich gallery.", + "keywords": [ "images", "photos" ], + "textdomain": "default", "attributes": { "images": { "type": "array", diff --git a/packages/block-library/src/gallery/index.js b/packages/block-library/src/gallery/index.js index 677291252e7ce6..01e8a7a61502f6 100644 --- a/packages/block-library/src/gallery/index.js +++ b/packages/block-library/src/gallery/index.js @@ -1,7 +1,6 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; import { gallery as icon } from '@wordpress/icons'; /** @@ -18,10 +17,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Gallery', 'block title' ), - description: __( 'Display multiple images in a rich gallery.' ), icon, - keywords: [ __( 'images' ), __( 'photos' ) ], example: { attributes: { columns: 2, diff --git a/packages/block-library/src/group/block.json b/packages/block-library/src/group/block.json index 429f13fb03018c..b12fb400437c65 100644 --- a/packages/block-library/src/group/block.json +++ b/packages/block-library/src/group/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/group", + "title": "Group", "category": "design", + "description": "Combine blocks into a group.", + "keywords": [ "container", "wrapper", "row", "section" ], + "textdomain": "default", "attributes": { "tagName": { "type": "string", diff --git a/packages/block-library/src/group/index.js b/packages/block-library/src/group/index.js index 5ce93ae1fd397a..dac9a09b3cb1fa 100644 --- a/packages/block-library/src/group/index.js +++ b/packages/block-library/src/group/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { createBlock } from '@wordpress/blocks'; import { group as icon } from '@wordpress/icons'; @@ -18,15 +18,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Group', 'block title' ), icon, - description: __( 'Combine blocks into a group.' ), - keywords: [ - __( 'container' ), - __( 'wrapper' ), - __( 'row' ), - __( 'section' ), - ], example: { attributes: { style: { diff --git a/packages/block-library/src/heading/block.json b/packages/block-library/src/heading/block.json index 8d7e0fdd5c1940..0e32048da4e5bf 100644 --- a/packages/block-library/src/heading/block.json +++ b/packages/block-library/src/heading/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/heading", + "title": "Heading", "category": "text", + "description": "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", + "keywords": [ "title", "subtitle" ], + "textdomain": "default", "attributes": { "textAlign": { "type": "string" diff --git a/packages/block-library/src/heading/index.js b/packages/block-library/src/heading/index.js index 593e1eaca7fe46..989812cd46c89b 100644 --- a/packages/block-library/src/heading/index.js +++ b/packages/block-library/src/heading/index.js @@ -7,7 +7,7 @@ import { isEmpty } from 'lodash'; * WordPress dependencies */ import { heading as icon } from '@wordpress/icons'; -import { __, _x, sprintf } from '@wordpress/i18n'; +import { __, sprintf } from '@wordpress/i18n'; /** * Internal dependencies @@ -23,12 +23,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Heading', 'block title' ), - description: __( - 'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.' - ), icon, - keywords: [ __( 'title' ), __( 'subtitle' ) ], example: { attributes: { content: __( 'Code is Poetry' ), diff --git a/packages/block-library/src/html/block.json b/packages/block-library/src/html/block.json index 266b4511e0fe5b..962db3f3684d3b 100644 --- a/packages/block-library/src/html/block.json +++ b/packages/block-library/src/html/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/html", + "title": "Custom HTML", "category": "widgets", + "description": "Add custom HTML code and preview it as you edit.", + "keywords": [ "embed" ], + "textdomain": "default", "attributes": { "content": { "type": "string", diff --git a/packages/block-library/src/html/index.js b/packages/block-library/src/html/index.js index 43f0975f9a1305..cb1fb915ee8b5a 100644 --- a/packages/block-library/src/html/index.js +++ b/packages/block-library/src/html/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { html as icon } from '@wordpress/icons'; /** @@ -17,10 +17,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Custom HTML', 'block title' ), - description: __( 'Add custom HTML code and preview it as you edit.' ), icon, - keywords: [ __( 'embed' ) ], example: { attributes: { content: diff --git a/packages/block-library/src/image/block.json b/packages/block-library/src/image/block.json index 6b9fb6443a2362..9cb1901028c9da 100644 --- a/packages/block-library/src/image/block.json +++ b/packages/block-library/src/image/block.json @@ -1,7 +1,11 @@ { "apiVersion": 2, "name": "core/image", + "title": "Image", "category": "media", + "description": "Insert an image to make a visual statement.", + "keywords": [ "img", "photo", "picture" ], + "textdomain": "default", "attributes": { "align": { "type": "string" @@ -81,6 +85,14 @@ "radius": true } }, + "styles": [ + { + "name": "default", + "label": "Default", + "isDefault": true + }, + { "name": "rounded", "label": "Rounded" } + ], "editorStyle": "wp-block-image-editor", "style": "wp-block-image" } diff --git a/packages/block-library/src/image/index.js b/packages/block-library/src/image/index.js index ab8f057d210a05..dcdbd4e76882c1 100644 --- a/packages/block-library/src/image/index.js +++ b/packages/block-library/src/image/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { __, _x } from '@wordpress/i18n'; +import { __ } from '@wordpress/i18n'; import { image as icon } from '@wordpress/icons'; /** @@ -18,14 +18,7 @@ const { name } = metadata; export { metadata, name }; export const settings = { - title: _x( 'Image', 'block title' ), - description: __( 'Insert an image to make a visual statement.' ), icon, - keywords: [ - 'img', // "img" is not translated as it is intended to reflect the HTML tag. - __( 'photo' ), - __( 'picture' ), - ], example: { attributes: { sizeSlug: 'large', @@ -34,14 +27,6 @@ export const settings = { caption: __( 'Mont Blanc appears—still, snowy, and serene.' ), }, }, - styles: [ - { - name: 'default', - label: _x( 'Default', 'block style' ), - isDefault: true, - }, - { name: 'rounded', label: _x( 'Rounded', 'block style' ) }, - ], __experimentalLabel( attributes, { context } ) { if ( context === 'accessibility' ) { const { caption, alt, url } = attributes;