Skip to content
Snippets Groups Projects
Commit a3be77b5 authored by Erick Hitter's avatar Erick Hitter
Browse files

Merge branch 'fix/i18n' into 'master'

Fix textdomain

See merge request !7
parents 4c96a471 c6f8480f
No related branches found
No related tags found
1 merge request!7Fix textdomain
Pipeline #4980 passed with stages
in 1 minute and 17 seconds
......@@ -7,7 +7,7 @@ module.exports = function ( grunt ) {
addtextdomain: {
options: {
textdomain: 'autopaging',
textdomain: 'automatically-paginate-posts',
},
update_all_domains: {
options: {
......
......@@ -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.
......
<?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');
(()=>{"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
......@@ -15,7 +15,7 @@ const slug = 'autopaging';
const View = () => (
<PluginDocumentSettingPanel
name={ slug }
title={ __( 'Autopaging', 'autopaging' ) }
title={ __( 'Autopaging', 'automatically-paginate-posts' ) }
className={ slug }
>
<PanelBody />
......
......@@ -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 }
......
......@@ -5,10 +5,10 @@
* Plugin Name: Automatically Paginate Posts
* Plugin URI: http://www.oomphinc.com/plugins-modules/automatically-paginate-posts/
* Description: Automatically inserts the &lt;!--nextpage--&gt; 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
......
......@@ -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'
);
}
......
......@@ -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"
......
......@@ -38,7 +38,7 @@
<rule ref="WordPress.WP.I18n">
<properties>
<!-- Value: replace the text domain used. -->
<property name="text_domain" type="array" value="autopaging"/>
<property name="text_domain" type="array" value="automatically-paginate-posts"/>
</properties>
</rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment