Translate WordPress with GTranslate - Version 2.0.21

Version Description

  • New option to render in primary menu
Download this release

Release Info

Developer edo888
Plugin Icon 128x128 Translate WordPress with GTranslate
Version 2.0.21
Comparing to
See all releases

Code changes from version 2.0.20 to 2.0.21

Files changed (2) hide show
  1. gtranslate.php +21 -1
  2. readme.txt +8 -5
gtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: GTranslate
4
  Plugin URI: https://gtranslate.io/?xyz=998
5
  Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://gtranslate.io/forum/">GTranslate Forum</a>.
6
- Version: 2.0.20
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
 
@@ -42,6 +42,18 @@ if(is_admin()) {
42
  new GTranslate_Notices();
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  class GTranslate extends WP_Widget {
46
  public static function activate() {
47
  $data = array(
@@ -177,6 +189,7 @@ function RefreshDoWidgetCode() {
177
  var pro_version = jQuery('#pro_version:checked').length > 0 ? true : false;
178
  var enterprise_version = jQuery('#enterprise_version:checked').length > 0 ? true : false;
179
  var new_window = jQuery('#new_window:checked').length > 0 ? true : false;
 
180
  var analytics = jQuery('#analytics:checked').length > 0 ? true : false;
181
 
182
  if(pro_version || enterprise_version) {
@@ -451,6 +464,7 @@ function ShowWidgetPreview(widget_preview) {
451
  jQuery('#pro_version').attr('checked', '$pro_version'.length > 0);
452
  jQuery('#enterprise_version').attr('checked', '$enterprise_version'.length > 0);
453
  jQuery('#new_window').attr('checked', '$new_window'.length > 0);
 
454
  jQuery('#analytics').attr('checked', '$analytics'.length > 0);
455
  jQuery('#load_jquery').attr('checked', '$load_jquery'.length > 0);
456
  jQuery('#add_new_line').attr('checked', '$add_new_line'.length > 0);
@@ -665,6 +679,10 @@ foreach($alt_flags as $flag)
665
  <td class="option_name">Open in new window:</td>
666
  <td><input id="new_window" name="new_window" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
667
  </tr>
 
 
 
 
668
 
669
  <!--tr>
670
  <td class="option_name">Show flags:</td>
@@ -1009,6 +1027,7 @@ foreach($alt_flags as $flag)
1009
  $data['pro_version'] = isset($_POST['pro_version']) ? intval($_POST['pro_version']) : '';
1010
  $data['enterprise_version'] = isset($_POST['enterprise_version']) ? intval($_POST['enterprise_version']) : '';
1011
  $data['new_window'] = isset($_POST['new_window']) ? intval($_POST['new_window']) : '';
 
1012
  $data['analytics'] = isset($_POST['analytics']) ? intval($_POST['analytics']) : '';
1013
  $data['load_jquery'] = isset($_POST['load_jquery']) ? intval($_POST['load_jquery']) : '';
1014
  $data['add_new_line'] = isset($_POST['add_new_line']) ? intval($_POST['add_new_line']) : '';
@@ -1029,6 +1048,7 @@ foreach($alt_flags as $flag)
1029
  $data['pro_version'] = isset($data['pro_version']) ? $data['pro_version'] : '';
1030
  $data['enterprise_version'] = isset($data['enterprise_version']) ? $data['enterprise_version'] : '';
1031
  $data['new_window'] = isset($data['new_window']) ? $data['new_window'] : '';
 
1032
  $data['analytics'] = isset($data['analytics']) ? $data['analytics'] : '';
1033
  $data['load_jquery'] = isset($data['load_jquery']) ? $data['load_jquery'] : '1';
1034
  $data['add_new_line'] = isset($data['add_new_line']) ? $data['add_new_line'] : '1';
3
  Plugin Name: GTranslate
4
  Plugin URI: https://gtranslate.io/?xyz=998
5
  Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://gtranslate.io/forum/">GTranslate Forum</a>.
6
+ Version: 2.0.21
7
  Author: Edvard Ananyan
8
  Author URI: https://gtranslate.io
9
 
42
  new GTranslate_Notices();
43
  }
44
 
45
+ $data = get_option('GTranslate');
46
+ GTranslate::load_defaults($data);
47
+
48
+ if($data['show_in_primary_menu']) {
49
+ add_filter('wp_nav_menu_items', 'gtranslate_menu_item', 10, 2);
50
+ function gtranslate_menu_item($items, $args) {
51
+ if($args->theme_location == 'primary')
52
+ $items .= '<li style="position:relative;" class="menu-item menu-item-gtranslate"><div style="position:absolute;">'.GTranslate::get_widget_code(false).'</div></li>';
53
+ return $items;
54
+ }
55
+ }
56
+
57
  class GTranslate extends WP_Widget {
58
  public static function activate() {
59
  $data = array(
189
  var pro_version = jQuery('#pro_version:checked').length > 0 ? true : false;
190
  var enterprise_version = jQuery('#enterprise_version:checked').length > 0 ? true : false;
191
  var new_window = jQuery('#new_window:checked').length > 0 ? true : false;
192
+ var show_in_primary_menu = jQuery('#show_in_primary_menu:checked').length > 0 ? true : false;
193
  var analytics = jQuery('#analytics:checked').length > 0 ? true : false;
194
 
195
  if(pro_version || enterprise_version) {
464
  jQuery('#pro_version').attr('checked', '$pro_version'.length > 0);
465
  jQuery('#enterprise_version').attr('checked', '$enterprise_version'.length > 0);
466
  jQuery('#new_window').attr('checked', '$new_window'.length > 0);
467
+ jQuery('#show_in_primary_menu').attr('checked', '$show_in_primary_menu'.length > 0);
468
  jQuery('#analytics').attr('checked', '$analytics'.length > 0);
469
  jQuery('#load_jquery').attr('checked', '$load_jquery'.length > 0);
470
  jQuery('#add_new_line').attr('checked', '$add_new_line'.length > 0);
679
  <td class="option_name">Open in new window:</td>
680
  <td><input id="new_window" name="new_window" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
681
  </tr>
682
+ <tr>
683
+ <td class="option_name">Show in primary menu:</td>
684
+ <td><input id="show_in_primary_menu" name="show_in_primary_menu" value="1" type="checkbox"/></td>
685
+ </tr>
686
 
687
  <!--tr>
688
  <td class="option_name">Show flags:</td>
1027
  $data['pro_version'] = isset($_POST['pro_version']) ? intval($_POST['pro_version']) : '';
1028
  $data['enterprise_version'] = isset($_POST['enterprise_version']) ? intval($_POST['enterprise_version']) : '';
1029
  $data['new_window'] = isset($_POST['new_window']) ? intval($_POST['new_window']) : '';
1030
+ $data['show_in_primary_menu'] = isset($_POST['show_in_primary_menu']) ? intval($_POST['show_in_primary_menu']) : '';
1031
  $data['analytics'] = isset($_POST['analytics']) ? intval($_POST['analytics']) : '';
1032
  $data['load_jquery'] = isset($_POST['load_jquery']) ? intval($_POST['load_jquery']) : '';
1033
  $data['add_new_line'] = isset($_POST['add_new_line']) ? intval($_POST['add_new_line']) : '';
1048
  $data['pro_version'] = isset($data['pro_version']) ? $data['pro_version'] : '';
1049
  $data['enterprise_version'] = isset($data['enterprise_version']) ? $data['enterprise_version'] : '';
1050
  $data['new_window'] = isset($data['new_window']) ? $data['new_window'] : '';
1051
+ $data['show_in_primary_menu'] = isset($data['show_in_primary_menu']) ? $data['show_in_primary_menu'] : '';
1052
  $data['analytics'] = isset($data['analytics']) ? $data['analytics'] : '';
1053
  $data['load_jquery'] = isset($data['load_jquery']) ? $data['load_jquery'] : '1';
1054
  $data['add_new_line'] = isset($data['add_new_line']) ? $data['add_new_line'] : '1';
readme.txt CHANGED
@@ -3,13 +3,13 @@ Contributors: edo888
3
  Author: Edvard Ananyan
4
  Tags: translation proxy, localization, translate, translation, localization, google translate, language, multilingual, multilanguage, bilingual, tradurre, traducir, traduire, traduzione, ubersetzung, mehrsprachig, oversette, oversatta, vertaling, vertaler, meertalig, polylang, qtranslate, transposh
5
  Requires at least: 2.8
6
- Tested up to: 4.6
7
- Stable tag: 2.0.20
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Donate link: https://gtranslate.io/?xyz=998#pricing
11
 
12
- GTranslate - Google Translate for WordPress will make your website multilingual and available to more than 99% of internet users.
13
 
14
  == Description ==
15
 
@@ -17,7 +17,7 @@ GTranslate plugin uses Google Translate automatic translation service to **trans
17
 
18
  GTranslate is a leading website translation services provider since 2008 and powers more than 500.000 websites worldwide.
19
 
20
- Please use [GTranslate Support](https://gtranslate.io/?xyz=998#contact) for your questions and support requests! We have Live Chat, Helpdesk and Support Forum.
21
 
22
  Please check our [FAQ](https://gtranslate.io/?xyz=998#faq) to get quick answers.
23
 
@@ -323,7 +323,7 @@ Languages not yet supported by Google Translate, but in process.
323
  == Frequently Asked Questions ==
324
 
325
  = It doesn't work, what to do? =
326
- Please check [GTranslate Forum](https://gtranslate.io/forum/) and feel free to create a new topic if you cannot find answers.
327
 
328
  = Can I exclude some parts from being translated? =
329
  Yes, you need to wrap the text you don't want to be translated with &lt;span class=&quot;notranslate&quot;&gt;&lt;/span&gt;.
@@ -398,6 +398,9 @@ You need to go to the language you want to edit, for instance, French: http://do
398
 
399
  == Changelog ==
400
 
 
 
 
401
  = 2.0.20 =
402
  * Fix for depreciated code: PLUGINDIR
403
 
3
  Author: Edvard Ananyan
4
  Tags: translation proxy, localization, translate, translation, localization, google translate, language, multilingual, multilanguage, bilingual, tradurre, traducir, traduire, traduzione, ubersetzung, mehrsprachig, oversette, oversatta, vertaling, vertaler, meertalig, polylang, qtranslate, transposh
5
  Requires at least: 2.8
6
+ Tested up to: 4.7
7
+ Stable tag: 2.0.21
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Donate link: https://gtranslate.io/?xyz=998#pricing
11
 
12
+ Translate WordPress with Google Translate to make your website multilingual and available to more than 99% of internet users.
13
 
14
  == Description ==
15
 
17
 
18
  GTranslate is a leading website translation services provider since 2008 and powers more than 500.000 websites worldwide.
19
 
20
+ Please use [GTranslate Support](https://wordpress.org/support/plugin/gtranslate) for your questions and support requests!
21
 
22
  Please check our [FAQ](https://gtranslate.io/?xyz=998#faq) to get quick answers.
23
 
323
  == Frequently Asked Questions ==
324
 
325
  = It doesn't work, what to do? =
326
+ Please check [GTranslate Support Forum](https://wordpress.org/support/plugin/gtranslate) and feel free to create a new topic if you cannot find answers.
327
 
328
  = Can I exclude some parts from being translated? =
329
  Yes, you need to wrap the text you don't want to be translated with &lt;span class=&quot;notranslate&quot;&gt;&lt;/span&gt;.
398
 
399
  == Changelog ==
400
 
401
+ = 2.0.21 =
402
+ * New option to render in primary menu
403
+
404
  = 2.0.20 =
405
  * Fix for depreciated code: PLUGINDIR
406