Blocks: Add support for variations in block.json` file

We integrated variations with block types and the corresponding REST API endpoint in #52688. It's a follow-up patch to add missing support to the `block.json` metadata file when using `register_block_type`.

Some fields for variations are translatable.Therefore, i18n schema was copied over from Gutenberg: https://github.com/WordPress/gutenberg/blob/trunk/packages/blocks/src/api/i18n-block.json. The accompanying implementation was adapted as `translate_settings_using_i18n_schema`.

Props: gwwar, swissspidy, schlessera, jorgefilipecosta.
Fixes #53238.



git-svn-id: https://develop.svn.wordpress.org/trunk@51599 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Greg Ziółkowski
2021-08-11 09:06:31 +00:00
parent 9b565f7907
commit d9599addd1
11 changed files with 326 additions and 244 deletions

View File

@@ -2,12 +2,12 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2015-12-31 16:31+0100\n"
"PO-Revision-Date: 2021-01-14 18:26+0100\n"
"PO-Revision-Date: 2021-07-15 13:36+0200\n"
"Language: pl_PL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"X-Generator: Poedit 3.0\n"
"X-Poedit-Basepath: .\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;"
@@ -41,3 +41,15 @@ msgstr "Domyślny"
msgctxt "block style label"
msgid "Other"
msgstr "Inny"
msgctxt "block variation title"
msgid "Error"
msgstr "Błąd"
msgctxt "block variation description"
msgid "Shows error."
msgstr "Wyświetla błąd."
msgctxt "block variation keyword"
msgid "failure"
msgstr "niepowodzenie"