Weglot Translate – Translate your WP website - Version 1.13.1

Version Description

(01/06/2018) = * Bugfix: Error on the encoding of ignored nodes

Download this release

Release Info

Developer remyb92
Plugin Icon 128x128 Weglot Translate – Translate your WP website
Version 1.13.1
Comparing to
See all releases

Code changes from version 1.13 to 1.13.1

Files changed (3) hide show
  1. readme.txt +4 -1
  2. src/Client/WeglotClient.php +9 -0
  3. weglot.php +3 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: translate,translation,language,multilingual,bilingual,international,locali
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
  Requires PHP: 5.3
7
- Stable tag: 1.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -152,6 +152,9 @@ See changelog for upgrade changes.
152
 
153
  == Changelog ==
154
 
 
 
 
155
  = 1.13 (31/05/2018) =
156
  * Bugfix : Improve filter words_translate to prevent matching part of words
157
  * BugFix : Bug in parser when ignored node had an attribute
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
  Requires PHP: 5.3
7
+ Stable tag: 1.13.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 1.13.1 (01/06/2018) =
156
+ * Bugfix: Error on the encoding of ignored nodes
157
+
158
  = 1.13 (31/05/2018) =
159
  * Bugfix : Improve filter words_translate to prevent matching part of words
160
  * BugFix : Bug in parser when ignored node had an attribute
src/Client/WeglotClient.php CHANGED
@@ -199,6 +199,11 @@ class WeglotClient
199
  return $dom;
200
  }
201
 
 
 
 
 
 
202
  public function translateDomFromTo($dom, $l_from, $l_to)
203
  {
204
  if (strlen($this->api_key) == 36) {
@@ -428,6 +433,10 @@ class WeglotClient
428
  'property' => $property,
429
  )
430
  );
 
 
 
 
431
  }
432
  }
433
  }
199
  return $dom;
200
  }
201
 
202
+ function decodeNode($dom) {
203
+ return str_replace('&gt;','>',str_replace('&lt;','<',$dom));
204
+ }
205
+
206
+
207
  public function translateDomFromTo($dom, $l_from, $l_to)
208
  {
209
  if (strlen($this->api_key) == 36) {
433
  'property' => $property,
434
  )
435
  );
436
+ } else {
437
+ if(strpos($row->$property, '&gt;') !== false || strpos($row->$property, '&lt;') !== false) {
438
+ $row->$property = $this->decodeNode($row->$property);
439
+ }
440
  }
441
  }
442
  }
weglot.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Weglot
4
- * @version 1.13
5
  */
6
 
7
  /*
@@ -12,7 +12,7 @@ Author: Weglot Translate team
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
- Version: 1.13
16
  */
17
 
18
  /*
@@ -41,7 +41,7 @@ if (! defined('ABSPATH')) {
41
  }
42
 
43
 
44
- define('WEGLOT_VERSION', '1.13');
45
  define('WEGLOT_DIR', dirname(__FILE__));
46
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
47
  define('WEGLOT_DIRURL', plugin_dir_url(__FILE__));
1
  <?php
2
  /**
3
  * @package Weglot
4
+ * @version 1.13.1
5
  */
6
 
7
  /*
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
+ Version: 1.13.1
16
  */
17
 
18
  /*
41
  }
42
 
43
 
44
+ define('WEGLOT_VERSION', '1.13.1');
45
  define('WEGLOT_DIR', dirname(__FILE__));
46
  define('WEGLOT_BNAME', plugin_basename(__FILE__));
47
  define('WEGLOT_DIRURL', plugin_dir_url(__FILE__));