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

Merge branch 'fix/i18n' into 'master'

Fix translation support

See merge request !19
parents 522bdbe9 eef68a7c
Branches
Tags
1 merge request!19Fix translation support
Pipeline #4925 passed
......@@ -9,7 +9,7 @@ module.exports = function( grunt ) {
addtextdomain: {
options: {
textdomain: 'eth_escape_headspace2',
textdomain: 'eth-escape-headspace2',
},
update_all_domains: {
options: {
......
......@@ -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.
<?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' ).
*
......
......@@ -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"
......
......@@ -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">
......
......@@ -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.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment