Skip to content

Commit

Permalink
fix: text-domain
Browse files Browse the repository at this point in the history
  • Loading branch information
drill-lancer committed May 29, 2023
1 parent 14665da commit 7ce05f2
Show file tree
Hide file tree
Showing 214 changed files with 1,259 additions and 2,579 deletions.
10 changes: 5 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ const notify = require('gulp-notify');
gulp.task('text-domain', (done) => {
// vk-admin.
gulp.src(['./inc/vk-admin/package/*.php'])
.pipe(replace("'vk_admin_textdomain'", "'vk-blocks'"))
.pipe(replace("'vk_admin_textdomain'", "'vk-blocks-pro'"))
.pipe(gulp.dest('./inc/vk-admin/package/'));
// font-awesome.
gulp.src(['./inc/font-awesome/package/*.php'])
.pipe(replace("'vk_font_awesome_version_textdomain'", "'vk-blocks'"))
.pipe(replace("'vk_font_awesome_version_textdomain'", "'vk-blocks-pro'"))
.pipe(gulp.dest('./inc/font-awesome/package/'));
// term-color.
gulp.src(['./inc/term-color/package/*.php'])
.pipe(replace("'vk_term_color_textdomain'", "'vk-blocks'"))
.pipe(replace("'vk_term_color_textdomain'", "'vk-blocks-pro'"))
.pipe(gulp.dest('./inc/term-color/package/'));
// vk-components.
gulp.src(['./inc/vk-components/package/*.php'])
.pipe(replace("'vk_components_textdomain'", "'vk-blocks'"))
.pipe(replace("'vk_components_textdomain'", "'vk-blocks-pro'"))
.pipe(gulp.dest('./inc/vk-components/package/'));
gulp.src(['./inc/vk-css-optimize/package/*.php'])
.pipe(replace("'css_optimize_textdomain'", "'vk-blocks'"))
.pipe(replace("'css_optimize_textdomain'", "'vk-blocks-pro'"))
.pipe(gulp.dest('./inc/vk-css-optimize/package/'));
done();
});
Expand Down
12 changes: 6 additions & 6 deletions inc/admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function vk_blocks_admin_notice_pro() {
<div id="notice-vkblocks-pro" class="notice notice-success is-dismissible">
<p>
<strong>
<?php esc_html_e( 'We\'ve released VK Blocks Pro!', 'vk-blocks' ); ?>
<?php esc_html_e( 'We\'ve released VK Blocks Pro!', 'vk-blocks-pro' ); ?>
</strong>
</p>
<p>
Expand All @@ -34,19 +34,19 @@ function vk_blocks_admin_notice_pro() {
/* translators: 1: opening a tag, 2: closing a tag */
esc_html__(
'Thank you for using VK Blocks. We\'ve released VK Blocks Pro. It has more custom blocks to build web site more easily. If you are interested in VK Blocks Pro, Please read %1$s this post %2$s for more details.',
'vk-blocks'
'vk-blocks-pro'
),
'<a href="' . esc_url( __( 'https://www.vektor-inc.co.jp/service/wordpress-plugins/vk-blocks/', 'vk-blocks' ) ) . '">',
'<a href="' . esc_url( __( 'https://www.vektor-inc.co.jp/service/wordpress-plugins/vk-blocks/', 'vk-blocks-pro' ) ) . '">',
'</a>'
)
?>
</p>
<p>
<a href="<?php echo esc_url( __( 'https://www.vektor-inc.co.jp/service/wordpress-plugins/vk-blocks/', 'vk-blocks' ) ); ?>">
<?php esc_html_e( 'See more', 'vk-blocks' ); ?></a>
<a href="<?php echo esc_url( __( 'https://www.vektor-inc.co.jp/service/wordpress-plugins/vk-blocks/', 'vk-blocks-pro' ) ); ?>">
<?php esc_html_e( 'See more', 'vk-blocks-pro' ); ?></a>
<span> | </span>
<a href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'vkblocks-dismiss-pro', 'dismiss_admin_notice' ), 'vkblocks-dismiss-pro-' . get_current_user_id() ) ); ?>" target="_parent">
<?php esc_html_e( 'Dismiss this notice', 'vk-blocks' ); ?></a>
<?php esc_html_e( 'Dismiss this notice', 'vk-blocks-pro' ); ?></a>
</p>
</div>
<?php
Expand Down
6 changes: 3 additions & 3 deletions inc/term-color/package/class.term-color.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static function taxonomy_add_new_meta_field_color() {
?>
<div class="form-field">
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
<label for="term_color"><?php _e( 'Color', 'vk-blocks' ); ?></label>
<label for="term_color"><?php _e( 'Color', 'vk-blocks-pro' ); ?></label>
<input type="text" name="term_color" id="term_color" class="term_color" value="">
</div>
<?php
Expand All @@ -82,7 +82,7 @@ public static function taxonomy_add_edit_meta_field_color( $term ) {
$term_color = self::get_term_color( $term->term_id );
?>
<tr class="form-field">
<th scope="row" valign="top"><label for="term_color"><?php esc_html_e( 'Color', 'vk-blocks' ); ?></label></th>
<th scope="row" valign="top"><label for="term_color"><?php esc_html_e( 'Color', 'vk-blocks-pro' ); ?></label></th>
<td>
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
<input type="text" name="term_color" id="term_color" class="term_color" value="<?php echo esc_attr( $term_color ); ?>">
Expand Down Expand Up @@ -168,7 +168,7 @@ public static function term_colors_print_scripts() {
*/
public static function edit_term_columns( $columns ) {

$columns['color'] = __( 'Color', 'vk-blocks' );
$columns['color'] = __( 'Color', 'vk-blocks-pro' );

return $columns;
}
Expand Down
46 changes: 23 additions & 23 deletions inc/tgm-plugin-activation/tgm-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,92 +69,92 @@ function vkb_register_required_plugins() {
'message' => '', // Message to output right before the plugins table.

'strings' => array(
'page_title' => __( 'Install Required Plugins', 'vk-blocks' ),
'menu_title' => __( 'Install Plugins', 'vk-blocks' ),
'page_title' => __( 'Install Required Plugins', 'vk-blocks-pro' ),
'menu_title' => __( 'Install Plugins', 'vk-blocks-pro' ),
// translators: %s = plugin name.
'installing' => __( 'Installing Plugin: %s', 'vk-blocks' ),
'oops' => __( 'Something went wrong with the plugin API.', 'vk-blocks' ),
'installing' => __( 'Installing Plugin: %s', 'vk-blocks-pro' ),
'oops' => __( 'Something went wrong with the plugin API.', 'vk-blocks-pro' ),
// translators:
'notice_can_install_required' => _n_noop(
'This plugin requires the following plugin: %1$s.',
'This plugin requires the following plugins: %1$s.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_can_install_recommended' => _n_noop(
'This plugin recommends the following plugin: %1$s.<br>Many additional functions are available for free.',
'This plugin recommends the following plugins: %1$s.<br>Many additional functions are available for free.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_cannot_install' => _n_noop(
'Sorry, but you do not have the correct permissions to install the %1$s plugin.',
'Sorry, but you do not have the correct permissions to install the %1$s plugins.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_ask_to_update' => _n_noop(
'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.',
'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_ask_to_update_maybe' => _n_noop(
'There is an update available for: %1$s.',
'There are updates available for the following plugins: %1$s.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_cannot_update' => _n_noop(
'Sorry, but you do not have the correct permissions to update the %1$s plugin.',
'Sorry, but you do not have the correct permissions to update the %1$s plugins.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_can_activate_required' => _n_noop(
'The following required plugin is currently inactive: %1$s.',
'The following required plugins are currently inactive: %1$s.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_can_activate_recommended' => _n_noop(
'The following recommended plugin is currently inactive: %1$s.',
'The following recommended plugins are currently inactive: %1$s.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'notice_cannot_activate' => _n_noop(
'Sorry, but you do not have the correct permissions to activate the %1$s plugin.',
'Sorry, but you do not have the correct permissions to activate the %1$s plugins.',
'vk-blocks'
'vk-blocks-pro'
),
// translators: %s = plugin name.
'install_link' => _n_noop(
'Begin installing plugin',
'Begin installing plugins',
'vk-blocks'
'vk-blocks-pro'
),
'update_link' => _n_noop(
'Begin updating plugin',
'Begin updating plugins',
'vk-blocks'
'vk-blocks-pro'
),
'activate_link' => _n_noop(
'Begin activating plugin',
'Begin activating plugins',
'vk-blocks'
'vk-blocks-pro'
),
'return' => __( 'Return to Required Plugins Installer', 'vk-blocks' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'vk-blocks' ),
'activated_successfully' => __( 'The following plugin was activated successfully:', 'vk-blocks' ),
'return' => __( 'Return to Required Plugins Installer', 'vk-blocks-pro' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'vk-blocks-pro' ),
'activated_successfully' => __( 'The following plugin was activated successfully:', 'vk-blocks-pro' ),
// translators: %s = plugin name.
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'vk-blocks' ),
'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'vk-blocks-pro' ),
// translators: %s = plugin name.
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'vk-blocks' ),
'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'vk-blocks-pro' ),
// translators: %s = plugin name.
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'vk-blocks' ),
'complete' => __( 'All plugins installed and activated successfully. %1$s', 'vk-blocks-pro' ),
// translators: %s = dashboard link.
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'vk-blocks' ),
'contact_admin' => __( 'Please contact the administrator of this site for help.', 'vk-blocks-pro' ),
'nag_type' => 'updated', // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
),
);
Expand Down
4 changes: 2 additions & 2 deletions inc/vk-blocks-pro/admin-pro/admin-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
* @param string $pro_menu_html pro menu html.
*/
function vk_blocks_pro_menu( $pro_menu_html ) {
$pro_menu_html = '<li><a href="#faq-setting">' . __( 'FAQ Setting', 'vk-blocks' ) . '</a></li>';
$pro_menu_html .= '<li><a href="#custom-css-setting">' . __( 'Custom CSS Setting', 'vk-blocks' ) . '</a></li>';
$pro_menu_html = '<li><a href="#faq-setting">' . __( 'FAQ Setting', 'vk-blocks-pro' ) . '</a></li>';
$pro_menu_html .= '<li><a href="#custom-css-setting">' . __( 'Custom CSS Setting', 'vk-blocks-pro' ) . '</a></li>';
return $pro_menu_html;
}
add_action( 'vk_blocks_pro_menu', 'vk_blocks_pro_menu' );
26 changes: 13 additions & 13 deletions inc/vk-blocks/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function vk_blocks_setting() {
function vk_blocks_setting_menu() {
global $vk_blocks_prefix;
$custom_page = add_options_page(
$vk_blocks_prefix . ' ' . __( 'Blocks setting', 'vk-blocks' ), // Name of page.
$vk_blocks_prefix . ' ' . _x( 'Blocks', 'label in admin menu', 'vk-blocks' ), // Label in menu.
$vk_blocks_prefix . ' ' . __( 'Blocks setting', 'vk-blocks-pro' ), // Name of page.
$vk_blocks_prefix . ' ' . _x( 'Blocks', 'label in admin menu', 'vk-blocks-pro' ), // Label in menu.
'edit_theme_options', // Capability required このメニューページを閲覧・使用するために最低限必要なユーザーレベルまたはユーザーの種類と権限.
'vk_blocks_options', // ユニークなこのサブメニューページの識別子.
'vk_blocks_setting_page' // メニューページのコンテンツを出力する関数.
Expand All @@ -64,25 +64,25 @@ function vk_blocks_setting_menu() {
*/
function vk_blocks_setting_page() {
global $vk_blocks_prefix;
$get_page_title = $vk_blocks_prefix . ' ' . __( 'Blocks Setting', 'vk-blocks' );
$get_page_title = $vk_blocks_prefix . ' ' . __( 'Blocks Setting', 'vk-blocks-pro' );

$get_logo_html = '<img src="' . plugin_dir_url( __FILE__ ) . '/images/vk-blocks-logo_ol.svg" alt="VK Blocks" />';
$get_logo_html = apply_filters( 'vk_blocks_logo_html', $get_logo_html );

$get_menu_html = '';
if ( vk_blocks_is_license_setting() ) {
$get_menu_html .= '<li><a href="#license-setting">' . __( 'License Key', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#license-setting">' . __( 'License Key', 'vk-blocks-pro' ) . '</a></li>';
}
$get_menu_html .= '<li><a href="#balloon-setting">' . __( 'Balloon Block Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#balloon-setting">' . __( 'Balloon Block Setting', 'vk-blocks-pro' ) . '</a></li>';
if ( vk_blocks_is_pro() ) {
$get_menu_html .= '<li><a href="#custom-format-setting">' . __( 'Custom Format Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#custom-block-style-setting">' . __( 'Custom Block Style Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#custom-format-setting">' . __( 'Custom Format Setting', 'vk-blocks-pro' ) . '</a></li>';
$get_menu_html .= '<li><a href="#custom-block-style-setting">' . __( 'Custom Block Style Setting', 'vk-blocks-pro' ) . '</a></li>';
}
$get_menu_html .= '<li><a href="#margin-setting">' . __( 'Common Margin Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#load-separete-setting">' . __( 'Load Separete Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#margin-setting">' . __( 'Common Margin Setting', 'vk-blocks-pro' ) . '</a></li>';
$get_menu_html .= '<li><a href="#load-separete-setting">' . __( 'Load Separete Setting', 'vk-blocks-pro' ) . '</a></li>';
$get_menu_html .= apply_filters( 'vk_blocks_pro_menu', '' );
$get_menu_html .= '<li><a href="#block-manager-setting">' . __( 'Block Manager Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#block-style-manager-setting">' . __( 'Block Style Manager Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#block-manager-setting">' . __( 'Block Manager Setting', 'vk-blocks-pro' ) . '</a></li>';
$get_menu_html .= '<li><a href="#block-style-manager-setting">' . __( 'Block Style Manager Setting', 'vk-blocks-pro' ) . '</a></li>';

VkAdmin::admin_page_frame( $get_page_title, 'vk_blocks_setting', $get_logo_html, $get_menu_html );
}
Expand All @@ -97,7 +97,7 @@ function vk_blocks_setting_page() {
*/
function vk_blocks_add_setting_link( $links, $file ) {
if ( plugin_basename( VK_BLOCKS_DIR_PATH . '/vk-blocks.php' ) === $file ) {
$settings_link = '<a href="' . esc_url( admin_url( '/options-general.php?page=vk_blocks_options' ) ) . '">' . __( 'Setting', 'vk-blocks' ) . '</a>';
$settings_link = '<a href="' . esc_url( admin_url( '/options-general.php?page=vk_blocks_options' ) ) . '">' . __( 'Setting', 'vk-blocks-pro' ) . '</a>';
array_unshift( $links, $settings_link );
}
return $links;
Expand Down Expand Up @@ -131,7 +131,7 @@ function vk_blocks_options_enqueue_scripts( $hook_suffix ) {
$asset['version'],
true
);
wp_set_script_translations( 'vk-blocks-admin-js', 'vk-blocks', VK_BLOCKS_DIR_PATH . 'inc/vk-blocks/languages' );
wp_set_script_translations( 'vk-blocks-admin-js', 'vk-blocks-pro', VK_BLOCKS_DIR_PATH . 'languages' );

$block_categories = get_block_categories( get_post() );
wp_add_inline_script(
Expand Down
6 changes: 3 additions & 3 deletions inc/vk-blocks/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function vk_blocks_blocks_categories( $categories, $post ) {
array(
array(
'slug' => 'vk-blocks-cat',
'title' => $vk_blocks_prefix . __( 'Blocks', 'vk-blocks' ),
'title' => $vk_blocks_prefix . __( 'Blocks', 'vk-blocks-pro' ),
'icon' => '',
),
)
Expand All @@ -37,7 +37,7 @@ function vk_blocks_blocks_categories( $categories, $post ) {
array(
array(
'slug' => 'vk-blocks-cat-layout',
'title' => $vk_blocks_prefix . __( 'Blocks Layout', 'vk-blocks' ),
'title' => $vk_blocks_prefix . __( 'Blocks Layout', 'vk-blocks-pro' ),
'icon' => '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="none" d="M0 0h24v24H0V0z" /><path d="M19 13H5v-2h14v2z" /></svg>',
),
)
Expand All @@ -50,7 +50,7 @@ function vk_blocks_blocks_categories( $categories, $post ) {
array(
array(
'slug' => 'vk-blocks-cat-deprecated',
'title' => $vk_blocks_prefix . __( 'Deprecated Blocks', 'vk-blocks' ),
'title' => $vk_blocks_prefix . __( 'Deprecated Blocks', 'vk-blocks-pro' ),
'icon' => '',
),
)
Expand Down
2 changes: 1 addition & 1 deletion inc/vk-blocks/class-vk-blocks-block-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function register_blocks_assets() {

// 翻訳を追加.
if ( function_exists( 'wp_set_script_translations' ) ) {
wp_set_script_translations( 'vk-blocks-build-js', 'vk-blocks', plugin_dir_path( __FILE__ ) . 'languages' );
wp_set_script_translations( 'vk-blocks-build-js', 'vk-blocks-pro', VK_BLOCKS_DIR_PATH . 'languages' );
}

// 各ブロックを読み込む(一括/分割共通).
Expand Down
Loading

0 comments on commit 7ce05f2

Please sign in to comment.