Changeset 2100104
- Timestamp:
- 06/04/2019 02:18:15 AM (7 years ago)
- Location:
- notwiz-ruby-text/trunk
- Files:
-
- 7 edited
-
App/Common/Text_Domain.php (modified) (1 diff)
-
App/Controller/Editor.php (modified) (4 diffs)
-
App/Settings/Plugin.php (modified) (1 diff)
-
Readme.txt (modified) (2 diffs)
-
languages/notwiz-ruby-text-ja-notwiz-ruby-text-editor.json (modified) (1 diff)
-
languages/notwiz-ruby-text-ja.mo (modified) (previous)
-
notwiz-ruby-text.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
notwiz-ruby-text/trunk/App/Common/Text_Domain.php
r2065446 r2100104 17 17 $_settings_plugin->text_domain, 18 18 false, 19 $_settings_plugin->plugin_dir_path. $_settings_plugin->domain_path19 basename( $_settings_plugin->dir_path ) . $_settings_plugin->domain_path 20 20 ); 21 22 21 } 23 22 24 public static function _load_textdomain_mofile( $_mo file, $_domain ) {23 public static function _load_textdomain_mofile( $_mo_file, $_domain ) { 25 24 $_settings_plugin = Settings\Plugin::_instance(); 26 25 if ( $_settings_plugin->text_domain === $_domain ) { 27 $_mo filename = basename( $_mofile );28 $_local_mo file = $_settings_plugin->plugin_dir_path . $_settings_plugin->domain_path . '/' . $_mofilename;29 if ( file_exists( $_local_mofile ) ) {30 return $_local_mo file;26 $_mo_file_name = basename( $_mo_file ); 27 $_local_mo_file = $_settings_plugin->dir_path . $_settings_plugin->domain_path . '/' . $_mo_file_name; 28 if ( is_file( $_local_mo_file ) ) { 29 return $_local_mo_file; 31 30 } 32 31 } 33 return $_mo file;32 return $_mo_file; 34 33 } 35 34 -
notwiz-ruby-text/trunk/App/Controller/Editor.php
r2065446 r2100104 2 2 namespace NotWiz_Ruby_Text\App\Controller; 3 3 4 use NotWiz_Ruby_Text\App\Common;5 4 use NotWiz_Ruby_Text\App\Settings; 6 5 … … 8 7 9 8 function __construct() { 10 add_action( 'enqueue_block_editor_assets', [ __CLASS__, '_enqueue_block_editor_assets' ] ); 9 add_action( 10 'enqueue_block_editor_assets', 11 [ __CLASS__, '_enqueue_block_editor_assets' ] 12 ); 11 13 } 12 14 … … 15 17 wp_enqueue_script( 16 18 'notwiz-ruby-text-editor', 17 $_settings_plugin-> plugin_dir_url . '/dist/js/notwiz-ruby-text-build.js',19 $_settings_plugin->dir_url . '/build/js/notwiz-ruby-text.min.js', 18 20 [ 19 21 'wp-blocks', … … 21 23 'wp-i18n', 22 24 ], 23 filemtime( $_settings_plugin->plugin_dir_path . '/dist/js/notwiz-ruby-text-build.js' ),25 $_settings_plugin->version, 24 26 true 25 27 ); 26 28 wp_enqueue_style( 27 29 'notwiz-ruby-text-editor', 28 $_settings_plugin-> plugin_dir_url . '/dist/css/notwiz-ruby-text.min.css',30 $_settings_plugin->dir_url . '/build/css/notwiz-ruby-text.min.css', 29 31 [ 30 32 ], 31 filemtime( $_settings_plugin->plugin_dir_path . '/dist/css/notwiz-ruby-text.min.css' )33 $_settings_plugin->version 32 34 ); 33 if ( function_exists( 'wp_set_script_translations' ) ) { 34 wp_set_script_translations( 35 'notwiz-ruby-text-editor', 36 $_settings_plugin->text_domain, 37 $_settings_plugin->plugin_dir_path . $_settings_plugin->domain_path 38 ); 39 } elseif ( function_exists( 'gutenberg_get_jed_locale_data' ) ) { 40 $_locale = gutenberg_get_jed_locale_data( $_settings_plugin->text_domain ); 41 $_content = 'wp.i18n.setLocaleData( ' . json_encode( $_locale ) . ', "' . $_settings_plugin->text_domain . '" );'; 42 wp_add_inline_script( 43 'notwiz-ruby-text-editor', 44 'data', 45 $_content 46 ); 47 } 35 wp_set_script_translations( 36 'notwiz-ruby-text-editor', 37 $_settings_plugin->text_domain, 38 $_settings_plugin->dir_path . $_settings_plugin->domain_path 39 ); 48 40 } 49 41 -
notwiz-ruby-text/trunk/App/Settings/Plugin.php
r2065446 r2100104 27 27 28 28 function _init_settings( $_info_settings = [] ) { 29 $this-> plugin_root_file = $_info_settings[ 'root_file' ];30 $this-> plugin_dir_url= untrailingslashit( plugin_dir_url( $_info_settings[ 'root_file' ] ) );31 $this-> plugin_dir_path= untrailingslashit( plugin_dir_path( $_info_settings[ 'root_file' ] ) );32 33 $this-> plugin_name = $_info_settings[ 'plugin_name' ];34 $this->version = $_info_settings[ 'version' ];29 $this->root_file = $_info_settings[ 'root_file' ]; 30 $this->dir_url = untrailingslashit( plugin_dir_url( $_info_settings[ 'root_file' ] ) ); 31 $this->dir_path = untrailingslashit( plugin_dir_path( $_info_settings[ 'root_file' ] ) ); 32 $this->name = $_info_settings[ 'plugin_name' ]; 33 $this->description = $_info_settings[ 'description' ]; 34 $this->version = $_info_settings[ 'version' ]; 35 35 $this->php_version = $_info_settings[ 'php_version' ]; 36 36 $this->text_domain = $_info_settings[ 'text_domain' ]; 37 37 $this->domain_path = $_info_settings[ 'domain_path' ]; 38 $this->author = $_info_settings[ 'author' ]; 39 $this->author_uri = $_info_settings[ 'author_uri' ]; 40 $this->license = $_info_settings[ 'license' ]; 41 $this->license_uri = $_info_settings[ 'license_uri' ]; 38 42 } 39 43 -
notwiz-ruby-text/trunk/Readme.txt
r2065446 r2100104 2 2 Contributors: kmix39 3 3 Tags: gutenberg, block, blocks, editor, gutenberg blocks, Ruby Text, RichText 4 Requires at least: 5. 15 Tested up to: 5. 1.16 Stable tag: 0.1.14 Requires at least: 5.2 5 Tested up to: 5.2.1 6 Stable tag: 1.1.0 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 46 46 == Changelog == 47 47 48 = 1.1.0 = 49 * Bug fix. 50 48 51 = 0.1.1 = 49 52 * Initial release. -
notwiz-ruby-text/trunk/languages/notwiz-ruby-text-ja-notwiz-ruby-text-editor.json
r2065446 r2100104 1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"Ruby Parentheses":["ルビの括弧"],"Ruby Text":["ルビのテキスト"],"Ruby":["ルビ"],"Choose a string to decorate ruby text":["ルビテキストを装飾する文字列を選択してください"],"Can not select the last character in the text to decorate ruby text":[" テキストの最終文字は、ルビテキストの装飾に選択できません"],"The decoration may have already been removed":["装飾は既に削除されている可能性があります"],"Ruby text has not been entered":["ルビテキストが入力されていません"],"Enter ruby text":["ルビのテキストを入力"],"Apply":["適用"],"Warning":["警告"],"NotWiz Ruby Text":["NotWiz Ruby Text"],"Ruby Text for Gutenberg Block Editor":["ブロックエディター用のルビテキスト"],"kmix39":["kmix39"],"https://not-wiz.net/":["https://not-wiz.net/"]}}}1 {"domain":"messages","locale_data":{"messages":{"":{"domain":"messages","plural_forms":"nplurals=1; plural=0;","lang":"ja_JP"},"Ruby Parentheses":["ルビの括弧"],"Ruby Text":["ルビのテキスト"],"Ruby":["ルビ"],"Choose a string to decorate ruby text":["ルビテキストを装飾する文字列を選択してください"],"Can not select the last character in the text to decorate ruby text":["現在のバージョンでは、ルビテキストの装飾にテキストの最終文字を選択できません"],"The decoration may have already been removed":["装飾は既に削除されている可能性があります"],"Enter ruby text":["ルビのテキストを入力"],"Apply":["適用"],"Warning":["警告"],"NotWiz Ruby Text":["NotWiz Ruby Text"],"Ruby Text for Block Editor(Gutenberg)":["ブロックエディター(Gutenberg)用のルビテキスト"],"kmix39":["kmix39"],"https://not-wiz.net":["https://not-wiz.net"]}}} -
notwiz-ruby-text/trunk/notwiz-ruby-text.php
r2065446 r2100104 2 2 /** 3 3 * Plugin Name: NotWiz Ruby Text 4 * Description: Ruby Text for Gutenberg Block Editor5 * Version: 0.1.14 * Description: Ruby Text for Block Editor(Gutenberg) 5 * Version: 1.1.0 6 6 * PHP Version: 7.0.0 7 7 * Text Domain: notwiz-ruby-text 8 8 * Domain Path: /languages 9 9 * Author: kmix39 10 * Author URI: https://not-wiz.net /10 * Author URI: https://not-wiz.net 11 11 * License: GPLv2 or later 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 34 34 [ 35 35 'plugin_name' => 'Plugin Name', 36 'description' => 'Description', 36 37 'version' => 'Version', 37 38 'php_version' => 'PHP Version', 38 39 'text_domain' => 'Text Domain', 39 40 'domain_path' => 'Domain Path', 41 'author' => 'Author', 42 'author_uri' => 'Author URI', 43 'license' => 'License', 44 'license_uri' => 'License URI', 40 45 ] 41 46 ); … … 52 57 } 53 58 54 require_once( __DIR__ . '/App/Common/Editor.php' );55 59 require_once( __DIR__ . '/App/Common/Text_Domain.php' ); 56 60 require_once( __DIR__ . '/App/Controller/Editor.php' );
Note: See TracChangeset
for help on using the changeset viewer.