Google Language Translator - Version 6.0.13

Version Description

  • Fix for PHP 8
  • CSS added to hide Google Translate popup on text hover
Download this release

Release Info

Developer edo888
Plugin Icon wp plugin Google Language Translator
Version 6.0.13
Comparing to
See all releases

Code changes from version 6.0.12 to 6.0.13

Files changed (3) hide show
  1. css/style.php +115 -134
  2. google-language-translator.php +2 -2
  3. readme.txt +6 -2
css/style.php CHANGED
@@ -1,134 +1,115 @@
1
- <?php
2
-
3
- $glt_css = get_option("googlelanguagetranslator_css");
4
- $language_switcher_width = get_option('glt_language_switcher_width');
5
- $language_switcher_text_color = get_option('glt_language_switcher_text_color');
6
- $language_switcher_bg_color = get_option('glt_language_switcher_bg_color');
7
- $glt_display = get_option('googlelanguagetranslator_display');
8
- $floating_widget_position = get_option ('glt_floating_widget_position');
9
- $floating_widget_text_color = get_option ('glt_floating_widget_text_color');
10
- $floating_widget_bg_color = get_option('glt_floating_widget_bg_color');
11
-
12
- echo '<style type="text/css">';
13
- echo $glt_css;
14
-
15
- if (get_option('googlelanguagetranslator_flags') == 1):
16
- if(get_option('googlelanguagetranslator_display')=='Vertical'):
17
- echo 'p.hello { font-size:12px; color:darkgray; }';
18
- echo '#google_language_translator, #flags { text-align:left; }';
19
- elseif (get_option('googlelanguagetranslator_display')=='Horizontal'):
20
- if (get_option('googlelanguagetranslator_flags_alignment')=='flags_right'):
21
- echo '#google_language_translator { text-align:left !important; }';
22
- echo 'select.goog-te-combo { float:right; }';
23
- echo '.goog-te-gadget { padding-top:13px; }';
24
- echo '.goog-te-gadget .goog-te-combo { margin-top:-7px !important; }';
25
- endif;
26
- echo '.goog-te-gadget { margin-top:2px !important; }';
27
- echo 'p.hello { font-size:12px; color:#666; }';
28
- elseif (get_option('googlelanguagetranslator_display')=='SIMPLE'):
29
- if (get_option('googlelanguagetranslator_flags_alignment')=='flags_right'):
30
- echo '.goog-te-gadget { float:right; clear:right; }';
31
- endif;
32
- endif;
33
-
34
- if ( get_option ('googlelanguagetranslator_flags_alignment') == 'flags_right'):
35
- echo '#google_language_translator, #language { clear:both; width:160px; text-align:right; }';
36
- echo '#language { float:right; }';
37
- echo '#flags { text-align:right; width:165px; float:right; clear:right; }';
38
- echo '#flags ul { float:right !important; }';
39
- echo 'p.hello { text-align:right; float:right; clear:both; }';
40
- echo '.glt-clear { height:0px; clear:both; margin:0px; padding:0px; }';
41
- endif;
42
-
43
- if ( get_option ('googlelanguagetranslator_flags_alignment') == 'flags_left'):
44
- echo '#google_language_translator { clear:both; }';
45
- echo '#flags { width:165px; }';
46
- echo '#flags a { display:inline-block; margin-right:2px; }';
47
- elseif ( get_option ('googlelanguagetranslator_flags_alignment') == 'flags_right'):
48
- echo '#flags { width:165px; }';
49
- echo '#flags a { display:inline-block; margin-left:2px; }';
50
- endif;
51
- endif;
52
-
53
- if (get_option('googlelanguagetranslator_showbranding')=='Yes'):
54
- if(get_option('googlelanguagetranslator_active')==1):
55
- echo '#google_language_translator { width:auto !important; }';
56
- endif;
57
- elseif (get_option('googlelanguagetranslator_showbranding')=='No' && get_option('googlelanguagetranslator_display')!='SIMPLE'):
58
- if(get_option('googlelanguagetranslator_active')==1):
59
- echo '#google_language_translator a {display: none !important; }';
60
- echo '.goog-te-gadget {color:transparent !important;}';
61
- echo '.goog-te-gadget { font-size:0px !important; }';
62
- echo '.goog-branding { display:none; }';
63
- endif;
64
- endif;
65
-
66
- if (get_option('googlelanguagetranslator_active')==1) {
67
- echo '.goog-tooltip {display: none !important;}';
68
- echo '.goog-tooltip:hover {display: none !important;}';
69
- echo '.goog-text-highlight {background-color: transparent !important; border: none !important; box-shadow: none !important;}';
70
- }
71
-
72
- if (get_option('googlelanguagetranslator_translatebox') == 'no'):
73
- if(get_option('googlelanguagetranslator_active')==1):
74
- echo '#google_language_translator { display:none; }';
75
- endif;
76
- endif;
77
-
78
- if (!empty($language_switcher_text_color)):
79
- echo '#google_language_translator select.goog-te-combo { color:'.$language_switcher_text_color.'; }';
80
- endif;
81
-
82
- if (get_option('googlelanguagetranslator_flags') == 0):
83
- if(get_option('googlelanguagetranslator_active') ==1):
84
- echo '#flags { display:none; }';
85
- endif;
86
- endif;
87
-
88
- if (get_option('googlelanguagetranslator_toolbar')=='Yes'):
89
- if (get_option('googlelanguagetranslator_active')==1):
90
- echo '#google_language_translator {color: transparent;}';
91
- echo 'body { top:0px !important; }';
92
- endif;
93
- elseif (get_option('googlelanguagetranslator_toolbar')=='No'):
94
- if (get_option('googlelanguagetranslator_active')==1):
95
- echo '.goog-te-banner-frame{visibility:hidden !important;}';
96
- echo 'body { top:0px !important;}';
97
- endif;
98
- endif;
99
-
100
- if ($floating_widget_position == 'bottom_left'):
101
- echo '#glt-translate-trigger { left:20px; right:auto; }';
102
- elseif ($floating_widget_position == 'top_right'):
103
- echo '#glt-translate-trigger { bottom:auto; top:0; }';
104
- echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
105
- echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
106
- elseif ($floating_widget_position == 'top_left'):
107
- echo '#glt-translate-trigger { bottom:auto; top:0; left:20px; right:auto; }';
108
- echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
109
- echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
110
- elseif ($floating_widget_position == 'top_center'):
111
- echo '#glt-translate-trigger { bottom:auto; top:0; left:50%; margin-left:-63px; right:auto; }';
112
- echo '.tool-container.tool-top { top:50px !important; bottom:auto !important; }';
113
- echo '.tool-container.tool-top .arrow { border-color:transparent transparent #d0cbcb; top:-14px; }';
114
- elseif ($floating_widget_position == 'bottom_center'):
115
- echo '#glt-translate-trigger { left:50%; margin-left:-63px; right:auto; }';
116
- endif;
117
-
118
- if (!empty($floating_widget_text_color)):
119
- echo '#glt-translate-trigger > span { color:'.$floating_widget_text_color.'; }';
120
- endif;
121
-
122
- if (!empty($floating_widget_bg_color)):
123
- echo '#glt-translate-trigger { background:'.$floating_widget_bg_color.'; }';
124
- endif;
125
-
126
- if (!empty($language_switcher_width) && isset($language_switcher_width) && $glt_display != 'Horizontal'):
127
- echo '.goog-te-gadget .goog-te-combo { width:'.$language_switcher_width.'; }';
128
- endif;
129
-
130
- if (!empty($language_switcher_bg_color) && isset($language_switcher_bg_color)):
131
- echo '#google_language_translator .goog-te-gadget .goog-te-combo { background:'.$language_switcher_bg_color.'; border:0 !important; }';
132
- endif;
133
-
134
- echo '</style>'; ?>
1
+ <?php
2
+ $glt_css = get_option('googlelanguagetranslator_css');
3
+ $language_switcher_width = get_option('glt_language_switcher_width');
4
+ $language_switcher_text_color = get_option('glt_language_switcher_text_color');
5
+ $language_switcher_bg_color = get_option('glt_language_switcher_bg_color');
6
+ $glt_display = get_option('googlelanguagetranslator_display');
7
+ $floating_widget_position = get_option ('glt_floating_widget_position');
8
+ $floating_widget_text_color = get_option ('glt_floating_widget_text_color');
9
+ $floating_widget_bg_color = get_option('glt_floating_widget_bg_color');
10
+
11
+ echo '<style>';
12
+ echo $glt_css;
13
+
14
+ if(get_option('googlelanguagetranslator_flags') == 1) {
15
+ if(get_option('googlelanguagetranslator_display') == 'Vertical') {
16
+ echo 'p.hello{font-size:12px;color:darkgray;}';
17
+ echo '#google_language_translator,#flags{text-align:left;}';
18
+ } elseif(get_option('googlelanguagetranslator_display') == 'Horizontal') {
19
+ if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') {
20
+ echo '#google_language_translator{text-align:left!important;}';
21
+ echo 'select.goog-te-combo{float:right;}';
22
+ echo '.goog-te-gadget{padding-top:13px;}';
23
+ echo '.goog-te-gadget .goog-te-combo{margin-top:-7px!important;}';
24
+ }
25
+
26
+ echo '.goog-te-gadget{margin-top:2px!important;}';
27
+ echo 'p.hello{font-size:12px;color:#666;}';
28
+ } elseif(get_option('googlelanguagetranslator_display') == 'SIMPLE' and get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') {
29
+ echo '.goog-te-gadget{float:right;clear:right;}';
30
+ }
31
+
32
+ if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') {
33
+ echo '#google_language_translator,#language{clear:both;width:160px;text-align:right;}';
34
+ echo '#language{float:right;}';
35
+ echo '#flags{text-align:right;width:165px;float:right;clear:right;}';
36
+ echo '#flags ul{float:right!important;}';
37
+ echo 'p.hello{text-align:right;float:right;clear:both;}';
38
+ echo '.glt-clear{height:0px;clear:both;margin:0px;padding:0px;}';
39
+ }
40
+
41
+ if(get_option('googlelanguagetranslator_flags_alignment') == 'flags_left') {
42
+ echo '#google_language_translator{clear:both;}';
43
+ echo '#flags{width:165px;}';
44
+ echo '#flags a{display:inline-block;margin-right:2px;}';
45
+ } elseif(get_option('googlelanguagetranslator_flags_alignment') == 'flags_right') {
46
+ echo '#flags{width:165px;}';
47
+ echo '#flags a{display:inline-block;margin-left:2px;}';
48
+ }
49
+ }
50
+
51
+ if(get_option('googlelanguagetranslator_active') == 1) {
52
+ if(get_option('googlelanguagetranslator_showbranding') == 'Yes')
53
+ echo '#google_language_translator{width:auto!important;}';
54
+ elseif(get_option('googlelanguagetranslator_showbranding') == 'No' and get_option('googlelanguagetranslator_display') != 'SIMPLE') {
55
+ echo '#google_language_translator a{display:none!important;}';
56
+ echo '.goog-te-gadget{color:transparent!important;}';
57
+ echo '.goog-te-gadget{font-size:0px!important;}';
58
+ echo '.goog-branding{display:none;}';
59
+ }
60
+
61
+ echo '.goog-tooltip{display: none!important;}';
62
+ echo '.goog-tooltip:hover{display: none!important;}';
63
+ echo '.goog-text-highlight{background-color:transparent!important;border:none!important;box-shadow:none!important;}';
64
+
65
+ if(get_option('googlelanguagetranslator_translatebox') == 'no')
66
+ echo '#google_language_translator{display:none;}';
67
+ }
68
+
69
+ if(!empty($language_switcher_text_color))
70
+ echo '#google_language_translator select.goog-te-combo{color:'.$language_switcher_text_color.';}';
71
+
72
+ if(get_option('googlelanguagetranslator_flags') == 0 and get_option('googlelanguagetranslator_active') == 1)
73
+ echo '#flags{display:none;}';
74
+
75
+ if(get_option('googlelanguagetranslator_active') == 1) {
76
+ if(get_option('googlelanguagetranslator_toolbar') == 'Yes'){
77
+ echo '#google_language_translator{color:transparent;}';
78
+ } elseif(get_option('googlelanguagetranslator_toolbar') == 'No') {
79
+ echo '.goog-te-banner-frame{visibility:hidden!important;}';
80
+ }
81
+ echo 'body{top:0px!important;}';
82
+ echo '#goog-gt-tt{display:none!important;}';
83
+ }
84
+
85
+ if($floating_widget_position == 'bottom_left') {
86
+ echo '#glt-translate-trigger{left:20px;right:auto;}';
87
+ } elseif($floating_widget_position == 'top_right') {
88
+ echo '#glt-translate-trigger{bottom:auto;top:0;}';
89
+ echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}';
90
+ echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb; top:-14px;}';
91
+ } elseif ($floating_widget_position == 'top_left') {
92
+ echo '#glt-translate-trigger{bottom:auto;top:0;left:20px;right:auto;}';
93
+ echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}';
94
+ echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb;top:-14px;}';
95
+ } elseif ($floating_widget_position == 'top_center') {
96
+ echo '#glt-translate-trigger{bottom:auto;top:0;left:50%;margin-left:-63px;right:auto;}';
97
+ echo '.tool-container.tool-top{top:50px!important;bottom:auto!important;}';
98
+ echo '.tool-container.tool-top .arrow{border-color:transparent transparent #d0cbcb;top:-14px;}';
99
+ } elseif ($floating_widget_position == 'bottom_center') {
100
+ echo '#glt-translate-trigger{left:50%; margin-left:-63px; right:auto;}';
101
+ }
102
+
103
+ if(!empty($floating_widget_text_color))
104
+ echo '#glt-translate-trigger > span{color:'.$floating_widget_text_color.';}';
105
+
106
+ if(!empty($floating_widget_bg_color))
107
+ echo '#glt-translate-trigger{background:'.$floating_widget_bg_color.';}';
108
+
109
+ if(!empty($language_switcher_width) and isset($language_switcher_width) and $glt_display != 'Horizontal')
110
+ echo '.goog-te-gadget .goog-te-combo{width:'.$language_switcher_width.';}';
111
+
112
+ if(!empty($language_switcher_bg_color) and isset($language_switcher_bg_color))
113
+ echo '#google_language_translator .goog-te-gadget .goog-te-combo{background:'.$language_switcher_bg_color.';border:0!important;}';
114
+
115
+ echo '</style>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
google-language-translator.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: https://gtranslate.io/?xyz=3167
5
- Version: 6.0.12
6
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
  Author: Translate AI Multilingual Solutions
