Translate WordPress with GTranslate - Version 1.0.5

Version Description

  • Bug fixed: settings save problem
Download this release

Release Info

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

Code changes from version 1.0.4 to 1.0.5

Files changed (2) hide show
  1. gtranslate.php +12 -12
  2. readme.txt +7 -4
gtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: GTranslate
4
  Plugin URI: http://edo.webmaster.am/gtranslate
5
  Description: Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
6
- Version: 1.0.4
7
  Author: Edvard Ananyan
8
  Author URI: http://edo.webmaster.am
9
 
@@ -201,8 +201,8 @@ function RefreshDoWidgetCode() {
201
  widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
202
  widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
203
  } else if(translation_method == 'on_fly') {
204
- widget_code += "if(jQuery.cookie('glang') && jQuery.cookie('glang') != '"+default_language+"') jQuery(function(\$){\$('body').translate('"+default_language+"', \$.cookie('glang'), {toggle:true});});"+new_line;
205
- widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];if(lang=='pt')lang='pt-PT';jQuery.cookie('glang', lang);jQuery(function(\$){\$('body').translate('"+default_language+"', lang, {toggle:true});});}"+new_line;
206
  }
207
 
208
  widget_code += '//]]>'+new_line;
@@ -534,14 +534,14 @@ EOT;
534
  }
535
 
536
  function load_defaults(& $data) {
537
- $data['pro_version'] = '';
538
- $data['new_window'] = '';
539
- $data['load_jquery'] = '1';
540
- $data['add_new_line'] = '1';
541
- $data['show_dropdown'] = '1';
542
- $data['show_flags'] = '1';
543
- $data['default_language'] = 'en';
544
- $data['translation_method'] = 'on_fly';
545
- $data['flag_size'] = '16';
546
  }
547
  }
3
  Plugin Name: GTranslate
4
  Plugin URI: http://edo.webmaster.am/gtranslate
5
  Description: Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
6
+ Version: 1.0.5
7
  Author: Edvard Ananyan
8
  Author URI: http://edo.webmaster.am
9
 
201
  widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
202
  widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
203
  } else if(translation_method == 'on_fly') {
204
+ widget_code += "if(jQuery.cookie('glang') && jQuery.cookie('glang') != '"+default_language+"') jQuery(function(\$){\$('body').translate('"+default_language+"', \$.cookie('glang'), {toggle:true, not:'.notranslate'});});"+new_line;
205
+ widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];if(lang=='pt')lang='pt-PT';jQuery.cookie('glang', lang);jQuery(function(\$){\$('body').translate('"+default_language+"', lang, {toggle:true, not:'.notranslate'});});}"+new_line;
206
  }
207
 
208
  widget_code += '//]]>'+new_line;
534
  }
535
 
536
  function load_defaults(& $data) {
537
+ $data['pro_version'] = isset($data['pro_version']) ? $data['pro_version'] : '';
538
+ $data['new_window'] = isset($data['new_window']) ? $data['new_window'] : '';
539
+ $data['load_jquery'] = isset($data['load_jquery']) ? $data['load_jquery'] : '1';
540
+ $data['add_new_line'] = isset($data['add_new_line']) ? $data['add_new_line'] : '1';
541
+ $data['show_dropdown'] = isset($data['show_dropdown']) ? $data['show_dropdown'] : '1';
542
+ $data['show_flags'] = isset($data['show_flags']) ? $data['show_flags'] : '1';
543
+ $data['default_language'] = isset($data['default_language']) ? $data['default_language'] : 'en';
544
+ $data['translation_method'] = isset($data['translation_method']) ? $data['translation_method'] : 'on_fly';
545
+ $data['flag_size'] = isset($data['flag_size']) ? $data['flag_size'] : '16';
546
  }
547
  }
readme.txt CHANGED
@@ -4,14 +4,14 @@ Author: Edvard Ananyan
4
  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: 2.9
8
- Stable tag: 1.0.4
9
 
10
  Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
11
 
12
  == Description ==
13
 
14
- This module uses Google power to translate your web page. With 58 available languages your site will be available to more than 98% of internet users.
15
 
16
  * Hides "Suggest better translation" pop-up
17
  * Hides Google top frame after translation
@@ -56,4 +56,7 @@ It's a Google translation, hence Google quality.
56
  * Stable version released
57
 
58
  = 1.0.4 =
59
- * Minor changes
 
 
 
4
  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.0
8
+ Stable tag: 1.0.5
9
 
10
  Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
11
 
12
  == Description ==
13
 
14
+ This module uses Google power to translate your web page. With 58 available languages your site will be available to more than 98% of internet users. Visit http://edo.webmaster.am/gtranslate for more details and features.
15
 
16
  * Hides "Suggest better translation" pop-up
17
  * Hides Google top frame after translation
56
  * Stable version released
57
 
58
  = 1.0.4 =
59
+ * Minor changes
60
+
61
+ = 1.0.5 =
62
+ * Bug fixed: settings save problem