From 937b719418b63d17f46017457a53e6f717f8c84b Mon Sep 17 00:00:00 2001 From: Erick Hitter <git-contrib@ethitter.com> Date: Tue, 28 Jun 2022 21:56:21 -0700 Subject: [PATCH] Fix textdomain --- Gruntfile.js | 2 +- README.md | 8 ++++++- assets/build/index.asset.php | 2 +- assets/build/index.js | 2 +- assets/src/js/index.js | 2 +- assets/src/js/panel-body.js | 6 ++--- automatically-paginate-posts.php | 28 +++++++++++----------- inc/class-block-editor.php | 4 ++-- languages/automatically-paginate-posts.pot | 2 +- readme.txt | 8 ++++++- 10 files changed, 38 insertions(+), 26 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 1a08f06..c9cb9b8 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,7 +7,7 @@ module.exports = function ( grunt ) { addtextdomain: { options: { - textdomain: 'autopaging', + textdomain: 'automatically-paginate-posts', }, update_all_domains: { options: { diff --git a/README.md b/README.md index 97ff3e1..4d1ee46 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Donate link: **Tags:** paginate, nextpage, Quicktag **Requires at least:** 3.4 **Tested up to:** 6.0 -**Stable tag:** 0.3 +**Stable tag:** 0.3.1 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -48,6 +48,9 @@ You can also use the filter `autopaging_post_types` to add support by appending ## Changelog ## +### 0.3.1 ### +* Fix translation support. + ### 0.3 ### * Add support for content authored in block editor (Gutenberg). * Add native block-editor control to replace legacy metabox. @@ -61,6 +64,9 @@ You can also use the filter `autopaging_post_types` to add support by appending ## Upgrade Notice ## +### 0.3.1 ### +Fixes translation support. + ### 0.3 ### Add support for block editor and fix bug that created empty pages. diff --git a/assets/build/index.asset.php b/assets/build/index.asset.php index f27808a..88fcc49 100644 --- a/assets/build/index.asset.php +++ b/assets/build/index.asset.php @@ -1 +1 @@ -<?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '6599c3d81e6a88ab5187'); +<?php return array('dependencies' => array('wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins', 'wp-primitives'), 'version' => '13e15677e0a25c9783f2'); diff --git a/assets/build/index.js b/assets/build/index.js index bf18729..1b5240f 100644 --- a/assets/build/index.js +++ b/assets/build/index.js @@ -1 +1 @@ -(()=>{"use strict";const e=window.wp.element,t=window.wp.editPost,n=window.wp.i18n,a=window.wp.primitives,i=(0,e.createElement)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(a.Path,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"})),o=window.wp.plugins,s=window.wp.components,l=window.wp.compose,g=window.wp.data,{metaKey:c}=autopagingSettings,p=(0,l.compose)([(0,g.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),n=t("content");return{disabled:!!t("meta")[c],hasQuicktag:-1!==n.indexOf("wp:nextpage")}})),(0,g.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{setDisabled:e=>{t({meta:{[c]:!!e}})}}}))])((t=>{let{disabled:a,hasQuicktag:i,setDisabled:o}=t;return(0,e.createElement)(e.Fragment,null,i&&(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:(0,n.__)("Autopaging is disabled because the <em>Page Break</em> block is used.","autopaging")}}),!i&&(0,e.createElement)(s.ToggleControl,{label:(0,n.__)("Disable autopaging for this post?","autopaging"),help:(0,n.__)("Check the box above to prevent this post from automatically being split over multiple pages.","autopaging"),checked:a,onChange:o}))})),r="autopaging";(0,o.registerPlugin)(r,{icon:i,render:()=>(0,e.createElement)(t.PluginDocumentSettingPanel,{name:r,title:(0,n.__)("Autopaging","autopaging"),className:r},(0,e.createElement)(p,null))})})(); \ No newline at end of file +(()=>{"use strict";const e=window.wp.element,t=window.wp.editPost,a=window.wp.i18n,i=window.wp.primitives,n=(0,e.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(i.Path,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"})),o=window.wp.plugins,s=window.wp.components,l=window.wp.compose,c=window.wp.data,{metaKey:p}=autopagingSettings,g=(0,l.compose)([(0,c.withSelect)((e=>{const{getEditedPostAttribute:t}=e("core/editor"),a=t("content");return{disabled:!!t("meta")[p],hasQuicktag:-1!==a.indexOf("wp:nextpage")}})),(0,c.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{setDisabled:e=>{t({meta:{[p]:!!e}})}}}))])((t=>{let{disabled:i,hasQuicktag:n,setDisabled:o}=t;return(0,e.createElement)(e.Fragment,null,n&&(0,e.createElement)("p",{dangerouslySetInnerHTML:{__html:(0,a.__)("Autopaging is disabled because the <em>Page Break</em> block is used.","automatically-paginate-posts")}}),!n&&(0,e.createElement)(s.ToggleControl,{label:(0,a.__)("Disable autopaging for this post?","automatically-paginate-posts"),help:(0,a.__)("Check the box above to prevent this post from automatically being split over multiple pages.","automatically-paginate-posts"),checked:i,onChange:o}))})),r="autopaging";(0,o.registerPlugin)(r,{icon:n,render:()=>(0,e.createElement)(t.PluginDocumentSettingPanel,{name:r,title:(0,a.__)("Autopaging","automatically-paginate-posts"),className:r},(0,e.createElement)(g,null))})})(); \ No newline at end of file diff --git a/assets/src/js/index.js b/assets/src/js/index.js index 9131c1b..0584b1c 100644 --- a/assets/src/js/index.js +++ b/assets/src/js/index.js @@ -15,7 +15,7 @@ const slug = 'autopaging'; const View = () => ( <PluginDocumentSettingPanel name={ slug } - title={ __( 'Autopaging', 'autopaging' ) } + title={ __( 'Autopaging', 'automatically-paginate-posts' ) } className={ slug } > <PanelBody /> diff --git a/assets/src/js/panel-body.js b/assets/src/js/panel-body.js index 44b1377..a452c63 100644 --- a/assets/src/js/panel-body.js +++ b/assets/src/js/panel-body.js @@ -23,7 +23,7 @@ const View = ( { disabled, hasQuicktag, setDisabled } ) => ( dangerouslySetInnerHTML={ { __html: __( 'Autopaging is disabled because the <em>Page Break</em> block is used.', - 'autopaging' + 'automatically-paginate-posts' ), } } /> @@ -33,11 +33,11 @@ const View = ( { disabled, hasQuicktag, setDisabled } ) => ( <ToggleControl label={ __( 'Disable autopaging for this post?', - 'autopaging' + 'automatically-paginate-posts' ) } help={ __( 'Check the box above to prevent this post from automatically being split over multiple pages.', - 'autopaging' + 'automatically-paginate-posts' ) } checked={ disabled } onChange={ setDisabled } diff --git a/automatically-paginate-posts.php b/automatically-paginate-posts.php index c65196c..9ab03b1 100644 --- a/automatically-paginate-posts.php +++ b/automatically-paginate-posts.php @@ -5,10 +5,10 @@ * Plugin Name: Automatically Paginate Posts * Plugin URI: http://www.oomphinc.com/plugins-modules/automatically-paginate-posts/ * Description: Automatically inserts the <!--nextpage--> Quicktag into WordPress posts, pages, or custom post type content. - * Version: 0.3 + * Version: 0.3.1 * Author: Erick Hitter & Oomph, Inc. * Author URI: http://www.oomphinc.com/ - * Text Domain: autopaging + * Text Domain: automatically-paginate-posts * Domain Path: /languages/ * * This program is free software; you can redistribute it and/or modify @@ -192,7 +192,7 @@ class Automatically_Paginate_Posts { __METHOD__, esc_html__( 'Post types can only be retrieved after the "init" hook.', - 'autopaging' + 'automatically-paginate-posts' ), '0.3' ); @@ -242,7 +242,7 @@ class Automatically_Paginate_Posts { */ public function load_textdomain() { load_plugin_textdomain( - 'autopaging', + 'automatically-paginate-posts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); @@ -323,9 +323,9 @@ class Automatically_Paginate_Posts { register_setting( 'reading', $this->option_name_num_pages, array( $this, 'sanitize_num_pages' ) ); register_setting( 'reading', $this->option_name_num_words, array( $this, 'sanitize_num_words' ) ); - add_settings_section( 'autopaging', __( 'Automatically Paginate Posts', 'autopaging' ), '__return_false', 'reading' ); - add_settings_field( 'autopaging-post-types', __( 'Supported post types:', 'autopaging' ), array( $this, 'settings_field_post_types' ), 'reading', 'autopaging' ); - add_settings_field( 'autopaging-paging-type', __( 'Split post by:', 'autopaging' ), array( $this, 'settings_field_paging_type' ), 'reading', 'autopaging' ); + add_settings_section( 'autopaging', __( 'Automatically Paginate Posts', 'automatically-paginate-posts' ), '__return_false', 'reading' ); + add_settings_field( 'autopaging-post-types', __( 'Supported post types:', 'automatically-paginate-posts' ), array( $this, 'settings_field_post_types' ), 'reading', 'autopaging' ); + add_settings_field( 'autopaging-paging-type', __( 'Split post by:', 'automatically-paginate-posts' ), array( $this, 'settings_field_paging_type' ), 'reading', 'autopaging' ); } /** @@ -403,8 +403,8 @@ class Automatically_Paginate_Posts { } $labels = array( - 'pages' => __( 'Total number of pages:', 'autopaging' ), - 'words' => __( 'Approximate words per page:', 'autopaging' ), + 'pages' => __( 'Total number of pages:', 'automatically-paginate-posts' ), + 'words' => __( 'Approximate words per page:', 'automatically-paginate-posts' ), ); foreach ( $this->paging_types_allowed as $type ) : @@ -481,7 +481,7 @@ class Automatically_Paginate_Posts { min="1" /> - <p class="description"><?php esc_html_e( 'If chosen, each page will contain approximately this many words, depending on paragraph lengths.', 'autopaging' ); ?></p> + <p class="description"><?php esc_html_e( 'If chosen, each page will contain approximately this many words, depending on paragraph lengths.', 'automatically-paginate-posts' ); ?></p> <?php } @@ -518,7 +518,7 @@ class Automatically_Paginate_Posts { continue; } - add_meta_box( 'autopaging', __( 'Autopaging', 'autopaging' ), array( $this, 'meta_box_autopaging' ), $post_type, 'side' ); + add_meta_box( 'autopaging', __( 'Autopaging', 'automatically-paginate-posts' ), array( $this, 'meta_box_autopaging' ), $post_type, 'side' ); } } @@ -534,17 +534,17 @@ class Automatically_Paginate_Posts { <p> <input type="checkbox" name="<?php echo esc_attr( $this->meta_key_disable_autopaging ); ?>" id="<?php echo esc_attr( $this->meta_key_disable_autopaging ); ?>_checkbox" value="1"<?php checked( (bool) get_post_meta( $post->ID, $this->meta_key_disable_autopaging, true ) ); ?> /> <label for="<?php echo esc_attr( $this->meta_key_disable_autopaging ); ?>_checkbox"> - <?php esc_html_e( 'Disable autopaging for this post?', 'autopaging' ); ?> + <?php esc_html_e( 'Disable autopaging for this post?', 'automatically-paginate-posts' ); ?> </label> </p> - <p class="description"><?php esc_html__( 'Check the box above to prevent this post from automatically being split over multiple pages.', 'autopaging' ); ?></p> + <p class="description"><?php esc_html__( 'Check the box above to prevent this post from automatically being split over multiple pages.', 'automatically-paginate-posts' ); ?></p> <p class="description"> <?php printf( /* translators: 1. Quicktag code example. */ esc_html__( 'Note that if the %1$s Quicktag is used to manually page this post, automatic paging won\'t be applied, regardless of the setting above.', - 'autopaging' + 'automatically-paginate-posts' ), // No need to escape a class constant. // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped diff --git a/inc/class-block-editor.php b/inc/class-block-editor.php index f6e47e4..f912967 100644 --- a/inc/class-block-editor.php +++ b/inc/class-block-editor.php @@ -64,7 +64,7 @@ class Block_Editor { 'default' => false, 'description' => __( 'Whether or not to disable pagination for this post.', - 'autopaging' + 'automatically-paginate-posts' ), 'type' => 'boolean', 'sanitize_callback' => static function ( $value ) { @@ -140,7 +140,7 @@ class Block_Editor { wp_set_script_translations( $asset_handle, - 'autopaging', + 'automatically-paginate-posts', $plugin_base_dir . '/languages' ); } diff --git a/languages/automatically-paginate-posts.pot b/languages/automatically-paginate-posts.pot index 3f48f80..8bd0528 100644 --- a/languages/automatically-paginate-posts.pot +++ b/languages/automatically-paginate-posts.pot @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Automatically Paginate Posts 0.3\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/automatically-paginate-posts\n" -"POT-Creation-Date: 2022-06-29 04:16:26+00:00\n" +"POT-Creation-Date: 2022-06-29 04:55:16+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/readme.txt b/readme.txt index a040fc1..1ba5569 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: Tags: paginate, nextpage, Quicktag Requires at least: 3.4 Tested up to: 6.0 -Stable tag: 0.3 +Stable tag: 0.3.1 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -48,6 +48,9 @@ You can also use the filter `autopaging_post_types` to add support by appending == Changelog == += 0.3.1 = +* Fix translation support. + = 0.3 = * Add support for content authored in block editor (Gutenberg). * Add native block-editor control to replace legacy metabox. @@ -61,6 +64,9 @@ You can also use the filter `autopaging_post_types` to add support by appending == Upgrade Notice == += 0.3.1 = +Fixes translation support. + = 0.3 = Add support for block editor and fix bug that created empty pages. -- GitLab