Translate WordPress with GTranslate - Version 1.0.22

Version Description

  • Bug fixed with language change in Pro mode
  • Added noscript tag
Download this release

Release Info

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

Code changes from version 1.0.21 to 1.0.22

Files changed (2) hide show
  1. gtranslate.php +7 -6
  2. readme.txt +11 -2
gtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: GTranslate
4
  Plugin URI: http://edo.webmaster.am/gtranslate?xyz=998
5
  Description: Get translations with a single click between 58 languages (more than 98% of internet users) on your website! For support visit <a href="http://edo.webmaster.am/forum/gtranslate/">GTranslate Forum</a>.
6
- Version: 1.0.21
7
  Author: Edvard Ananyan
8
  Author URI: http://edo.webmaster.am
9
 
@@ -86,6 +86,7 @@ class GTranslate extends WP_Widget {
86
  echo $data['widget_code'];
87
  echo $args['after_widget'];
88
  //echo '<img src="http://cmshippo.com/gstats.png" width="0" height="0" alt="g-stats" class="gstats" />';
 
89
  }
90
 
91
  function get_widget_code($atts) {
@@ -95,7 +96,7 @@ class GTranslate extends WP_Widget {
95
  if(empty($data['widget_code']))
96
  return 'Configure it from WP-Admin -> Settings -> GTranslate to see it in action.';
97
  else
98
- return $data['widget_code'];
99
  //.'<img src="http://cmshippo.com/gstats.png" width="0" height="0" alt="g-stats" class="gstats" />';
100
  }
101
 
@@ -201,14 +202,14 @@ function RefreshDoWidgetCode() {
201
  if(pro_version && translation_method == 'redirect' && new_window) {
202
  widget_code += "function openTab(url) {var form=document.createElement('form');form.method='post';form.action=url;form.target='_blank';document.body.appendChild(form);form.submit();}"+new_line;
203
  if(analytics)
204
- widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang, '')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang, '')+location.search);}"+new_line;
205
  else
206
- widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang, '')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang, '')+location.search);}"+new_line;
207
  } else if(pro_version && translation_method == 'redirect') {
208
  if(analytics)
209
- widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang, '')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang, '')+location.search;}"+new_line;
210
  else
211
- widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang, '')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang, '')+location.search;}"+new_line;
212
  } else if(translation_method == 'redirect' && new_window) {
213
  widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
214
  widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
3
  Plugin Name: GTranslate
4
  Plugin URI: http://edo.webmaster.am/gtranslate?xyz=998
5
  Description: Get translations with a single click between 58 languages (more than 98% of internet users) on your website! For support visit <a href="http://edo.webmaster.am/forum/gtranslate/">GTranslate Forum</a>.
6
+ Version: 1.0.22
7
  Author: Edvard Ananyan
8
  Author URI: http://edo.webmaster.am
9
 
86
  echo $data['widget_code'];
87
  echo $args['after_widget'];
88
  //echo '<img src="http://cmshippo.com/gstats.png" width="0" height="0" alt="g-stats" class="gstats" />';
89
+ echo '<noscript>Javascript is required to use this <a href="http://edo.webmaster.am/gtranslate">website translator</a>, <a href="http://edo.webmaster.am/gtranslate">site translator</a>, <a href="http://edo.webmaster.am/gtranslate">automatic translation</a>, <a href="http://edo.webmaster.am/gtranslate">machine translation</a></noscript>';
90
  }
91
 
92
  function get_widget_code($atts) {
96
  if(empty($data['widget_code']))
97
  return 'Configure it from WP-Admin -> Settings -> GTranslate to see it in action.';
98
  else
99
+ return $data['widget_code'].'<noscript>Javascript is required to use this <a href="http://edo.webmaster.am/gtranslate">website translator</a>, <a href="http://edo.webmaster.am/gtranslate">site translator</a>, <a href="http://edo.webmaster.am/gtranslate">automatic translation</a>, <a href="http://edo.webmaster.am/gtranslate">machine translation</a></noscript>';
100
  //.'<img src="http://cmshippo.com/gstats.png" width="0" height="0" alt="g-stats" class="gstats" />';
101
  }
102
 
202
  if(pro_version && translation_method == 'redirect' && new_window) {
203
  widget_code += "function openTab(url) {var form=document.createElement('form');form.method='post';form.action=url;form.target='_blank';document.body.appendChild(form);form.submit();}"+new_line;
204
  if(analytics)
205
+ widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
206
  else
207
+ widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
208
  } else if(pro_version && translation_method == 'redirect') {
209
  if(analytics)
210
+ widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
211
  else
212
+ widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
213
  } else if(translation_method == 'redirect' && new_window) {
214
  widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
215
  widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: http://edo.webmaster.am/gtranslate
5
  Tags: widget, plugin, sidebar, google, translate, translation, automatic translator, google translate, ajax translator, jquery translator
6
  Requires at least: 2.3
7
  Tested up to: 3.1
8
- Stable tag: 1.0.21
9
 
10
  Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
11
 
@@ -63,6 +63,10 @@ Yes, you need to wrap the text you don't want to be translated with &lt;span cla
63
 
64
  == Changelog ==
65
 
 
 
 
 
66
  = 1.0.21 =
67
  * Statistics collector temporarily disabled
68
 
@@ -134,4 +138,9 @@ Yes, you need to wrap the text you don't want to be translated with &lt;span cla
134
  * RC1 version
135
 
136
  = 1.0.0 =
137
- * Initial version for WordPress
 
 
 
 
 
5
  Tags: widget, plugin, sidebar, google, translate, translation, automatic translator, google translate, ajax translator, jquery translator
6
  Requires at least: 2.3
7
  Tested up to: 3.1
8
+ Stable tag: 1.0.22
9
 
10
  Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
11
 
63
 
64
  == Changelog ==
65
 
66
+ = 1.0.22 =
67
+ * Bug fixed with language change in Pro mode
68
+ * Added noscript tag
69
+
70
  = 1.0.21 =
71
  * Statistics collector temporarily disabled
72
 
138
  * RC1 version
139
 
140
  = 1.0.0 =
141
+ * Initial version for WordPress
142
+
143
+ == Upgrade Notice ==
144
+
145
+ = 1.0.22 =
146
+ Users are highly recommended to upgrade to this version!