Google Language Translator - Version 2.8

Version Description

Download this release

Release Info

Developer rm2773
Plugin Icon wp plugin Google Language Translator
Version 2.8
Comparing to
See all releases

Code changes from version 2.7 to 2.8

Files changed (78) hide show
  1. css/style.css +2 -4
  2. google-language-translator.php +129 -29
  3. images/arrow_down.png +0 -0
  4. images/flags164444/Jersey.png +0 -0
  5. images/flags164444/Jordan.png +0 -0
  6. images/flags164444/Togo.png +0 -0
  7. images/flags164444/albania.png +0 -0
  8. images/flags164444/armenia.png +0 -0
  9. images/flags164444/azerbaijan.png +0 -0
  10. images/flags164444/bangladesh.png +0 -0
  11. images/flags164444/basque.png +0 -0
  12. images/flags164444/belarus.png +0 -0
  13. images/flags164444/bosnia.png +0 -0
  14. images/flags164444/bulgaria.png +0 -0
  15. images/flags164444/cambodia.png +0 -0
  16. images/flags164444/china.png +0 -0
  17. images/flags164444/croatia.png +0 -0
  18. images/flags164444/czechrepublic.png +0 -0
  19. images/flags164444/denmark.png +0 -0
  20. images/flags164444/esperanto.png +0 -0
  21. images/flags164444/estonia.png +0 -0
  22. images/flags164444/finland.png +0 -0
  23. images/flags164444/france.png +0 -0
  24. images/flags164444/galicia.png +0 -0
  25. images/flags164444/georgia.png +0 -0
  26. images/flags164444/germany.png +0 -0
  27. images/flags164444/greece.png +0 -0
  28. images/flags164444/gujarati.png +0 -0
  29. images/flags164444/haiti.png +0 -0
  30. images/flags164444/hmong.png +0 -0
  31. images/flags164444/hungary.png +0 -0
  32. images/flags164444/iceland.png +0 -0
  33. images/flags164444/india.png +0 -0
  34. images/flags164444/indonesia.png +0 -0
  35. images/flags164444/iran.png +0 -0
  36. images/flags164444/ireland.png +0 -0
  37. images/flags164444/israel.png +0 -0
  38. images/flags164444/italy.png +0 -0
  39. images/flags164444/japan.png +0 -0
  40. images/flags164444/kannada.png +0 -0
  41. images/flags164444/kenya.png +0 -0
  42. images/flags164444/korea.png +0 -0
  43. images/flags164444/laos.png +0 -0
  44. images/flags164444/latin.png +0 -0
  45. images/flags164444/latvia.png +0 -0
  46. images/flags164444/lithuania.png +0 -0
  47. images/flags164444/macedonia.png +0 -0
  48. images/flags164444/malaysia.png +0 -0
  49. images/flags164444/malta.png +0 -0
  50. images/flags164444/marathi.png +0 -0
  51. images/flags164444/netherlands.png +0 -0
  52. images/flags164444/norway.png +0 -0
  53. images/flags164444/pakistan.png +0 -0
  54. images/flags164444/philippines.png +0 -0
  55. images/flags164444/poland.png +0 -0
  56. images/flags164444/portugal.png +0 -0
  57. images/flags164444/romania.png +0 -0
  58. images/flags164444/russia.png +0 -0
  59. images/flags164444/saudiarabia.png +0 -0
  60. images/flags164444/serbia.png +0 -0
  61. images/flags164444/slovakia.png +0 -0
  62. images/flags164444/slovenia.png +0 -0
  63. images/flags164444/southafrica.png +0 -0
  64. images/flags164444/spain.png +0 -0
  65. images/flags164444/sweden.png +0 -0
  66. images/flags164444/tamil.png +0 -0
  67. images/flags164444/telugu.png +0 -0
  68. images/flags164444/thailand.png +0 -0
  69. images/flags164444/turkey.png +0 -0
  70. images/flags164444/ukraine.png +0 -0
  71. images/flags164444/unitedkingdom.png +0 -0
  72. images/flags164444/vietnam.png +0 -0
  73. images/flags164444/wales.png +0 -0
  74. images/flags164444/yiddish.png +0 -0
  75. images/logo.png +0 -0
  76. images/logo_slogan.png +0 -0
  77. images/switcher.png +0 -0
  78. readme.txt +124 -118
