Commit 33ec196c authored by Erick Hitter's avatar Erick Hitter
Browse files

Fix translation support

parent c340f869
......@@ -9,7 +9,7 @@ module.exports = function( grunt ) {
addtextdomain: {
options: {
textdomain: 'wp_print_friendly',
textdomain: 'wp-print-friendly',
},
update_all_domains: {
options: {
......
......@@ -4,7 +4,7 @@
**Tags:** print, template, printer, printable
**Requires at least:** 3.1
**Tested up to:** 6.0
**Stable tag:** 0.6.2
**Stable tag:** 0.6.3
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
......@@ -59,6 +59,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
## Changelog ##
### 0.6.3 ###
* Fix translation support.
### 0.6.2 ###
* PHP 7.3 compatibility.
......@@ -154,6 +157,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
## Upgrade Notice ##
### 0.6.3 ###
Fixes translation support.
### 0.6.2 ###
Resolves a warning arising in PHP 7.3.
......
......@@ -2,10 +2,10 @@
# This file is distributed under the same license as the WP Print Friendly package.
msgid ""
msgstr ""
"Project-Id-Version: WP Print Friendly 0.6.2\n"
"Project-Id-Version: WP Print Friendly 0.6.3\n"
"Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/wp-print-friendly\n"
"POT-Creation-Date: 2022-06-11 18:14:57+00:00\n"
"POT-Creation-Date: 2022-06-25 20:55:28+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
......@@ -25,113 +25,113 @@ msgstr ""
"X-Textdomain-Support: yes\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"
#: wp-print-friendly.php:121
#: wp-print-friendly.php:128
msgid "Print this entry"
msgstr ""
#: wp-print-friendly.php:122
#: wp-print-friendly.php:129
msgid "Print this page"
msgstr ""
#: wp-print-friendly.php:126
#: wp-print-friendly.php:133
msgid "Endnotes:"
msgstr ""
#: wp-print-friendly.php:671
#: wp-print-friendly.php:678
msgid "Automatically add print links based on settings below?"
msgstr ""
#: wp-print-friendly.php:673 wp-print-friendly.php:737
#: wp-print-friendly.php:680 wp-print-friendly.php:744
msgid "Yes"
msgstr ""
#: wp-print-friendly.php:674
#: wp-print-friendly.php:681
msgid "No"
msgstr ""
#: wp-print-friendly.php:678
#: wp-print-friendly.php:685
msgid "Automatically place link:"
msgstr ""
#: wp-print-friendly.php:680
#: wp-print-friendly.php:687
msgid "Above content"
msgstr ""
#: wp-print-friendly.php:681
#: wp-print-friendly.php:688
msgid "Below content"
msgstr ""
#: wp-print-friendly.php:682
#: wp-print-friendly.php:689
msgid "Above and below content"
msgstr ""
#: wp-print-friendly.php:686
#: wp-print-friendly.php:693
msgid "Display automatically on:"
msgstr ""
#: wp-print-friendly.php:699
#: wp-print-friendly.php:706
msgid "Text for link to print entire item:"
msgstr ""
#: wp-print-friendly.php:705
#: wp-print-friendly.php:712
msgid "Text for link to print current page:"
msgstr ""
#: wp-print-friendly.php:709
#: wp-print-friendly.php:716
msgid ""
"If viewing a multipage post (set by using the <!--nextpage--> tag), "
"the text above is used for a link to print just the current page."
msgstr ""
#: wp-print-friendly.php:710
#: wp-print-friendly.php:717
msgid "<strong>To hide this link,</strong> clear the field's contents."
msgstr ""
#: wp-print-friendly.php:714
#: wp-print-friendly.php:721
msgid "CSS for print links:"
msgstr ""
#: wp-print-friendly.php:718
#: wp-print-friendly.php:725
msgid ""
"For page-specific print links, a second class, created by appending "
"<strong>_cur</strong> to the above text, is added to each link."
msgstr ""
#: wp-print-friendly.php:719
#: wp-print-friendly.php:726
msgid ""
"Be aware that Internet Explorer will only interpret the first two CSS "
"classes, so if multiple classes are entered above, the page-specific class "
"may not be available in IE."
msgstr ""
#: wp-print-friendly.php:723
#: wp-print-friendly.php:730
msgid "Open print-friendly views:"
msgstr ""
#: wp-print-friendly.php:725
#: wp-print-friendly.php:732
msgid "In the same window"
msgstr ""
#: wp-print-friendly.php:726
#: wp-print-friendly.php:733
msgid "In a new window"
msgstr ""
#: wp-print-friendly.php:735
#: wp-print-friendly.php:742
msgid "Include endnotes for links found in content?"
msgstr ""
#: wp-print-friendly.php:739
#: wp-print-friendly.php:746
msgid ""
"If enabled, content is automatically scanned for links and an endnote is "
"added for each link found. This can be helpful for users if your content "
"includes many links."
msgstr ""
#: wp-print-friendly.php:743
#: wp-print-friendly.php:750
msgid "Endnotes heading:"
msgstr ""
#: wp-print-friendly.php:747
#: wp-print-friendly.php:754
msgid ""
"If endnotes are enabled, the text entered above will be output above the "
"list of links."
......@@ -141,14 +141,14 @@ msgstr ""
msgid "WP Print Friendly"
msgstr ""
#: wp-print-friendly.php:883
#: wp-print-friendly.php:890
msgid ""
"You must refresh your site's permalinks before WP Print Friendly is fully "
"activated. To do so, go to <a href=\"%s\">Permalinks</a> and click the "
"<strong><em>Save Changes</em></strong> button at the bottom of the screen."
msgstr ""
#: wp-print-friendly.php:885
#: wp-print-friendly.php:892
msgid "When finished, click <a href=\"%s\">here</a> to hide this message."
msgstr ""
......
......@@ -4,7 +4,7 @@ Donate link: http://www.thinkoomph.com/plugins-modules/wp-print-friendly/
Tags: print, template, printer, printable
Requires at least: 3.1
Tested up to: 6.0
Stable tag: 0.6.2
Stable tag: 0.6.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -59,6 +59,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Changelog ==
= 0.6.3 =
* Fix translation support.
= 0.6.2 =
* PHP 7.3 compatibility.
......@@ -154,6 +157,9 @@ This plugin is known to conflict with certain plugins, many pertaining to SEO an
== Upgrade Notice ==
= 0.6.3 =
Fixes translation support.
= 0.6.2 =
Resolves a warning arising in PHP 7.3.
......
<?php
// phpcs:ignoreFile -- legacy code in need of refactoring.
/*
Plugin Name: WP Print Friendly
Plugin URI: http://oomphinc.com/plugins-modules/wp-print-friendly/
Description: Extends WordPress' template system to support printer-friendly templates. Works with permalink structures to support nice URLs.
Author: Erick Hitter, Steven K Word, and Oomph, Inc.
Version: 0.6.2
Author URI: http://oomphinc.com/
Text Domain: wp_print_friendly
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* Plugin Name: WP Print Friendly
* Plugin URI: http://oomphinc.com/plugins-modules/wp-print-friendly/
* Description: Extends WordPress' template system to support printer-friendly templates. Works with permalink structures to support nice URLs.
* Author: Erick Hitter, Steven K Word, and Oomph, Inc.
* Version: 0.6.3
* Author URI: http://oomphinc.com/
* Text Domain: wp-print-friendly
* Domain Path: /languages/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class wp_print_friendly {
/**
......@@ -113,17 +114,23 @@ class wp_print_friendly {
* @return null
*/
public function action_plugins_loaded() {
load_plugin_textdomain(
'wp-print-friendly',
false,
dirname( plugin_basename( __FILE__ ) ) . '/languages/'
);
// Populate default settings, with translation support
$this->settings_defaults = array(
'auto' => false,
'placement' => 'below',
'post_types' => array( 'post', 'page' ),
'print_text' => __( 'Print this entry', 'wp_print_friendly' ),
'print_text_page' => __( 'Print this page', 'wp_print_friendly' ),
'print_text' => __( 'Print this entry', 'wp-print-friendly' ),
'print_text_page' => __( 'Print this page', 'wp-print-friendly' ),
'css_class' => 'print_link',
'link_target' => 'same',
'endnotes' => true,
'endnotes_label' => __( 'Endnotes:', 'wp_print_friendly' ),
'endnotes_label' => __( 'Endnotes:', 'wp-print-friendly' ),
);
// Register plugin's remaining actions and filters
......@@ -668,22 +675,22 @@ class wp_print_friendly {
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Automatically add print links based on settings below?', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Automatically add print links based on settings below?', 'wp-print-friendly' ); ?></th>
<td>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[auto]" id="auto-true" value="1"<?php checked( $options[ 'auto' ], true, true ); ?> /> <label for="auto-true"><?php _e( 'Yes', 'wp_print_friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[auto]" id="auto-false" value="0"<?php checked( $options[ 'auto' ], false, true ); ?> /> <label for="auto-false"><?php _e( 'No', 'wp_print_friendly' ); ?></label>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[auto]" id="auto-true" value="1"<?php checked( $options[ 'auto' ], true, true ); ?> /> <label for="auto-true"><?php _e( 'Yes', 'wp-print-friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[auto]" id="auto-false" value="0"<?php checked( $options[ 'auto' ], false, true ); ?> /> <label for="auto-false"><?php _e( 'No', 'wp-print-friendly' ); ?></label>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Automatically place link:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Automatically place link:', 'wp-print-friendly' ); ?></th>
<td>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-above" value="above"<?php checked( $options[ 'placement' ], 'above', true ); ?> /> <label for="placement-above"><?php _e( 'Above content', 'wp_print_friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-below" value="below"<?php checked( $options[ 'placement' ], 'below', true ); ?> /> <label for="placement-below"><?php _e( 'Below content', 'wp_print_friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-both" value="both"<?php checked( $options[ 'placement' ], 'both', true ); ?> /> <label for="placement-both"><?php _e( 'Above and below content', 'wp_print_friendly' ); ?></label>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-above" value="above"<?php checked( $options[ 'placement' ], 'above', true ); ?> /> <label for="placement-above"><?php _e( 'Above content', 'wp-print-friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-below" value="below"<?php checked( $options[ 'placement' ], 'below', true ); ?> /> <label for="placement-below"><?php _e( 'Below content', 'wp-print-friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[placement]" id="placement-both" value="both"<?php checked( $options[ 'placement' ], 'both', true ); ?> /> <label for="placement-both"><?php _e( 'Above and below content', 'wp-print-friendly' ); ?></label>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Display automatically on:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Display automatically on:', 'wp-print-friendly' ); ?></th>
<td>
<?php foreach ( $post_types as $post_type ): ?>
<input type="checkbox" name="<?php echo esc_attr( $this->settings_key ); ?>[post_types][]" id="pt-<?php echo $post_type->name; ?>" value="<?php echo $post_type->name; ?>"<?php if ( in_array( $post_type->name, $options[ 'post_types' ] ) ) echo ' checked="checked"'; ?> /> <label for="pt-<?php echo $post_type->name; ?>"><?php echo $post_type->labels->name; ?></label><br />
......@@ -696,34 +703,34 @@ class wp_print_friendly {
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Text for link to print entire item:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Text for link to print entire item:', 'wp-print-friendly' ); ?></th>
<td>
<input type="text" name="<?php echo esc_attr( $this->settings_key ); ?>[print_text]" id="print_text" value="<?php echo esc_attr( $options[ 'print_text' ] ); ?>" style="width: 40%;" />
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Text for link to print current page:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Text for link to print current page:', 'wp-print-friendly' ); ?></th>
<td>
<input type="text" name="<?php echo esc_attr( $this->settings_key ); ?>[print_text_page]" id="print_text_page" value="<?php echo esc_attr( $options[ 'print_text_page' ] ); ?>" style="width: 40%;" />
<p class="description"><?php _e( 'If viewing a multipage post (set by using the &lt;!--nextpage--&gt; tag), the text above is used for a link to print just the current page.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( '<strong>To hide this link,</strong> clear the field\'s contents.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( 'If viewing a multipage post (set by using the &lt;!--nextpage--&gt; tag), the text above is used for a link to print just the current page.', 'wp-print-friendly' ); ?></p>
<p class="description"><?php _e( '<strong>To hide this link,</strong> clear the field\'s contents.', 'wp-print-friendly' ); ?></p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'CSS for print links:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'CSS for print links:', 'wp-print-friendly' ); ?></th>
<td>
<input type="text" name="<?php echo esc_attr( $this->settings_key ); ?>[css_class]" id="css_class" value="<?php echo esc_attr( $options[ 'css_class' ] ); ?>" style="width: 40%;" />
<p class="description"><?php _e( 'For page-specific print links, a second class, created by appending <strong>_cur</strong> to the above text, is added to each link.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( 'Be aware that Internet Explorer will only interpret the first two CSS classes, so if multiple classes are entered above, the page-specific class may not be available in IE.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( 'For page-specific print links, a second class, created by appending <strong>_cur</strong> to the above text, is added to each link.', 'wp-print-friendly' ); ?></p>
<p class="description"><?php _e( 'Be aware that Internet Explorer will only interpret the first two CSS classes, so if multiple classes are entered above, the page-specific class may not be available in IE.', 'wp-print-friendly' ); ?></p>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Open print-friendly views:', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Open print-friendly views:', 'wp-print-friendly' ); ?></th>
<td>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[link_target]" id="target-same" value="same"<?php checked( $options[ 'link_target' ], 'same', true ); ?> /> <label for="target-same"><?php _e( 'In the same window', 'wp_print_friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[link_target]" id="target-new" value="new"<?php checked( $options[ 'link_target' ], 'new', true ); ?> /> <label for="target-new"><?php _e( 'In a new window', 'wp_print_friendly' ); ?></label>
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[link_target]" id="target-same" value="same"<?php checked( $options[ 'link_target' ], 'same', true ); ?> /> <label for="target-same"><?php _e( 'In the same window', 'wp-print-friendly' ); ?></label><br />
<input type="radio" name="<?php echo esc_attr( $this->settings_key ); ?>[link_target]" id="target-new" value="new"<?php checked( $options[ 'link_target' ], 'new', true ); ?> /> <label for="target-new"><?php _e( 'In a new window', 'wp-print-friendly' ); ?></label>
</td>
</tr>
</table>
......@@ -732,19 +739,19 @@ class wp_print_friendly {
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Include endnotes for links found in content?', 'wp_print_friendly' ); ?></th>
<th scope="row"><?php _e( 'Include endnotes for links found in content?', 'wp-print-friendly' ); ?></th>
<td>
<input type="checkbox" name="<?php echo esc_attr( $this->settings_key ); ?>[endnotes]" id="endnotes" value="1"<?php checked( $options[ 'endnotes' ], true, true ); ?> /> <label for="endnotes"><?php _e( 'Yes', 'wp_print_friendly' ); ?></label>
<input type="checkbox" name="<?php echo esc_attr( $this->settings_key ); ?>[endnotes]" id="endnotes" value="1"<?php checked( $options[ 'endnotes' ], true, true ); ?> /> <label for="endnotes"><?php _e( 'Yes', 'wp-print-friendly' ); ?></label>
<p class="description"><?php _e( 'If enabled, content is automatically scanned for links and an endnote is added for each link found. This can be helpful for users if your content includes many links.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( 'If enabled, content is automatically scanned for links and an endnote is added for each link found. This can be helpful for users if your content includes many links.', 'wp-print-friendly' ); ?></p>
</td>
</tr>
<tr>
<th scope="row"><label for="endnotes-label"><?php _e( 'Endnotes heading:', 'wp_print_friendly' ); ?></label></th>
<th scope="row"><label for="endnotes-label"><?php _e( 'Endnotes heading:', 'wp-print-friendly' ); ?></label></th>
<td>
<input type="text" name="<?php echo esc_attr( $this->settings_key ); ?>[endnotes_label]" class="regular-text code" id="endnotes-label" value="<?php echo esc_attr( $options[ 'endnotes_label' ] ); ?>" />
<p class="description"><?php _e( 'If endnotes are enabled, the text entered above will be output above the list of links.', 'wp_print_friendly' ); ?></p>
<p class="description"><?php _e( 'If endnotes are enabled, the text entered above will be output above the list of links.', 'wp-print-friendly' ); ?></p>
</td>
</tr>
</table>
......@@ -878,11 +885,11 @@ class wp_print_friendly {
?>
<div id="wpf-rewrite-flush-warning" class="error fade">
<p><strong><?php _e( 'WP Print Friendly', 'wp_print_friendly' ); ?></strong></p>
<p><strong><?php _e( 'WP Print Friendly', 'wp-print-friendly' ); ?></strong></p>
<p><?php printf( __( 'You must refresh your site\'s permalinks before WP Print Friendly is fully activated. To do so, go to <a href="%s">Permalinks</a> and click the <strong><em>Save Changes</em></strong> button at the bottom of the screen.', 'wp_print_friendly' ), esc_url( admin_url( 'options-permalink.php' ) ) ); ?></p>
<p><?php printf( __( 'You must refresh your site\'s permalinks before WP Print Friendly is fully activated. To do so, go to <a href="%s">Permalinks</a> and click the <strong><em>Save Changes</em></strong> button at the bottom of the screen.', 'wp-print-friendly' ), esc_url( admin_url( 'options-permalink.php' ) ) ); ?></p>
<p><?php printf( __( 'When finished, click <a href="%s">here</a> to hide this message.', 'wp_print_friendly' ), esc_url( admin_url( add_query_arg( $this->notice_key, 1, 'index.php' ) ) ) ); ?></p>
<p><?php printf( __( 'When finished, click <a href="%s">here</a> to hide this message.', 'wp-print-friendly' ), esc_url( admin_url( add_query_arg( $this->notice_key, 1, 'index.php' ) ) ) ); ?></p>
</div>
<?php
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment