Lingotek Translation - Version 1.2.4

Version Description

(2016-10-10) =

  • Fixed a bug that prevented the saving of Translation Profiles when the content type list was paginated
  • Fixed a bug that allowed premature status updates after uploading which caused errors when requesting translations
Download this release

Release Info

Developer erichie
Plugin Icon 128x128 Lingotek Translation
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

admin/manage/view-content.php CHANGED
@@ -37,9 +37,9 @@ else {
37
  check_admin_referer('lingotek-content-types', '_wpnonce_lingotek-content-types');
38
 
39
  $profiles = array_keys(get_option('lingotek_profiles'));
40
-
41
  foreach ($data as $key => $item) {
42
- if (isset($data[$key]['name'])) {
43
  if (in_array($_POST[$key]['profile'], $profiles))
44
  $content_types[$key]['profile'] = $_POST[$key]['profile'];
45
 
@@ -57,9 +57,12 @@ else {
57
  $content_types[$key]['fields'][$key1][$key2] = 1;
58
  }
59
  }
60
- elseif (empty($_POST[$key]['fields'][$key1])) {
61
  $content_types[$key]['fields'][$key1] = 1;
62
  }
 
 
 
63
  }
64
  }
65
  }
37
  check_admin_referer('lingotek-content-types', '_wpnonce_lingotek-content-types');
38
 
39
  $profiles = array_keys(get_option('lingotek_profiles'));
40
+ $content_types = get_option('lingotek_content_type');
41
  foreach ($data as $key => $item) {
42
+ if (isset($data[$key]['name']) && isset($_POST[$key])) {
43
  if (in_array($_POST[$key]['profile'], $profiles))
44
  $content_types[$key]['profile'] = $_POST[$key]['profile'];
45
 
57
  $content_types[$key]['fields'][$key1][$key2] = 1;
58
  }
59
  }
60
+ elseif (isset($_POST[$key]) && empty($_POST[$key]['fields'][$key1])) {
61
  $content_types[$key]['fields'][$key1] = 1;
62
  }
63
+ elseif (!empty($_POST[$key]['fields'][$key1])) {
64
+ $content_types[$key]['fields'][$key1] = 0;
65
+ }
66
  }
67
  }
68
  }
admin/tutorial/content.php CHANGED
@@ -92,4 +92,9 @@
92
  <th><?php _e('Translation Current', 'lingotek-translation') ?></th>
93
  <td><?php _e('The translation is complete. (Clicking on this icon will allow you to edit translations in the Lingotek Workbench)', 'lingotek-translation') ?></td>
94
  </tr>
95
- </table>
 
 
 
 
 
92
  <th><?php _e('Translation Current', 'lingotek-translation') ?></th>
93
  <td><?php _e('The translation is complete. (Clicking on this icon will allow you to edit translations in the Lingotek Workbench)', 'lingotek-translation') ?></td>
94
  </tr>
95
+ <tr>
96
+ <td><span class="lingotek-color dashicons dashicons-no"></span></td>
97
+ <th><?php _e('Out of Sync', 'lingotek-translation') ?></th>
98
+ <td><?php _e('You have made changes to source content. The source must be sent to Lingotek again for additional translation.', 'lingotek-translation') ?></td>
99
+ </tr>
100
+ </table>
include/api.php CHANGED
@@ -252,6 +252,18 @@ class Lingotek_API extends Lingotek_HTTP {
252
  return $document;
253
  }
254
 
 
 
 
 
 
 
 
 
 
 
 
 
255
 
256
  /**
257
  * get specific document content
252
  return $document;
253
  }
254
 
255
+ public function get_document_status($doc_id)
256
+ {
257
+ $imported = FALSE;
258
+ $response = $this->get($this->api_url . '/document/' . $doc_id . '/status');
259
+
260
+ if (!is_wp_error($response) && 200 == wp_remote_retrieve_response_code($response)) {
261
+ $imported = TRUE;
262
+ }
263
+
264
+ return $imported;
265
+ }
266
+
267
 
268
  /**
269
  * get specific document content
include/group.php CHANGED
@@ -152,7 +152,7 @@ abstract class Lingotek_Group {
152
  public function source_status() {
153
  $client = new Lingotek_API();
154
 
155
- if ('importing' == $this->status /*&& $client->document_exists($this->document_id, $this->source)*/){
156
  $this->status = 'current';
157
  $this->save();
158
  }
152
  public function source_status() {
153
  $client = new Lingotek_API();
154
 
155
+ if ('importing' == $this->status && $client->get_document_status($this->document_id)){
156
  $this->status = 'current';
157
  $this->save();
158
  }
lingotek.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
- Version: 1.2.3
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
@@ -15,7 +15,7 @@ GitHub Plugin URI: https://github.com/lingotek/lingotek-translation
15
  if (!function_exists('add_action'))
16
  exit();
17
 
18
- define('LINGOTEK_VERSION', '1.2.3'); // plugin version (should match above meta)
19
  define('LINGOTEK_MIN_PLL_VERSION', '1.8');
20
  define('LINGOTEK_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
21
  define('LINGOTEK_PLUGIN_SLUG', 'lingotek-translation');// plugin slug (should match above meta: Text Domain)
2
  /*
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
+ Version: 1.2.4
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
15
  if (!function_exists('add_action'))
16
  exit();
17
 
18
+ define('LINGOTEK_VERSION', '1.2.4'); // plugin version (should match above meta)
19
  define('LINGOTEK_MIN_PLL_VERSION', '1.8');
20
  define('LINGOTEK_BASENAME', plugin_basename(__FILE__)); // plugin name as known by WP
21
  define('LINGOTEK_PLUGIN_SLUG', 'lingotek-translation');// plugin slug (should match above meta: Text Domain)
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://lingotek.com/
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 4.6
7
- Stable tag: 1.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -122,6 +122,11 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
125
  = 1.2.3 (2016-8-24) =
126
 
127
  * Fixed a bug that prevented the removal of target languages from the Dashboard
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 4.6
7
+ Stable tag: 1.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
122
 
123
  == Changelog ==
124
 
125
+ = 1.2.4 (2016-10-10) =
126
+
127
+ * Fixed a bug that prevented the saving of Translation Profiles when the content type list was paginated
128
+ * Fixed a bug that allowed premature status updates after uploading which caused errors when requesting translations
129
+
130
  = 1.2.3 (2016-8-24) =
131
 
132
  * Fixed a bug that prevented the removal of target languages from the Dashboard