diff --git a/Gruntfile.js b/Gruntfile.js index 9ab104ca9eb60738f040f3a2f734a43499ba572f..aa0962a94d3eff92086b6b1bd930fd399443e606 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -9,7 +9,7 @@ module.exports = function( grunt ) { addtextdomain: { options: { - textdomain: 'eth_escape_headspace2', + textdomain: 'eth-escape-headspace2', }, update_all_domains: { options: { diff --git a/README.md b/README.md index f8f840f3b641f1aad65bcc8c3b86ed5fa7d30e66..49f6345bee58735f9ea9b3447332ac2b668e5356 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Tags:** seo, meta tags **Requires at least:** 4.4 **Tested up to:** 6.0 -**Stable tag:** 0.2.1 +**Stable tag:** 0.2.2 **License:** GPLv2 or later **License URI:** http://www.gnu.org/licenses/gpl-2.0.html @@ -49,6 +49,9 @@ Mostly, I either didn't have time or didn't have a good example of how a particu ## Changelog ## +### 0.2.2 ### +* Fix translation support. + ### 0.2.1 ### * PHP 7.3 compatibility. @@ -61,5 +64,8 @@ Mostly, I either didn't have time or didn't have a good example of how a particu ## Upgrade Notice ## +### 0.2.2 ### +Fixes translation support. + ### 0.2.1 ### -Resolved warning arising in PHP 7.3. +Resolves warning arising in PHP 7.3. diff --git a/eth-escape-headspace.php b/eth-escape-headspace.php index b79cbde15c567e7e9fd78b41d3b91835fbd1866c..eb0076c9cb7c66b5bd648fc30960deb29baa9052 100644 --- a/eth-escape-headspace.php +++ b/eth-escape-headspace.php @@ -1,25 +1,27 @@ <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName /** - Plugin Name: ETH Escape HeadSpace2 - Plugin URI: https://ethitter.com/plugins/ - Description: Output existing HeadSpace2 data without the original plugin. Allows HeadSpace2 (no longer maintained) to be deactivated without impactacting legacy content. - Author: Erick Hitter - Version: 0.2.1 - Author URI: https://ethitter.com/ - - 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: ETH Escape HeadSpace2 + * Plugin URI: https://ethitter.com/plugins/ + * Description: Output existing HeadSpace2 data without the original plugin. Allows HeadSpace2 (no longer maintained) to be deactivated without impactacting legacy content. + * Author: Erick Hitter + * Version: 0.2.2 + * Author URI: https://ethitter.com/ + * Text Domain: eth-escape-headspace2 + * 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 */ /** @@ -101,10 +103,12 @@ class ETH_Escape_HeadSpace2 { */ public function maybe_add_hooks() { // Defer to HeadSpace2 when active. - if ( class_exists( 'HeadSpace_Plugin' ) ) { + if ( class_exists( 'HeadSpace_Plugin', false ) ) { return; } + add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) ); + add_filter( 'pre_get_document_title', array( $this, 'filter_pre_get_document_title' ) ); add_filter( 'wp_title', array( $this, 'filter_wp_title' ), 10, 3 ); @@ -112,6 +116,19 @@ class ETH_Escape_HeadSpace2 { add_action( 'wp_footer', array( $this, 'action_wp_footer' ) ); } + /** + * Load plugin translations. + * + * @return void + */ + public function load_textdomain() { + load_plugin_textdomain( + 'eth-escape-headspace2', + false, + dirname( plugin_basename( __FILE__ ) ) . '/languages/' + ); + } + /** * Filter page titles in WP 4.1+ themes add_theme_support( 'title-tag' ). * diff --git a/languages/eth-escape-headspace2.pot b/languages/eth-escape-headspace2.pot index ce3c81e67f122b9b9a67bab9913d48be8ca3f6f1..2789de6320143e8a84baa1a4ce73856d0cfce8c9 100644 --- a/languages/eth-escape-headspace2.pot +++ b/languages/eth-escape-headspace2.pot @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: ETH Escape HeadSpace2 0.2.1\n" "Report-Msgid-Bugs-To: " "https://wordpress.org/support/plugin/eth-escape-headspace\n" -"POT-Creation-Date: 2022-06-11 18:55:07+00:00\n" +"POT-Creation-Date: 2022-06-25 22:45:25+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/phpcs.xml b/phpcs.xml index 01cc6eea945b7d8099540f9f85f6877ba8e9f4d0..29ee9540d0af21cae512e811b6fbdb6709baae7c 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -39,7 +39,7 @@ <rule ref="WordPress.WP.I18n"> <properties> <!-- Value: replace the text domain used. --> - <property name="text_domain" type="array" value="eth_escape_headspace2"/> + <property name="text_domain" type="array" value="eth-escape-headspace2"/> </properties> </rule> <rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> diff --git a/readme.txt b/readme.txt index bfbf07fef9529634c167ed0b53505c677f6738d2..1f5598fe4c1bf0bbdcb3927dfcb5afade1acf4fa 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://ethitter.com/donate/ Tags: seo, meta tags Requires at least: 4.4 Tested up to: 6.0 -Stable tag: 0.2.1 +Stable tag: 0.2.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -49,6 +49,9 @@ Mostly, I either didn't have time or didn't have a good example of how a particu == Changelog == += 0.2.2 = +* Fix translation support. + = 0.2.1 = * PHP 7.3 compatibility. @@ -61,5 +64,8 @@ Mostly, I either didn't have time or didn't have a good example of how a particu == Upgrade Notice == += 0.2.2 = +Fixes translation support. + = 0.2.1 = -Resolved warning arising in PHP 7.3. +Resolves warning arising in PHP 7.3.