css/style.css CHANGED
@@ -49,8 +49,6 @@ p.hello {
49
  .flag{
50
  font-size:16px;
51
  padding:1px 0;
52
- background-repeat:no-repeat;
53
- background-image:url(/modules/mod_gtranslate/tmpl/lang/16.png);
54
  }
55
 
56
  .flag img,.alt_flag img{
@@ -206,6 +204,6 @@ span.vertical-translator {
206
  /* Force overflow content to show so that the drop-down will show */
207
 
208
  .widget { overflow:visible !important; }
 
209
 
210
- /*#sidebar { overflow:visible !important; }*/
211
-
49
  .flag{
50
  font-size:16px;
51
  padding:1px 0;
 
 
52
  }
53
 
54
  .flag img,.alt_flag img{
204
  /* Force overflow content to show so that the drop-down will show */
205
 
206
  .widget { overflow:visible !important; }
207
+
208
 
209
+ #features { list-style:square; margin-left:30px; }
 
google-language-translator.php CHANGED
@@ -2,9 +2,9 @@
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 2.7
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: rm2773
8
  Author URI: http://www.studio88design.com/
9
  */
10
 
@@ -25,6 +25,8 @@ function glt_activate() {
25
  add_option('googlelanguagetranslator_analytics',1);
26
  add_option('googlelanguagetranslator_analytics_id','');
27
  add_option('googlelanguagetranslator_css','');
 
 
28
  }
29
 
30
  include( plugin_dir_path( __FILE__ ) . 'widget.php');
@@ -111,12 +113,17 @@ add_action('admin_head','load_css_overrides');
111
  add_action ('wp_head','googlelanguagetranslator_flags_display');
112
  add_action ('admin_head','googlelanguagetranslator_flags_display');
113
  }
 
 
 
 
 
114
  add_shortcode( 'google-translator', 'google_translator_shortcode');
115
 
116
  add_filter('widget_text', 'do_shortcode');
117
 
118
  function page_layout_cb() { ?>
119
- <div class="wrap" style="width:89%">
120
  <div id="icon-options-general" class="icon32"></div>
121
  <h2><span class="notranslate">Google Language Translator</span></h2>
122
  <form action="<?php echo admin_url('options.php'); ?>" method="post">
@@ -127,7 +134,7 @@ function page_layout_cb() { ?>
127
  <?php settings_fields('google_language_translator'); ?>
128
  <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
129
  <tr>
130
- <td class="notranslate">Plugin Status:</td>
131
  <td class="notranslate"><?php googlelanguagetranslator_active_cb(); ?></td>
132
  </tr>
133
 
@@ -146,7 +153,7 @@ function page_layout_cb() { ?>
146
  </tr>
147
 
148
  <tr class="notranslate">
149
- <td class="choose_flags_intro">Show flag images?<br/>(Display up to 70 flags above the translator)</td>
150
  <td class="choose_flags_intro"><?php googlelanguagetranslator_flags_cb(); ?></td>
151
  </tr>
152
 
@@ -186,6 +193,16 @@ function page_layout_cb() { ?>
186
  <td class="flagdisplay"><?php googlelanguagetranslator_flags_alignment_cb(); ?></td>
187
  </tr>
188
 
 
 
 
 
 
 
 
 
 
 
189
  <tr class="notranslate">
190
  <td>Google Analytics:</td>
191
  <td><?php googlelanguagetranslator_analytics_cb(); ?></td>
@@ -200,8 +217,10 @@ function page_layout_cb() { ?>
200
  <td>Copy/Paste this shortcode if adding to pages/posts:</td>
201
  <td>[google-translator]</td>
202
  </tr>
 
203
 
204
- <tr class="notranslate">
 
205
  <td>Copy/Paste this code if adding to header/footer:</td>
206
  <td>&lt?php echo do_shortcode('[google-translator]'); ?&gt</td>
207
  </tr>
@@ -210,12 +229,12 @@ function page_layout_cb() { ?>
210
  <td><?php submit_button(); ?></td>
211
  <td></td>
212
  </tr>
213
- </table>
214
 
215
  </div> <!-- .postbox -->
216
  </div> <!-- .metbox-holder -->
217
 
218
- <div class="metabox-holder" style="float:right; clear:right; width:33%; min-width:350px; ">
219
  <div class="postbox">
220
  <h3 class="notranslate">Preview</h3>
221
  <table style="width:100%">
@@ -238,6 +257,23 @@ function page_layout_cb() { ?>
238
  </div>
239
  </form>
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  <div class="metabox-holder notranslate" style="float: right; width: 33%;">
242
  <div class="postbox">
243
  <h3>Please Consider A Donation</h3>
@@ -298,7 +334,8 @@ function initialize_settings() {
298
  add_settings_field( 'googlelanguagetranslator_analytics','Activate Google Analytics tracking?','googlelanguagetranslator_analytics_cb','google_language_translator','glt_settings');
299
  add_settings_field( 'googlelanguagetranslator_analytics_id','Enter your Google Analytics ID','googlelanguagetranslator_analytics_id_cb','google_language_translator','glt_settings');
300
  add_settings_field( 'googlelanguagetranslator_css','Custom CSS Overrides','googlelanguagetranslator_css_cb','google_language_translator','glt_settings');
301
-
 
302
 
303
 
304
 
@@ -319,6 +356,8 @@ function initialize_settings() {
319
  register_setting( 'google_language_translator','googlelanguagetranslator_analytics');
320
  register_setting( 'google_language_translator','googlelanguagetranslator_analytics_id');
321
  register_setting( 'google_language_translator','googlelanguagetranslator_css');
 
 
322
 
323
  function googlelanguagetranslator_active_cb() {
324
 
@@ -535,7 +574,7 @@ function initialize_settings() {
535
  }
536
 
537
  if (!isset ( $get_language_choices ['en'] ) ) {
538
- $get_language_choices['en'] = 0;
539
  }
540
 
541
  if (!isset ( $get_language_choices ['eo'] ) ) {
@@ -944,7 +983,7 @@ function initialize_settings() {
944
  }
945
 
946
  if (!isset ( $get_flag_choices ['flag-en'] ) ) {
947
- $get_flag_choices['flag-en'] = 0;
948
  }
949
 
950
  if (!isset ( $get_flag_choices ['flag-eo'] ) ) {
@@ -1334,13 +1373,13 @@ function initialize_settings() {
1334
  if ( get_option( $option_name ) === false ) {
1335
 
1336
  // The option does not exist, so we update it.
1337
- update_option( $option_name, $new_value );
1338
  }
1339
 
1340
  $options = get_option (''.$option_name.''); ?>
1341
 
1342
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="googlelanguagetranslator_flags_alignment" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
1343
- <input type="radio" name="googlelanguagetranslator_flags_alignment" id="googlelanguagetranslator_flags_alignment" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
1344
  <?php }
1345
 
1346
 
@@ -1394,6 +1433,39 @@ function initialize_settings() {
1394
  $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
1395
  echo $html;
1396
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1397
 
1398
 
1399
 
@@ -1742,13 +1814,26 @@ function googlelanguagetranslator_vertical(){
1742
 
1743
  $str.='</div>';
1744
 
 
 
 
 
 
 
 
 
 
 
 
 
1745
 
1746
- $str.='<script type="text/javascript">
1747
  function GoogleLanguageTranslatorInit() {
1748
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', multilanguagePage: true, '.$language_choices.'autoDisplay: false, '.analytics().' }, \'google_language_translator\');}
1749
  </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
1750
  <div id="google_language_translator"></div>';
1751
  return $str;
 
1752
 
1753
  }
1754
  }
@@ -2062,30 +2147,37 @@ function googlelanguagetranslator_horizontal(){
2062
  $str.='<a id="Yiddish" href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|yi\'); return false;" title="Yiddish (Jewish)" class="notranslate flag yi"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/yiddish.png" height="18" width="18" alt="Yiddish"/></a>';
2063
  }
2064
  $str.='</div>';
 
 
 
 
 
2065
 
2066
-
2067
-
2068
- $str.='<script type="text/javascript">
2069
  function GoogleLanguageTranslatorInit() {
2070
- new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', multilanguagePage: true, '.$language_choices.' layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,autoDisplay: false }, \'google_language_translator\'); }
2071
  </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
2072
  <div id="google_language_translator"></div>';
2073
  return $str;
 
2074
 
2075
- }
 
 
 
 
 
 
 
 
2076
  }
2077
  }
2078
 
2079
-
2080
-
2081
  function googlelanguagetranslator_toolbar_yes(){
2082
  if(get_option('googlelanguagetranslator_active')==1) { ?>
2083
  <style type="text/css">
2084
  #google_language_translator {color: transparent;}
2085
  .goog-te-gadget .goog-te-combo {margin: 2px 0px !important;}
2086
- .goog-tooltip {display: none !important;}
2087
- .goog-tooltip:hover {display: none !important;}
2088
- .goog-text-highlight {background-color: transparent !important; border: none !important;box-shadow: none !important;}
2089
  </style>
2090
  <?php
2091
  }
@@ -2107,9 +2199,6 @@ function googlelanguagetranslator_showbranding_yes() {
2107
  <style type="text/css">
2108
  #google_language_translator { width:auto !important; }
2109
  .goog-te-gadget .goog-te-combo {margin: 4px 0px !important;}
2110
- .goog-tooltip {display: none !important;}
2111
- .goog-tooltip:hover {display: none !important;}
2112
- .goog-text-highlight {background-color: transparent !important; border: none !important; box-shadow: none !important;}
2113
  </style>
2114
  <?php
2115
  }
@@ -2152,6 +2241,17 @@ a.goog-logo-link { display:none; }
2152
  }
2153
  }
2154
 
 
 
 
 
 
 
 
 
 
 
 
2155
  function googlelanguagetranslator_flags_display() {
2156
  $options = get_option ('googlelanguagetranslator_flag_size'); ?>
2157
 
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
+ Version: 2.8
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: Rob Myrick
8
  Author URI: http://www.studio88design.com/
9
  */
10
 
25
  add_option('googlelanguagetranslator_analytics',1);
26
  add_option('googlelanguagetranslator_analytics_id','');
27
  add_option('googlelanguagetranslator_css','');
28
+ add_option('googlelanguagetranslator_manage_translations',0);
29
+ add_option('googlelanguagetranslator_multilanguage',0);
30
  }
31
 
32
  include( plugin_dir_path( __FILE__ ) . 'widget.php');
113
  add_action ('wp_head','googlelanguagetranslator_flags_display');
114
  add_action ('admin_head','googlelanguagetranslator_flags_display');
115
  }
116
+
117
+ if (get_option('googlelanguagetranslator_manage_translations') == 0) {
118
+ add_action ('wp_head','googlelanguagetranslator_manage_translations_no');
119
+ add_action ('admin_head','googlelanguagetranslator_manage_translations_no');
120
+ }
121
  add_shortcode( 'google-translator', 'google_translator_shortcode');
122
 
123
  add_filter('widget_text', 'do_shortcode');
124
 
125
  function page_layout_cb() { ?>
126
+ <div class="wrap">
127
  <div id="icon-options-general" class="icon32"></div>
128
  <h2><span class="notranslate">Google Language Translator</span></h2>
129
  <form action="<?php echo admin_url('options.php'); ?>" method="post">
134
  <?php settings_fields('google_language_translator'); ?>
135
  <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
136
  <tr>
137
+ <td style="width:60%" class="notranslate">Plugin Status:</td>
138
  <td class="notranslate"><?php googlelanguagetranslator_active_cb(); ?></td>
139
  </tr>
140
 
153
  </tr>
154
 
155
  <tr class="notranslate">
156
+ <td class="choose_flags_intro">Show flag images?<br/>(Display up to 72 flags above the translator)</td>
157
  <td class="choose_flags_intro"><?php googlelanguagetranslator_flags_cb(); ?></td>
158
  </tr>
159
 
193
  <td class="flagdisplay"><?php googlelanguagetranslator_flags_alignment_cb(); ?></td>
194
  </tr>
195
 
196
+ <tr class="manage_translations notranslate">
197
+ <td>Turn on translation management?<br/>(Managed directly through your Google account. Requires <a href="http://translate.google.com/manager/website/settings" target="_blank">Google Translate</a> meta tag installed in header.)</td>
198
+ <td><?php googlelanguagetranslator_manage_translations_cb(); ?></td>
199
+ </tr>
200
+
201
+ <tr class="multilanguage notranslate">
202
+ <td>Multilanguage Page Option?: (<em>not recommended)</em><br/>(If checked, a "forced" translation of your webpage will be served when returned to the default language, instead of delivering original content.)</td>
203
+ <td><?php googlelanguagetranslator_multilanguage_cb(); ?></td>
204
+ </tr>
205
+
206
  <tr class="notranslate">
207
  <td>Google Analytics:</td>
208
  <td><?php googlelanguagetranslator_analytics_cb(); ?></td>
217
  <td>Copy/Paste this shortcode if adding to pages/posts:</td>
218
  <td>[google-translator]</td>
219
  </tr>
220
+ </table>
221
 
222
+ <table style="border-collapse:separate" width="100%" border="0" cellspacing="8" cellpadding="0" class="form-table">
223
+ <tr class="notranslate">
224
  <td>Copy/Paste this code if adding to header/footer:</td>
225
  <td>&lt?php echo do_shortcode('[google-translator]'); ?&gt</td>
226
  </tr>
229
  <td><?php submit_button(); ?></td>
230
  <td></td>
231
  </tr>
232
+ </table>
233
 
234
  </div> <!-- .postbox -->
235
  </div> <!-- .metbox-holder -->
236
 
237
+ <div class="metabox-holder" style="float:right; clear:right; width:33%">
238
  <div class="postbox">
239
  <h3 class="notranslate">Preview</h3>
240
  <table style="width:100%">
257
  </div>
258
  </form>
259
 
260
+ <div class="metabox-holder notranslate" style="float: right; width: 33%;">
261
+ <div class="postbox">
262
+ <h3>GLT Premium is Here! $12</h3>
263
+ <div class="inside"><a href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px" src="<?php echo plugins_url('google-language-translator/images/logo.png'); ?>"></a><br />
264
+ <ul id="features">
265
+ <li>Get more design and functionality options</li>
266
+ <li>Loads directly with page content, not afterward</li>
267
+ <li>jQuery-powered "Elegant" theme to engage your visitors</li>
268
+ <li>Manage your website's translations</li>
269
+ <li>Show or hide any features you want</li>
270
+ <li>Full access to our support forum</li>
271
+ <li>Full access to future updates, for life of the plugin</li>
272
+ </ul>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
  <div class="metabox-holder notranslate" style="float: right; width: 33%;">
278
  <div class="postbox">
279
  <h3>Please Consider A Donation</h3>
334
  add_settings_field( 'googlelanguagetranslator_analytics','Activate Google Analytics tracking?','googlelanguagetranslator_analytics_cb','google_language_translator','glt_settings');
335
  add_settings_field( 'googlelanguagetranslator_analytics_id','Enter your Google Analytics ID','googlelanguagetranslator_analytics_id_cb','google_language_translator','glt_settings');
336
  add_settings_field( 'googlelanguagetranslator_css','Custom CSS Overrides','googlelanguagetranslator_css_cb','google_language_translator','glt_settings');
337
+ add_settings_field( 'googlelanguagetranslator_manage_translations','Turn on translation management?','googlelanguagetranslator_manage_translations_cb','google_language_translator','glt_settings');
338
+ add_settings_field( 'googlelanguagetranslator_multilanguage','Multilanguage webpages?','googlelanguagetranslator_multilanguage_cb','google_language_translator','glt_settings');
339
 
340
 
341
 
356
  register_setting( 'google_language_translator','googlelanguagetranslator_analytics');
357
  register_setting( 'google_language_translator','googlelanguagetranslator_analytics_id');
358
  register_setting( 'google_language_translator','googlelanguagetranslator_css');
359
+ register_setting( 'google_language_translator','googlelanguagetranslator_manage_translations');
360
+ register_setting( 'google_language_translator','googlelanguagetranslator_multilanguage');
361
 
362
  function googlelanguagetranslator_active_cb() {
363
 
574
  }
575
 
576
  if (!isset ( $get_language_choices ['en'] ) ) {
577
+ $get_language_choices['en'] = 1;
578
  }
579
 
580
  if (!isset ( $get_language_choices ['eo'] ) ) {
983
  }
984
 
985
  if (!isset ( $get_flag_choices ['flag-en'] ) ) {
986
+ $get_flag_choices['flag-en'] = 1;
987
  }
988
 
989
  if (!isset ( $get_flag_choices ['flag-eo'] ) ) {
1373
  if ( get_option( $option_name ) === false ) {
1374
 
1375
  // The option does not exist, so we update it.
1376
+ update_option( $option_name, 'flags_left' );
1377
  }
1378
 
1379
  $options = get_option (''.$option_name.''); ?>
1380
 
1381
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_left" value="flags_left" <?php if($options=='flags_left'){echo "checked";}?>/> Align Left<br/>
1382
+ <input type="radio" name="googlelanguagetranslator_flags_alignment" id="flags_right" value="flags_right" <?php if($options=='flags_right'){echo "checked";}?>/> Align Right
1383
  <?php }
1384
 
1385
 
1433
  $html = '<textarea style="width:100%; height:200px" name="googlelanguagetranslator_css" id="googlelanguagetranslator_css">'.$options.'</textarea>';
1434
  echo $html;
1435
  }
1436
+
1437
+ function googlelanguagetranslator_manage_translations_cb() {
1438
+ $option_name = 'googlelanguagetranslator_manage_translations' ;
1439
+ $new_value = 0;
1440
+
1441
+ if ( get_option( $option_name ) === false ) {
1442
+
1443
+ // The option does not exist, so we update it.
1444
+ update_option( $option_name, $new_value );
1445
+ }
1446
+
1447
+ $options = get_option (''.$option_name.'');
1448
+
1449
+ $html = '<input type="checkbox" name="googlelanguagetranslator_manage_translations" id="googlelanguagetranslator_manage_translations" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on translation management?';
1450
+ echo $html;
1451
+ }
1452
+
1453
+ function googlelanguagetranslator_multilanguage_cb() {
1454
+
1455
+ $option_name = 'googlelanguagetranslator_multilanguage' ;
1456
+ $new_value = 0;
1457
+
1458
+ if ( get_option( $option_name ) === false ) {
1459
+
1460
+ // The option does not exist, so we update it.
1461
+ update_option( $option_name, $new_value );
1462
+ }
1463
+
1464
+ $options = get_option (''.$option_name.'');
1465
+
1466
+ $html = '<input type="checkbox" name="googlelanguagetranslator_multilanguage" id="googlelanguagetranslator_multilanguage" value="1" '.checked(1,$options,false).'/> &nbsp; Turn on multilanguage mode?';
1467
+ echo $html;
1468
+ }
1469
 
1470
 
1471
 
1814
 
1815
  $str.='</div>';
1816
 
1817
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
1818
+
1819
+ if ($is_multilanguage == 1) {
1820
+ $multilanguagePage = 'multilanguagePage:true,';
1821
+
1822
+ $str.='<script type="text/javascript">
1823
+ function GoogleLanguageTranslatorInit() {
1824
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\','.$multilanguagePage . $language_choices.'autoDisplay: false, '.analytics().' }, \'google_language_translator\');}
1825
+ </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
1826
+ <div id="google_language_translator"></div>';
1827
+ return $str;
1828
+ } elseif ($is_multilanguage == 0) {
1829
 
1830
+ $str.='<script type="text/javascript">
1831
  function GoogleLanguageTranslatorInit() {
1832
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\','.$language_choices.'autoDisplay: false, '.analytics().' }, \'google_language_translator\');}
1833
  </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
1834
  <div id="google_language_translator"></div>';
1835
  return $str;
1836
+ }
1837
 
1838
  }
1839
  }
2147
  $str.='<a id="Yiddish" href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|yi\'); return false;" title="Yiddish (Jewish)" class="notranslate flag yi"><img class="flagimg" src="'.plugins_url().'/google-language-translator/images/flags24/yiddish.png" height="18" width="18" alt="Yiddish"/></a>';
2148
  }
2149
  $str.='</div>';
2150
+
2151
+ $is_multilanguage = get_option('googlelanguagetranslator_multilanguage');
2152
+
2153
+ if ($is_multilanguage == 1) {
2154
+ $multilanguagePage = 'multilanguagePage:true,';
2155
 
2156
+ $str.='<script type="text/javascript">
 
 
2157
  function GoogleLanguageTranslatorInit() {
2158
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,'.$multilanguagePage . $language_choices.'autoDisplay: false, '.analytics().' }, \'google_language_translator\');}
2159
  </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
2160
  <div id="google_language_translator"></div>';
2161
  return $str;
2162
+ } elseif ($is_multilanguage == 0) {
2163
 
2164
+ $str.='<script type="text/javascript">
2165
+ function GoogleLanguageTranslatorInit() {
2166
+ new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\',layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,'.$language_choices.'autoDisplay: false, '.analytics().' }, \'google_language_translator\');}
2167
+ </script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
2168
+ <div id="google_language_translator"></div>';
2169
+ return $str;
2170
+ }
2171
+
2172
+ }
2173
  }
2174
  }
2175
 
 
 
2176
  function googlelanguagetranslator_toolbar_yes(){
2177
  if(get_option('googlelanguagetranslator_active')==1) { ?>
2178
  <style type="text/css">
2179
  #google_language_translator {color: transparent;}
2180
  .goog-te-gadget .goog-te-combo {margin: 2px 0px !important;}
 
 
 
2181
  </style>
2182
  <?php
2183
  }
2199
  <style type="text/css">
2200
  #google_language_translator { width:auto !important; }
2201
  .goog-te-gadget .goog-te-combo {margin: 4px 0px !important;}
 
 
 
2202
  </style>
2203
  <?php
2204
  }
2241
  }
2242
  }
2243
 
2244
+ function googlelanguagetranslator_manage_translations_no() {
2245
+ if(get_option('googlelanguagetranslator_active')==1) { ?>
2246
+ <style type="text/css">
2247
+ .goog-tooltip {display: none !important;}
2248
+ .goog-tooltip:hover {display: none !important;}
2249
+ .goog-text-highlight {background-color: transparent !important; border: none !important; box-shadow: none !important;}
2250
+ </style>
2251
+ <?php
2252
+ }
2253
+ }
2254
+
2255
  function googlelanguagetranslator_flags_display() {
2256
  $options = get_option ('googlelanguagetranslator_flag_size'); ?>
2257
 
images/arrow_down.png DELETED
Binary file
images/flags164444/Jersey.png DELETED
Binary file
images/flags164444/Jordan.png DELETED
Binary file
images/flags164444/Togo.png DELETED
Binary file
images/flags164444/albania.png DELETED
Binary file
images/flags164444/armenia.png DELETED
Binary file
images/flags164444/azerbaijan.png DELETED
Binary file
images/flags164444/bangladesh.png DELETED
Binary file
images/flags164444/basque.png DELETED
Binary file
images/flags164444/belarus.png DELETED
Binary file
images/flags164444/bosnia.png DELETED
Binary file
images/flags164444/bulgaria.png DELETED
Binary file
images/flags164444/cambodia.png DELETED
Binary file
images/flags164444/china.png DELETED
Binary file
images/flags164444/croatia.png DELETED
Binary file
images/flags164444/czechrepublic.png DELETED
Binary file
images/flags164444/denmark.png DELETED
Binary file
images/flags164444/esperanto.png DELETED
Binary file
images/flags164444/estonia.png DELETED
Binary file
images/flags164444/finland.png DELETED
Binary file
images/flags164444/france.png DELETED
Binary file
images/flags164444/galicia.png DELETED
Binary file
images/flags164444/georgia.png DELETED
Binary file
images/flags164444/germany.png DELETED
Binary file
images/flags164444/greece.png DELETED
Binary file
images/flags164444/gujarati.png DELETED
Binary file
images/flags164444/haiti.png DELETED
Binary file
images/flags164444/hmong.png DELETED
Binary file
images/flags164444/hungary.png DELETED
Binary file
images/flags164444/iceland.png DELETED
Binary file
images/flags164444/india.png DELETED
Binary file
images/flags164444/indonesia.png DELETED
Binary file
images/flags164444/iran.png DELETED
Binary file
images/flags164444/ireland.png DELETED
Binary file
images/flags164444/israel.png DELETED
Binary file
images/flags164444/italy.png DELETED
Binary file
images/flags164444/japan.png DELETED
Binary file
images/flags164444/kannada.png DELETED
Binary file
images/flags164444/kenya.png DELETED
Binary file
images/flags164444/korea.png DELETED
Binary file
images/flags164444/laos.png DELETED
Binary file
images/flags164444/latin.png DELETED
Binary file
images/flags164444/latvia.png DELETED
Binary file
images/flags164444/lithuania.png DELETED
Binary file
images/flags164444/macedonia.png DELETED
Binary file
images/flags164444/malaysia.png DELETED
Binary file
images/flags164444/malta.png DELETED
Binary file
images/flags164444/marathi.png DELETED
Binary file
images/flags164444/netherlands.png DELETED
Binary file
images/flags164444/norway.png DELETED
Binary file
images/flags164444/pakistan.png DELETED
Binary file
images/flags164444/philippines.png DELETED
Binary file
images/flags164444/poland.png DELETED
Binary file
images/flags164444/portugal.png DELETED
Binary file
images/flags164444/romania.png DELETED
Binary file
images/flags164444/russia.png DELETED
Binary file
images/flags164444/saudiarabia.png DELETED
Binary file
images/flags164444/serbia.png DELETED
Binary file
images/flags164444/slovakia.png DELETED
Binary file
images/flags164444/slovenia.png DELETED
Binary file
images/flags164444/southafrica.png DELETED
Binary file
images/flags164444/spain.png DELETED
Binary file
images/flags164444/sweden.png DELETED
Binary file
images/flags164444/tamil.png DELETED
Binary file
images/flags164444/telugu.png DELETED
Binary file
images/flags164444/thailand.png DELETED
Binary file
images/flags164444/turkey.png DELETED
Binary file
images/flags164444/ukraine.png DELETED
Binary file
images/flags164444/unitedkingdom.png DELETED
Binary file
images/flags164444/vietnam.png DELETED
Binary file
images/flags164444/wales.png DELETED
Binary file
images/flags164444/yiddish.png DELETED
Binary file
images/logo.png ADDED
Binary file
images/logo_slogan.png DELETED
Binary file
images/switcher.png DELETED
Binary file
readme.txt CHANGED
@@ -1,118 +1,124 @@
1
- === Google Language Translator ===
2
- Contributors: rm2773
3
- Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
- Plugin link: http://www.studio88design.com/plugins/google-language-translator
5
- Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
- Requires at least: 2.9
7
- Tested up to: 3.6.1
8
- stable tag: 2.7
9
-
10
- Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
-
12
- == Description ==
13
-
14
- Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
-
16
- == Installation ==
17
-
18
- 1. Download the zip folder named google-language-translator.zip
19
- 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
- 3. Activate the plugin through the plugin window in the admin panel.
21
- 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
- 5. Copy the shortcode and paste it into a page, post or widget.
23
- 6. Do not use the shortcode twice on a single page - it will not work.
24
-
25
- == Frequently Asked Questions ==
26
-
27
- == Changelog ==
28
-
29
- 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
30
-
31
- 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
32
-
33
- 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
34
-
35
- 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
36
-
37
- 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
38
-
39
- 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
40
-
41
- 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
42
-
43
- 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
44
-
45
- 1.9
46
-
47
- - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
48
-
49
- - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
50
-
51
- - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
52
-
53
- - Added jQuery functionality to the settings panel to improve the user experience.
54
-
55
- - Added an option for users to display/hide the flag images.
56
-
57
- - Added an option for users to display/hide the translate box when flags are displayed.
58
-
59
- - Removed the settings.css file - I found a better way of displaying the options without CSS.
60
-
61
- 2.0 Corrected some immediate errors in the 1.9 update.
62
-
63
- 2.1
64
-
65
- - Added language "Dutch" to the Original Language drop-down option on the settings page.
66
-
67
- - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
68
-
69
- 2.2
70
-
71
- - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
72
-
73
- - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
74
-
75
- - Added link in the settings panel that points to Google's Attribution Policy.
76
-
77
- 2.3
78
-
79
- - Added a "Preview" area on the settings page that allows you to see your settings in action.
80
-
81
- - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
82
-
83
- - Added an option that allows left/right alignment of the translation tool.
84
-
85
- - Added the "Google Language Translator" widget.
86
-
87
- - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
88
-
89
- 2.4
90
-
91
- - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
92
-
93
- 2.5
94
-
95
- - Eliminated an internal Wordpress error being generated from a coding mistake.
96
-
97
- - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
98
-
99
- 2.6
100
-
101
- - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
102
-
103
- 2.7
104
-
105
- - Added Google Analytics tracking capability to the plugin.
106
-
107
- - Added a "CSS Styles" box in the settings panel.
108
-
109
- - Changed the Catalonian flag to its correct flag image.
110
-
111
- - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
112
-
113
- - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
114
-
115
-
116
- == Screenshots ==
117
-
118
- 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.
 
 
 
 
 
 
1
+ === Google Language Translator ===
2
+ Contributors: Rob Myrick
3
+ Donate link: http://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=47LFA33AC89S6
4
+ Plugin link: http://www.studio88design.com/plugins/google-language-translator
5
+ Tags: language translator, google translator, language translate, google, google language translator, translation, translate, multi language
6
+ Requires at least: 2.9
7
+ Tested up to: 3.6.1
8
+ stable tag: 2.8
9
+
10
+ Welcome to Google Language Translator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
+
12
+ == Description ==
13
+
14
+ Settings include: inline or vertical layout, show/hide specific languages, hide/show Google toolbar, and hide/show Google branding. Add the shortcode to pages, posts, and widgets.
15
+
16
+ == Installation ==
17
+
18
+ 1. Download the zip folder named google-language-translator.zip
19
+ 2. Unzip the folder and put it in the plugins directory of your wordpress installation. (wp-content/plugins).
20
+ 3. Activate the plugin through the plugin window in the admin panel.
21
+ 4. Go to Settings > Google Language Translator, enable the plugin, and then choose your settings.
22
+ 5. Copy the shortcode and paste it into a page, post or widget.
23
+ 6. Do not use the shortcode twice on a single page - it will not work.
24
+
25
+ == Frequently Asked Questions ==
26
+
27
+ == Changelog ==
28
+
29
+ 1.1 The shortcode supplied on the settings page was updated to display '[google-translator]'.
30
+
31
+ 1.2 Shortcode support is now available for adding [google-translator] to text widgets. I apologize for any inconvenience this may have caused.
32
+
33
+ 1.3 HTML display problem in the sidebar area now fixed. Previously, inserting the [google-translator] plugin into a text widget caused it to display above the widget, instead of inside of it.
34
+
35
+ 1.4 Corrected display problems associated with CSS styles not being placed correctly in wp_head.
36
+
37
+ 1.5 Added "Original Language" support to the plugin settings, which allows the user to choose the original language of their website, which ultimately removes the original language as a choice in the language drop-down presented to website visitors.
38
+
39
+ 1.6 Added "Specific Language" support to the plugin settings, which allows the user to choose specific languages that are displayed to website visitors.
40
+
41
+ 1.7 Modified google-language-translator.php so that jQuery and CSS styles were enqueued properly onto the settings page only. Previously, jQuery functionality and CSS styles were being added to all pages of the Wordpresss Dashboard, which was causing functionality and display issues for some users.
42
+
43
+ 1.8 Modified google-language-translator.php to display the correct output to the browser when horizontal layout is selected. Previously, it was not displaying at all.
44
+
45
+ 1.9
46
+
47
+ - Added 7 flag image choices that, when clicked by website visitors, will change the language displayed, both on the website, AND in the drop-down box (flag language choices are limited to those provided in this plugin).
48
+
49
+ - Added 6 additional languages to the translator, as provided in Google's most recent updates ( new languages include Bosnian, Cebuano, Khmer, Marathi, Hmong, Javanese ).
50
+
51
+ - Corrected a minor technical issue where the Czech option (on the backend) was incorrectly displaying the Croatian language on the front end.
52
+
53
+ - Added jQuery functionality to the settings panel to improve the user experience.
54
+
55
+ - Added an option for users to display/hide the flag images.
56
+
57
+ - Added an option for users to display/hide the translate box when flags are displayed.
58
+
59
+ - Removed the settings.css file - I found a better way of displaying the options without CSS.
60
+
61
+ 2.0 Corrected some immediate errors in the 1.9 update.
62
+
63
+ 2.1
64
+
65
+ - Added language "Dutch" to the Original Language drop-down option on the settings page.
66
+
67
+ - Added a new CSS class that more accurately hides the "Powered by" text when hiding Google's branding. In previous version, the "Powered by" text was actually disguised by setting it's color to "transparent", but now we have set it's font-size to 0px instead.
68
+
69
+ 2.2
70
+
71
+ - Added language "Portuguese" and "German" to the Original Language drop-down option on the settings page.
72
+
73
+ - Changed flag image for the English language (changed United States flag to the United Kingdom flag).
74
+
75
+ - Added link in the settings panel that points to Google's Attribution Policy.
76
+
77
+ 2.3
78
+
79
+ - Added a "Preview" area on the settings page that allows you to see your settings in action.
80
+
81
+ - Added custom flag support for all languages (custom flags available ONLY when selecting the "ALL Languages" setting.
82
+
83
+ - Added an option that allows left/right alignment of the translation tool.
84
+
85
+ - Added the "Google Language Translator" widget.
86
+
87
+ - Updated googlelanguagetranslator.php to properly register setting in the admin settings panel.
88
+
89
+ 2.4
90
+
91
+ - Found a couple of small display errors in the settings page after uploading version 2.3. Sorry for any inconvenience!
92
+
93
+ 2.5
94
+
95
+ - Eliminated an internal Wordpress error being generated from a coding mistake.
96
+
97
+ - Added a default option for the Translator alingment. Previously, this was causing the plugin to disapppear.
98
+
99
+ 2.6
100
+
101
+ - Added defaults to all options to ensure there are no more issues with the translator displaying upon installation. Again, sorry for any inconvenience.
102
+
103
+ 2.7
104
+
105
+ - Added Google Analytics tracking capability to the plugin.
106
+
107
+ - Added a "CSS Styles" box in the settings panel.
108
+
109
+ - Changed the Catalonian flag to its correct flag image.
110
+
111
+ - Fixed coding issues that previously updated options incorrectly, which is why many users experienced display issues. All options are now initialized upon plugin activation, which should fix this issue permanently.
112
+
113
+ - Fixed a glitch in our usage of the translate API. Previously, when the user clicked the default language, it would toggle back and forth between the default language and "Afrikaans" language. Now, users will see the correct language displayed at all times, no matter how many times it is clicked.
114
+
115
+
116
+ 2.8
117
+
118
+ - Added an option to allow users to manage their own translations directly through their Google Translate account (free). When activated, users can hover over the text of their website, and edit the translations from the webpage directly. Google will remember these translations, and then serve them to users once the edits are made. Users must install the Google Translate Customization meta tag provided through Google Translate here: translate.google.com/manager/website/settings. To obtain this meta tag, users need to configure the Google Translate tool directly from this website (although they will not use this because the plugin provides it), then the user can obtain the meta tag on the "Get Code" screen, which is displayed after configuring the Google Translate tool on this webpage.
119
+ - Added an option to allow users to turn on/off Google's multilanguagePage option, that when activated, the original website content will be a forced translation, instead of original content (but only after a translation is made.)
120
+ - Added more flexible styles to the settings page, so that left and right panels display nicely to the user.
121
+
122
+ == Screenshots ==
123
+
124
+ 1. Settings include: inline or vertical layout, hide/show Google toolbar, display specific languages, and show/hide Google branding. Add the shortcode to pages, posts, and widgets.