开发者 | emunthe |
---|---|
更新时间 | 2021年1月21日 06:08 |
PHP版本: | 5.5 及以上 |
WordPress版本: | 5.6 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
insert-block-pattern-block.zip
to the /wp-content/plugins/
directorypackage.json
, webpack.config.js
is included.
Note: copy this into a .babelrc file at plugins/insert-block-pattern-block/.babelrc
{ "presets": ["@babel/preset-env", "@babel/preset-react"], "plugins": [ "@babel/plugin-syntax-dynamic-import", "@babel/plugin-proposal-class-properties" ] }
To install and build:
plugins/insert-block-pattern-block/$ npm i
plugins/insert-block-pattern-block/$ npm run build
Creating language files
plugins/ipbp/
$ wp i18n make-json languages/ibpb-<LOCALE\>.po --no-purge
This produces a 2 json file with a hash strings.
It does not currently work directly by adding these 2 files - they must be combined into a new json file:
Copy one of the 2 generated files to:
ibpb-<LOCALE\>-ibpb_blocks_registration.json
Combine the messages into one file
"locale_data": { "messages": { <MESSAGES HERE> }}
Rename the source line to:
"source": "ibpb_blocks_registration.js"
,
This should end up with a file something like this:
plugins/insert-block-pattern-block/languages/ibpb-<LOCALE\>-ibpb_blocks_registration.json
{ "translation-revision-date": "2021-01-17 10:27+0100", "generator": "WP-CLI/2.2.0", "source": "ibpb_blocks_registration.js", "domain": "messages", "locale_data": { "messages": { "": { "domain": "messages", "lang": "nb_NO", "plural-forms": "nplurals=2; plural=(n != 1);" }, "Block for inserting a Block Pattern": [ "Blokk for \u00e5 sette inn ett blokkm\u00f8nster" ], "Block Pattern": ["Blokkm\u00f8nster"], "Insert Block Pattern": ["Sett inn Blokkm\u00f8nster"], "Select a Block Pattern Category": ["Velg kategori"], "Uncategorized": ["Ukategorisert"], "Select a Block Pattern": ["Velg Blokk m\u00f8nster"] } } }
Yes.
Yes.
The plugin will be maintained until the Block Pattern Library is extended with similar functionality. The plugin is used in production but will be kept as simple as possible.
Yes. There is a pot file included. It is tranlated to Norwegian.
Yes.