Skip to content

Commit

Permalink
Revert logic changes back to ed2f9fb commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuli Martikainen committed Nov 21, 2019
1 parent 68d1a50 commit b7a4012
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dynamic-mo-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Dynamic MO Loader
Plugin URI: https://github.com/aucor/dynamic-mo-loader
Description: Better text domain loading with object cache support
Version: 1.4.0
Version: 1.4.1
Author: Aucor Oy
Author URI:
License: GPL3
Expand Down
9 changes: 7 additions & 2 deletions inc/mo_dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,12 @@ function translate ($singular, $context = NULL) {
}

if ( $t !== false ) {
return $t;
if ( false !== ( $i = strpos( $t, '0' ) ) ) {
return substr( $t, 0, $i );
} else {
return $t;
}

} else {
$this->translations[$s] = $singular;
$this->modified = true;
Expand Down Expand Up @@ -533,7 +538,7 @@ function translate_plural ($singular, $plural, $count, $context = null) {
}

if ( $t !== false ) {
if ( false !== ( $i = strpos( $t, 0 ) ) ) {
if ( false !== ( $i = strpos( $t, '0' ) ) ) {
if ( $count == 1 ) {
return substr ( $t, '0', $i );
} else {
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ To boost the performance even more, the plugin also caches the loaded text domai
Download and activate. That\'s it.

== Changelog ==
= 1.4.1 =
* inc/mo_dynamic.php revert
= 1.4.0 =
* bugfix for plural translation
= 1.3.0 =
Expand Down

0 comments on commit b7a4012

Please sign in to comment.