-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { __ } = wp.i18n; | ||
const el = wp.element.createElement; | ||
const { registerBlockType } = wp.blocks; | ||
|
||
registerBlockType( 'myguten/simple', { | ||
title: __('Simple Block', 'myguten'), | ||
category: 'widgets', | ||
|
||
edit: function() { | ||
return el( | ||
'p', | ||
{ style: { color:'red'}, }, | ||
__('Hello World', 'myguten') | ||
); | ||
}, | ||
|
||
save: function() { | ||
return el( | ||
'p', | ||
{ style: { color:'red'}, }, | ||
__('Hello World', 'myguten') | ||
); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Plugin Name: Myguten Plugin | ||
* Text Domain: myguten | ||
*/ | ||
function myguten_block_init() { | ||
wp_register_script( | ||
'myguten-script', | ||
plugins_url( 'block.js', __FILE__ ), | ||
array( 'wp-blocks', 'wp-element', 'wp-i18n' ) | ||
); | ||
|
||
register_block_type( 'myguten/simple', array( | ||
'editor_script' => 'myguten-script', | ||
) ); | ||
} | ||
add_action( 'init', 'myguten_block_init' ); | ||
|
||
function myguten_set_script_translations() { | ||
wp_set_script_translations( 'myguten-script', 'myguten', plugin_dir_path( __FILE__ ) . 'languages' ); | ||
} | ||
add_action( 'init', 'myguten_set_script_translations' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"domain": "messages", | ||
"locale_data": { | ||
"messages": { | ||
"": { | ||
"domain": "messages", | ||
"lang": "eo" | ||
}, | ||
"Scratch Plugin": [ | ||
"Scratch kromprogrameto" | ||
], | ||
"Simple Block": [ | ||
"Simpla bloko" | ||
], | ||
"Hello World": [ | ||
"Howdy mundo" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (C) 2019 | ||
# This file is distributed under the same license as the Scratch Plugin plugin. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Scratch Plugin\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/scratch\n" | ||
"Last-Translator: Marcus Kazmierczak <[email protected]>\n" | ||
"Language-Team: Esperanto <[email protected]>\n" | ||
"Language: eo\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"POT-Creation-Date: 2019-02-18T07:20:46-08:00\n" | ||
"PO-Revision-Date: 2019-02-18 08:16-0800\n" | ||
"X-Generator: Poedit 2.2.1\n" | ||
"X-Domain: myguten\n" | ||
|
||
#. Plugin Name of the plugin | ||
msgid "Scratch Plugin" | ||
msgstr "Scratch kromprogrameto" | ||
|
||
#: block.js:6 | ||
msgid "Simple Block" | ||
msgstr "Simpla bloko" | ||
|
||
#: block.js:13 block.js:21 | ||
msgid "Hello World" | ||
msgstr "Saltuon mundo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright (C) 2019 | ||
# This file is distributed under the same license as the Myguten Plugin plugin. | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Myguten Plugin\n" | ||
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/i18n\n" | ||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | ||
"Language-Team: LANGUAGE <[email protected]>\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: 8bit\n" | ||
"POT-Creation-Date: 2019-03-11T11:22:59+01:00\n" | ||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | ||
"X-Generator: WP-CLI 2.1.0\n" | ||
"X-Domain: myguten\n" | ||
|
||
#. Plugin Name of the plugin | ||
msgid "Myguten Plugin" | ||
msgstr "" | ||
|
||
#: block.js:6 | ||
msgid "Simple Block" | ||
msgstr "" | ||
|
||
#: block.js:13 | ||
#: block.js:21 | ||
msgid "Hello World" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "myguten-plugin", | ||
"version": "1.0.0", | ||
"description": "Example WordPress plugin to demonstrate how to work with i18n.", | ||
"main": "block.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nosolosw/blocksettingsmenu-plugin.git" | ||
}, | ||
"author": "", | ||
"license": "GPL-3.0", | ||
"bugs": { | ||
"url": "https://github.com/nosolosw/blocksettingsmenu-plugin/issues" | ||
}, | ||
"homepage": "https://github.com/nosolosw/blocksettingsmenu-plugin#readme", | ||
"devDependencies": { | ||
"po2json": "1.0.0-alpha" | ||
} | ||
} |