mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-26 00:04:28 +00:00
Blocks: Add i18n support to register_block_type_from_metadata
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/23636. Related WP-CLI PR: https://github.com/wp-cli/i18n-command/pull/210. Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field. Props swissspidy, ocean90. Fixes #52301. git-svn-id: https://develop.svn.wordpress.org/trunk@49981 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
6
tests/phpunit/data/blocks/notice/block.asset.php
Normal file
6
tests/phpunit/data/blocks/notice/block.asset.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
'dependencies' => array(),
|
||||
'version' => 'test',
|
||||
);
|
||||
1
tests/phpunit/data/blocks/notice/block.css
Normal file
1
tests/phpunit/data/blocks/notice/block.css
Normal file
@@ -0,0 +1 @@
|
||||
/* Test CSS file */
|
||||
1
tests/phpunit/data/blocks/notice/block.js
Normal file
1
tests/phpunit/data/blocks/notice/block.js
Normal file
@@ -0,0 +1 @@
|
||||
/* Test JavaScript file. */
|
||||
53
tests/phpunit/data/blocks/notice/block.json
Normal file
53
tests/phpunit/data/blocks/notice/block.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "tests/notice",
|
||||
"title": "Notice",
|
||||
"category": "common",
|
||||
"parent": [
|
||||
"core/group"
|
||||
],
|
||||
"providesContext": {
|
||||
"tests/message": "message"
|
||||
},
|
||||
"usesContext": [
|
||||
"groupId"
|
||||
],
|
||||
"icon": "star",
|
||||
"description": "Shows warning, error or success notices…",
|
||||
"keywords": [
|
||||
"alert",
|
||||
"message"
|
||||
],
|
||||
"textdomain": "notice",
|
||||
"attributes": {
|
||||
"message": {
|
||||
"type": "string",
|
||||
"source": "html",
|
||||
"selector": ".message"
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
"align": true,
|
||||
"lightBlockWrapper": true
|
||||
},
|
||||
"styles": [
|
||||
{
|
||||
"name": "default",
|
||||
"label": "Default",
|
||||
"isDefault": true
|
||||
},
|
||||
{
|
||||
"name": "other",
|
||||
"label": "Other"
|
||||
}
|
||||
],
|
||||
"example": {
|
||||
"attributes": {
|
||||
"message": "This is a notice!"
|
||||
}
|
||||
},
|
||||
"editorScript": "tests-notice-editor-script",
|
||||
"script": "tests-notice-script",
|
||||
"editorStyle": "tests-notice-editor-style",
|
||||
"style": "tests-notice-style"
|
||||
}
|
||||
BIN
tests/phpunit/data/languages/plugins/notice-pl_PL.mo
Normal file
BIN
tests/phpunit/data/languages/plugins/notice-pl_PL.mo
Normal file
Binary file not shown.
43
tests/phpunit/data/languages/plugins/notice-pl_PL.po
Normal file
43
tests/phpunit/data/languages/plugins/notice-pl_PL.po
Normal file
@@ -0,0 +1,43 @@
|
||||
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"
|
||||
"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-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;"
|
||||
"_nx_noop:1,2,3c;esc_attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;"
|
||||
"esc_html_x:1,2c\n"
|
||||
"X-Textdomain-Support: yes\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
|
||||
msgctxt "block title"
|
||||
msgid "Notice"
|
||||
msgstr "Powiadomienie"
|
||||
|
||||
msgctxt "block description"
|
||||
msgid "Shows warning, error or success notices…"
|
||||
msgstr "Wyświetla ostrzeżenie, błąd lub powiadomienie o sukcesie…"
|
||||
|
||||
msgctxt "block keyword"
|
||||
msgid "alert"
|
||||
msgstr "ostrzeżenie"
|
||||
|
||||
msgctxt "block keyword"
|
||||
msgid "message"
|
||||
msgstr "wiadomość"
|
||||
|
||||
msgctxt "block style label"
|
||||
msgid "Default"
|
||||
msgstr "Domyślny"
|
||||
|
||||
msgctxt "block style label"
|
||||
msgid "Other"
|
||||
msgstr "Inny"
|
||||
Reference in New Issue
Block a user