8
  Author URI: https://gtranslate.io
@@ -510,7 +510,7 @@ class google_language_translator {
510
  if($glt_seo_active != '1')
511
  $str.="<div id='glt-footer'>".(!isset($vertical) && !isset($horizontal) ? '<div id="google_language_translator" class="default-language-'.$default_language.'"></div>' : '')."</div><script>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : ($layout=='SIMPLE' ? $simple_layout : '')) . $auto_display . $multilanguagePage . $this->analytics()."}, 'google_language_translator');}</script>";
512
  echo $str;
513
- elseif ($is_multilanguage == 0):
514
  if($glt_seo_active != '1')
515
  $str.="<div id='glt-footer'>".(!isset($vertical) && !isset($horizontal) ? '<div id="google_language_translator" class="default-language-'.$default_language.'"></div>' : '')."</div><script>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : ($layout=='SIMPLE' ? $simple_layout : '')) . $auto_display . $this->analytics()."}, 'google_language_translator');}</script>";
516
  echo $str;
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: https://gtranslate.io/?xyz=3167
5
+ Version: 6.0.13
6
  Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Settings include: layout style, hide/show specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
7
  Author: Translate AI Multilingual Solutions
8
  Author URI: https://gtranslate.io
510
  if($glt_seo_active != '1')
