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

Fix translation support

parent 522bdbe9
No related branches found
No related tags found
1 merge request!19Fix translation support
Pipeline #4922 failed
...@@ -9,7 +9,7 @@ module.exports = function( grunt ) { ...@@ -9,7 +9,7 @@ module.exports = function( grunt ) {
addtextdomain: { addtextdomain: {
options: { options: {
textdomain: 'eth_escape_headspace2', textdomain: 'eth-escape-headspace2',
}, },
update_all_domains: { update_all_domains: {
options: { options: {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
**Tags:** seo, meta tags **Tags:** seo, meta tags
**Requires at least:** 4.4 **Requires at least:** 4.4
**Tested up to:** 6.0 **Tested up to:** 6.0
**Stable tag:** 0.2.1 **Stable tag:** 0.2.2
**License:** GPLv2 or later **License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html **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 ...@@ -49,6 +49,9 @@ Mostly, I either didn't have time or didn't have a good example of how a particu
## Changelog ## ## Changelog ##
### 0.2.2 ###
* Fix translation support.
### 0.2.1 ### ### 0.2.1 ###
* PHP 7.3 compatibility. * 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 ...@@ -61,5 +64,8 @@ Mostly, I either didn't have time or didn't have a good example of how a particu
## Upgrade Notice ## ## Upgrade Notice ##
### 0.2.2 ###
Fixes translation support.
### 0.2.1 ### ### 0.2.1 ###
Resolved warning arising in PHP 7.3. Resolves warning arising in PHP 7.3.
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
/** /**
Plugin Name: ETH Escape HeadSpace2 * Plugin Name: ETH Escape HeadSpace2
Plugin URI: https://ethitter.com/plugins/ * 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. * Description: Output existing HeadSpace2 data without the original plugin. Allows HeadSpace2 (no longer maintained) to be deactivated without impactacting legacy content.
Author: Erick Hitter * Author: Erick Hitter
Version: 0.2.1 * Version: 0.2.1
Author URI: https://ethitter.com/ * Author URI: https://ethitter.com/
* Text Domain: eth-escape-headspace2
This program is free software; you can redistribute it and/or modify * Domain Path: /languages/
it under the terms of the GNU General Public License as published by *
the Free Software Foundation; either version 2 of the License, or * This program is free software; you can redistribute it and/or modify
(at your option) any later version. * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
This program is distributed in the hope that it will be useful, * (at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of *
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * This program is distributed in the hope that it will be useful,
GNU General Public License for more details. * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
You should have received a copy of the GNU General Public License * GNU General Public License for more details.
along with this program; if not, write to the Free Software *
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * 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 { ...@@ -101,10 +103,12 @@ class ETH_Escape_HeadSpace2 {
*/ */
public function maybe_add_hooks() { public function maybe_add_hooks() {
// Defer to HeadSpace2 when active. // Defer to HeadSpace2 when active.
if ( class_exists( 'HeadSpace_Plugin' ) ) { if ( class_exists( 'HeadSpace_Plugin', false ) ) {
return; return;
} }
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
add_filter( 'pre_get_document_title', array( $this, 'filter_pre_get_document_title' ) ); add_filter( 'pre_get_document_title', array( $this, 'filter_pre_get_document_title' ) );
add_filter( 'wp_title', array( $this, 'filter_wp_title' ), 10, 3 ); add_filter( 'wp_title', array( $this, 'filter_wp_title' ), 10, 3 );
...@@ -112,6 +116,19 @@ class ETH_Escape_HeadSpace2 { ...@@ -112,6 +116,19 @@ class ETH_Escape_HeadSpace2 {
add_action( 'wp_footer', array( $this, 'action_wp_footer' ) ); 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' ). * Filter page titles in WP 4.1+ themes add_theme_support( 'title-tag' ).
* *
......
...@@ -5,7 +5,7 @@ msgstr "" ...@@ -5,7 +5,7 @@ msgstr ""
"Project-Id-Version: ETH Escape HeadSpace2 0.2.1\n" "Project-Id-Version: ETH Escape HeadSpace2 0.2.1\n"
"Report-Msgid-Bugs-To: " "Report-Msgid-Bugs-To: "
"https://wordpress.org/support/plugin/eth-escape-headspace\n" "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" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<rule ref="WordPress.WP.I18n"> <rule ref="WordPress.WP.I18n">
<properties> <properties>
<!-- Value: replace the text domain used. --> <!-- 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> </properties>
</rule> </rule>
<rule ref="WordPress.WhiteSpace.ControlStructureSpacing"> <rule ref="WordPress.WhiteSpace.ControlStructureSpacing">
......
...@@ -4,7 +4,7 @@ Donate link: https://ethitter.com/donate/ ...@@ -4,7 +4,7 @@ Donate link: https://ethitter.com/donate/
Tags: seo, meta tags Tags: seo, meta tags
Requires at least: 4.4 Requires at least: 4.4
Tested up to: 6.0 Tested up to: 6.0
Stable tag: 0.2.1 Stable tag: 0.2.2
License: GPLv2 or later License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html 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 ...@@ -49,6 +49,9 @@ Mostly, I either didn't have time or didn't have a good example of how a particu
== Changelog == == Changelog ==
= 0.2.2 =
* Fix translation support.
= 0.2.1 = = 0.2.1 =
* PHP 7.3 compatibility. * 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 ...@@ -61,5 +64,8 @@ Mostly, I either didn't have time or didn't have a good example of how a particu
== Upgrade Notice == == Upgrade Notice ==
= 0.2.2 =
Fixes translation support.
= 0.2.1 = = 0.2.1 =
Resolved warning arising in PHP 7.3. Resolves warning arising in PHP 7.3.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment