Skip to content

Commit d224419

Browse files
committed
Support textdomain for WP < 4.6
1 parent 9c44ffa commit d224419

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

readme.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# PHP Compatibility Checker <a href="https://travis-ci.org/wpengine/phpcompat"><img src="https://travis-ci.org/wpengine/phpcompat.svg?branch=master"></a>
2-
**Contributors:** [wpengine](https://profiles.wordpress.org/wpengine), [octalmage](https://profiles.wordpress.org/octalmage), [stevenkword](https://profiles.wordpress.org/stevenkword), [Taylor4484](https://profiles.wordpress.org/Taylor4484), [pross](https://profiles.wordpress.org/pross), [jcross](https://profiles.wordpress.org/jcross)
3-
**Tags:** php 7, php 5.5, php, version, compatibility, checker, wp engine, wpe, wpengine
4-
**Requires at least:** 3.5
5-
**Tested up to:** 4.9
6-
**Stable tag:** 1.4.6
7-
**License:** GPLv2 or later
8-
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
2+
**Contributors:** [wpengine](https://profiles.wordpress.org/wpengine), [octalmage](https://profiles.wordpress.org/octalmage), [stevenkword](https://profiles.wordpress.org/stevenkword), [Taylor4484](https://profiles.wordpress.org/Taylor4484), [pross](https://profiles.wordpress.org/pross), [jcross](https://profiles.wordpress.org/jcross)
3+
**Tags:** php 7, php 5.5, php, version, compatibility, checker, wp engine, wpe, wpengine
4+
**Requires at least:** 3.5
5+
**Tested up to:** 5.0
6+
**Stable tag:** 1.4.7
7+
**License:** GPLv2 or later
8+
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
99

1010
Make sure your plugins and themes are compatible with newer PHP versions.
1111

@@ -117,6 +117,8 @@ To disclose security issues for this plugin please email [email protected]
117117

118118

119119
## Changelog ##
120+
### 1.4.7 ###
121+
- Better translation support.
120122

121123
### 1.4.6 ###
122124
- Switched to new PHPCompatibilityWP library to help prevent false positives.

readme.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Contributors: wpengine, octalmage, stevenkword, Taylor4484, pross, jcross
33
Tags: php 7, php 5.5, php, version, compatibility, checker, wp engine, wpe, wpengine
44
Requires at least: 3.5
5-
Tested up to: 4.9
6-
Stable tag: 1.4.6
5+
Tested up to: 5.0
6+
Stable tag: 1.4.7
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -113,6 +113,8 @@ To disclose security issues for this plugin please email [email protected]
113113
2. Compatibility results screen
114114

115115
== Changelog ==
116+
= 1.4.7 =
117+
- Better translation support.
116118

117119
= 1.4.6 =
118120
- Switched to new PHPCompatibilityWP library to help prevent false positives.

wpengine-phpcompat.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ public static function instance() {
7575
public static function init() {
7676
$instance = self::instance();
7777

78+
// Load textdomain.
79+
add_action( 'init', array( $instance, 'load_textdomain' ) );
80+
7881
// Build our tools page.
7982
add_action( 'admin_menu', array( $instance, 'create_menu' ) );
8083

@@ -310,6 +313,17 @@ public function create_job_queue() {
310313
) );
311314
}
312315

316+
/**
317+
* Loads textdomain for WP < 4.6 translation support.
318+
*
319+
* @since 1.4.7
320+
*
321+
* @action admin_init
322+
*/
323+
public function admin_init() {
324+
load_plugin_textdomain( 'php-compatibility-checker', false, basename( dirname( __FILE__ ) ) . '/languages' );
325+
}
326+
313327
/**
314328
* Enqueues our JavaScript and CSS.
315329
*

0 commit comments

Comments
 (0)