511
  $str.="<div id='glt-footer'>".(!isset($vertical) && !isset($horizontal) ? '<div id="google_language_translator" class="default-language-'.$default_language.'"></div>' : '')."</div><script>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : ($layout=='SIMPLE' ? $simple_layout : '')) . $auto_display . $multilanguagePage . $this->analytics()."}, 'google_language_translator');}</script>";
512
  echo $str;
513
+ else:
514
  if($glt_seo_active != '1')
515
  $str.="<div id='glt-footer'>".(!isset($vertical) && !isset($horizontal) ? '<div id="google_language_translator" class="default-language-'.$default_language.'"></div>' : '')."</div><script>function GoogleLanguageTranslatorInit() { new google.translate.TranslateElement({pageLanguage: '".$default_language."'".$language_choices . ($layout=='Horizontal' ? $horizontal_layout : ($layout=='SIMPLE' ? $simple_layout : '')) . $auto_display . $this->analytics()."}, 'google_language_translator');}</script>";
516
  echo $str;
readme.txt CHANGED
@@ -5,8 +5,8 @@ Author: Translate AI Multilingual Solutions
5
  Author URI: https://gtranslate.io/?xyz=3167
6
  Tags: translate wordpress, translate, translator, translation, language, multi language
7
  Requires at least: 2.9
8
- Tested up to: 5.8
9
- Stable tag: 6.0.12
10
 
11
  Translate WordPress with Google Language Translator multilanguage plugin which allows to insert Google Translate widget anywhere on your website.
12
 
@@ -155,6 +155,10 @@ If you want us to translate your website professionally or provide you a proofre
155
  Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
156
 
157
  == Changelog ==
 
 
 
 
158
  = 6.0.12 =
159
  * Sanitize admin HTML input with wp_kses_post to avoid self hurting
160
  * Avoid minification of Google Translate javascript library by LiteSpeed Cache and WP Rocket cache plugins
5
  Author URI: https://gtranslate.io/?xyz=3167
6
  Tags: translate wordpress, translate, translator, translation, language, multi language
7
  Requires at least: 2.9
8
+ Tested up to: 5.9
9
+ Stable tag: 6.0.13
10
 
11
  Translate WordPress with Google Language Translator multilanguage plugin which allows to insert Google Translate widget anywhere on your website.
12
 
155
  Yes! Add the "notranslate" class to the HTML element containing your text. For example, the following text will be excluded from translation: <span class="notranslate">Hello World!</span>
156
 
157
  == Changelog ==
158
+ = 6.0.13 =
159
+ * Fix for PHP 8
160
+ * CSS added to hide Google Translate popup on text hover
161
+
162
  = 6.0.12 =
163
  * Sanitize admin HTML input with wp_kses_post to avoid self hurting
164
  * Avoid minification of Google Translate javascript library by LiteSpeed Cache and WP Rocket cache plugins