Google Language Translator - Version 5.0.41

Version Description

Download this release

Release Info

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

Code changes from version 5.0.40 to 5.0.41

google-language-translator.php CHANGED
@@ -1,11 +1,12 @@
1
  <?php
 
2
  /*
3
  Plugin Name: Google Language Translator
4
- Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 5.0.40
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.wp-studio.net/
9
  */
10
 
11
  //ini_set('display_errors', 1);
@@ -308,7 +309,10 @@ class google_language_translator {
308
  }
309
 
310
  public function footer_script() {
 
 
311
  global $shortcode_started;
 
312
  $default_language = get_option('googlelanguagetranslator_language');
313
  $language_choices = $this->googlelanguagetranslator_included_languages();
314
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
@@ -318,6 +322,7 @@ class google_language_translator {
318
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
319
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
320
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
 
321
  $flag_width = get_option('googlelanguagetranslator_flag_size');
322
  $get_language_choices = get_option('language_display_settings');
323
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
@@ -335,6 +340,8 @@ class google_language_translator {
335
  $str.='<div id="glt-translate-trigger"><span'.($floating_widget_text_translation_allowed != 1 ? ' class="notranslate"' : ' class="translate"').'>'.(empty($floating_widget_text) ? 'Translate &raquo;' : $floating_widget_text).'</span></div>';
336
  $str.='<div id="glt-toolbar"></div>';
337
  } //endif $floating_widget
 
 
338
 
339
  $str.='<div id="flags" style="display:none" class="size'.$flag_width.'">';
340
  $str.='<ul id="sortable" class="ui-sortable">';
@@ -343,23 +350,21 @@ class google_language_translator {
343
  $language_code = $key;
344
  $language_name = $value;
345
  $language_name_flag = $language_name;
346
- if (get_option('googlelanguagetranslator_flags') == 1) {
347
- if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
348
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
349
- $language_name_flag = 'canada';
350
- }
351
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
352
- $language_name_flag = 'united-states';
353
- }
354
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
355
- $language_name_flag = 'mexico';
356
- }
357
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
358
- $language_name_flag = 'brazil';
359
- }
360
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
361
- } //isset
362
- } //endif
363
  }//foreach
364
  } else {
365
  if ($new_languages_array_count != count($get_language_choices)):
@@ -367,49 +372,47 @@ class google_language_translator {
367
  $language_code = $key;
368
  $language_name = $this->languages_array[$key];
369
  $language_name_flag = $language_name;
370
- if (get_option('googlelanguagetranslator_flags') == 1) {
371
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
372
- $language_name_flag = 'canada';
373
- }
374
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
375
- $language_name_flag = 'united-states';
376
- }
377
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
378
- $language_name_flag = 'mexico';
379
- }
380
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
381
- $language_name_flag = 'brazil';
382
- }
383
-
384
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
385
- } //get_option
386
  } //foreach
387
  else:
388
  foreach ($new_languages_array_codes as $value) {
389
  $language_name = $value;
390
  $language_code = array_search ($language_name, $this->languages_array);
391
  $language_name_flag = $language_name;
392
- if (get_option('googlelanguagetranslator_flags') == 1) {
393
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
394
- $language_name_flag = 'canada';
395
- }
396
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
397
- $language_name_flag = 'united-states';
398
- }
399
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
400
- $language_name_flag = 'mexico';
401
- }
402
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
403
- $language_name_flag = 'brazil';
404
- }
405
-
406
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
407
- } //get_option
408
- }//foreach
409
- endif;
410
- }//endif
411
  $str.='</ul>';
412
  $str.='</div>';
 
 
413
  }
414
 
415
  $language_choices = $this->googlelanguagetranslator_included_languages();
@@ -420,25 +423,27 @@ class google_language_translator {
420
  $auto_display = ', autoDisplay: false';
421
  $default_language = get_option('googlelanguagetranslator_language');
422
 
423
- if ($is_multilanguage == 1) {
424
- $multilanguagePage = ', multilanguagePage:true';
425
- $str.="<div id='glt-footer'></div><script type='text/javascript'>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>";
426
- echo $str;
427
-
428
- } elseif ($is_multilanguage == 0) {
429
- $str.="<div id='glt-footer'></div><script type='text/javascript'>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>";
430
- echo $str;
431
- }
432
  }
433
 
434
  public function googlelanguagetranslator_vertical() {
435
- global $shortcode_started;
436
- $shortcode_started = 'true';
 
 
437
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
438
  $new_languages_array = explode(",",$new_languages_array_string);
439
  $new_languages_array_codes = array_values($new_languages_array);
440
  $new_languages_array_count = count($new_languages_array);
441
- $get_language_choices = get_option ('language_display_settings');
 
442
  $flag_width = get_option('googlelanguagetranslator_flag_size');
443
  $default_language_code = get_option('googlelanguagetranslator_language');
444
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
@@ -449,7 +454,8 @@ class google_language_translator {
449
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
450
  $str = '';
451
 
452
- if( $is_active == 1):
 
453
  $str.='<div id="flags" class="size'.$flag_width.'">';
454
  $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
455
 
@@ -459,22 +465,20 @@ class google_language_translator {
459
  $language_name = $value;
460
  $language_name_flag = $language_name;
461
 
462
- if (get_option('googlelanguagetranslator_flags') == 1) {
463
- if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
464
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
465
- $language_name_flag = 'canada';
466
- }
467
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
468
- $language_name_flag = 'united-states';
469
- }
470
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
471
- $language_name_flag = 'mexico';
472
- }
473
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
474
- $language_name_flag = 'brazil';
475
- }
476
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
477
- } //endif
478
  } //endif
479
  }//foreach
480
  else:
@@ -484,22 +488,20 @@ class google_language_translator {
484
  $language_name = $this->languages_array[$key];
485
  $language_name_flag = $language_name;
486
 
487
- if (get_option('googlelanguagetranslator_flags') == 1) {
488
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
489
- $language_name_flag = 'canada';
490
- }
491
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
492
- $language_name_flag = 'united-states';
493
- }
494
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
495
- $language_name_flag = 'mexico';
496
- }
497
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
498
- $language_name_flag = 'brazil';
499
- }
500
 
501
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
502
- } //get_option
503
  } //foreach
504
  else:
505
  foreach ($new_languages_array_codes as $value) {
@@ -507,39 +509,44 @@ class google_language_translator {
507
  $language_code = array_search ($language_name, $this->languages_array);
508
  $language_name_flag = $language_name;
509
 
510
- if (get_option('googlelanguagetranslator_flags') == 1) {
511
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
512
- $language_name_flag = 'canada';
513
- }
514
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
515
- $language_name_flag = 'united-states';
516
- }
517
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
518
- $language_name_flag = 'mexico';
519
- }
520
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
521
- $language_name_flag = 'brazil';
522
- }
523
-
524
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
525
- } //get_option
526
  }//foreach
527
  endif;
528
  endif;
 
529
  $str.='</ul>';
530
  $str.='</div>';
531
- $str.='<div id="google_language_translator"></div>';
532
- return $str;
 
 
 
533
  endif;
534
  } // End glt_vertical
535
 
536
- public function googlelanguagetranslator_horizontal(){
537
- $shortcode_started = 'true';
 
 
 
538
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
539
  $new_languages_array = explode(",",$new_languages_array_string);
540
  $new_languages_array_codes = array_values($new_languages_array);
541
  $new_languages_array_count = count($new_languages_array);
542
  $get_language_choices = get_option ('language_display_settings');
 
543
  $flag_width = get_option('googlelanguagetranslator_flag_size');
544
  $default_language_code = get_option('googlelanguagetranslator_language');
545
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
@@ -550,7 +557,8 @@ class google_language_translator {
550
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
551
  $str = '';
552
 
553
- if( $is_active == 1):
 
554
  $str.='<div id="flags" class="size'.$flag_width.'">';
555
  $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
556
 
@@ -559,22 +567,21 @@ class google_language_translator {
559
  $language_code = $key;
560
  $language_name = $value;
561
  $language_name_flag = $language_name;
562
- if (get_option('googlelanguagetranslator_flags') == 1) {
563
- if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
564
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
565
- $language_name_flag = 'canada';
566
- }
567
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
568
- $language_name_flag = 'united-states';
569
- }
570
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
571
- $language_name_flag = 'mexico';
572
- }
573
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
574
- $language_name_flag = 'brazil';
575
- }
576
- $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
577
- } //endif
578
  } //endif
579
  }//foreach
580
  else:
@@ -584,22 +591,19 @@ class google_language_translator {
584
  $language_name = $this->languages_array[$key];
585
  $language_name_flag = $language_name;
586
 
587
- if (get_option('googlelanguagetranslator_flags') == 1) {
588
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
589
- $language_name_flag = 'canada';
590
- }
591
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
592
- $language_name_flag = 'united-states';
593
- }
594
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
595
- $language_name_flag = 'mexico';
596
- }
597
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
598
- $language_name_flag = 'brazil';
599
- }
600
-
601
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
602
- } //get_option
603
  } //foreach
604
  else:
605
  foreach ($new_languages_array_codes as $value) {
@@ -607,29 +611,29 @@ class google_language_translator {
607
  $language_code = array_search ($language_name, $this->languages_array);
608
  $language_name_flag = $language_name;
609
 
610
- if (get_option('googlelanguagetranslator_flags') == 1) {
611
- if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
612
- $language_name_flag = 'canada';
613
- }
614
- if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
615
- $language_name_flag = 'united-states';
616
- }
617
- if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
618
- $language_name_flag = 'mexico';
619
- }
620
- if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
621
- $language_name_flag = 'brazil';
622
- }
623
-
624
- $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
625
- } //get_option
626
  }//foreach
627
  endif;
628
  endif;
629
  $str.='</ul>';
630
  $str.='</div>';
631
- $str.='<div id="google_language_translator"></div>';
632
- return $str;
 
 
 
633
  endif;
634
  } // End glt_horizontal
635
 
@@ -1124,8 +1128,6 @@ $('.languages').find('input:checkbox').prop('checked', false); }); }); </script>
1124
  <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
1125
  </tr>
1126
 
1127
-
1128
-
1129
  <tr class="notranslate">
1130
  <td>Show or hide the langauge switcher?</td>
1131
  <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
@@ -1306,13 +1308,15 @@ $('.languages').find('input:checkbox').prop('checked', false); }); }); </script>
1306
 
1307
  <div class="metabox-holder box-right notranslate" style="float: right; width: 33%;">
1308
  <div class="postbox">
1309
- <h3>GLT Premium 5.0.39 is Here! $30</h3>
1310
  <div class="inside">
1311
  <a class="wp-studio-logo" href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; width:177px;" src="<?php echo plugins_url( 'images/logo.png' , __FILE__ ); ?>"></a><br />
1312
  <ul id="features" style="margin-left:15px">
1313
  <li style="list-style:square outside">104 Languages with flags</li>
1314
  <li style="list-style:square outside">Edit up to 5 phrases in any language, while using auto-translation</li>
 
1315
  <li style="list-style:square outside">6 Floating Widget positions</li>
 
1316
  <li style="list-style:square outside">Exclude specific areas from translation</li>
1317
  <li style="list-style:square outside">jQuery-powered language switcher</li>
1318
  <li style="list-style:square outside">Add single languages to your menus/pages/posts</li>
1
  <?php
2
+
3
  /*
4
  Plugin Name: Google Language Translator
5
+ Plugin URI: http://wp-studio.net/
6
+ Version: 5.0.41
7
  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.
8
  Author: Rob Myrick
9
+ Author URI: http://wp-studio.net/
10
  */
11
 
12
  //ini_set('display_errors', 1);
309
  }
310
 
311
  public function footer_script() {
312
+ global $vertical;
313
+ global $horizontal;
314
  global $shortcode_started;
315
+ $layout = get_option('googlelanguagetranslator_display');
316
  $default_language = get_option('googlelanguagetranslator_language');
317
  $language_choices = $this->googlelanguagetranslator_included_languages();
318
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
322
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
323
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
324
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
325
+ $show_flags = get_option('googlelanguagetranslator_flags');
326
  $flag_width = get_option('googlelanguagetranslator_flag_size');
327
  $get_language_choices = get_option('language_display_settings');
328
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
340
  $str.='<div id="glt-translate-trigger"><span'.($floating_widget_text_translation_allowed != 1 ? ' class="notranslate"' : ' class="translate"').'>'.(empty($floating_widget_text) ? 'Translate &raquo;' : $floating_widget_text).'</span></div>';
341
  $str.='<div id="glt-toolbar"></div>';
342
  } //endif $floating_widget
343
+
344
+ if ((($layout=='SIMPLE' && !isset($vertical)) || ($layout=='Vertical' && !isset($vertical)) || (isset($vertical) && $show_flags==0)) || (($layout=='Horizontal' && !isset($horizontal)) || (isset($horizontal) && $show_flags==0))):
345
 
346
  $str.='<div id="flags" style="display:none" class="size'.$flag_width.'">';
347
  $str.='<ul id="sortable" class="ui-sortable">';
350
  $language_code = $key;
351
  $language_name = $value;
352
  $language_name_flag = $language_name;
353
+ if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
354
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
355
+ $language_name_flag = 'canada';
356
+ }
357
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
358
+ $language_name_flag = 'united-states';
359
+ }
360
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
361
+ $language_name_flag = 'mexico';
362
+ }
363
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
364
+ $language_name_flag = 'brazil';
365
+ }
366
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
367
+ } //empty
 
 
368
  }//foreach
369
  } else {
370
  if ($new_languages_array_count != count($get_language_choices)):
372
  $language_code = $key;
373
  $language_name = $this->languages_array[$key];
374
  $language_name_flag = $language_name;
375
+
376
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
377
+ $language_name_flag = 'canada';
378
+ }
379
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
380
+ $language_name_flag = 'united-states';
381
+ }
382
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
383
+ $language_name_flag = 'mexico';
384
+ }
385
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
386
+ $language_name_flag = 'brazil';
387
+ }
388
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
 
 
389
  } //foreach
390
  else:
391
  foreach ($new_languages_array_codes as $value) {
392
  $language_name = $value;
393
  $language_code = array_search ($language_name, $this->languages_array);
394
  $language_name_flag = $language_name;
395
+
396
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
397
+ $language_name_flag = 'canada';
398
+ }
399
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
400
+ $language_name_flag = 'united-states';
401
+ }
402
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
403
+ $language_name_flag = 'mexico';
404
+ }
405
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
406
+ $language_name_flag = 'brazil';
407
+ }
408
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
409
+ }//foreach
410
+ endif;
411
+ }//endif
 
 
412
  $str.='</ul>';
413
  $str.='</div>';
414
+
415
+ endif; //layout
416
  }
417
 
418
  $language_choices = $this->googlelanguagetranslator_included_languages();
423
  $auto_display = ', autoDisplay: false';
424
  $default_language = get_option('googlelanguagetranslator_language');
425
 
426
+ if ($is_multilanguage == 1):
427
+ $multilanguagePage = ', multilanguagePage:true';
428
+ $str.="<div id='glt-footer'></div><script type='text/javascript'>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>";
429
+ echo $str;
430
+ elseif ($is_multilanguage == 0):
431
+ $str.="<div id='glt-footer'></div><script type='text/javascript'>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>";
432
+ echo $str;
433
+ endif; //is_multilanguage
 
434
  }
435
 
436
  public function googlelanguagetranslator_vertical() {
437
+ global $started;
438
+ global $vertical;
439
+ $vertical = 1;
440
+ $started = false;
441
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
442
  $new_languages_array = explode(",",$new_languages_array_string);
443
  $new_languages_array_codes = array_values($new_languages_array);
444
  $new_languages_array_count = count($new_languages_array);
445
+ $get_language_choices = get_option ('language_display_settings');
446
+ $show_flags = get_option('googlelanguagetranslator_flags');
447
  $flag_width = get_option('googlelanguagetranslator_flag_size');
448
  $default_language_code = get_option('googlelanguagetranslator_language');
449
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
454
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
455
  $str = '';
456
 
457
+ if ($is_active==1):
458
+ if ($show_flags==1):
459
  $str.='<div id="flags" class="size'.$flag_width.'">';
460
  $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
461
 
465
  $language_name = $value;
466
  $language_name_flag = $language_name;
467
 
468
+ if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
469
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
470
+ $language_name_flag = 'canada';
471
+ }
472
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
473
+ $language_name_flag = 'united-states';
474
+ }
475
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
476
+ $language_name_flag = 'mexico';
477
+ }
478
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
479
+ $language_name_flag = 'brazil';
480
+ }
481
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
 
 
482
  } //endif
483
  }//foreach
484
  else:
488
  $language_name = $this->languages_array[$key];
489
  $language_name_flag = $language_name;
490
 
491
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
492
+ $language_name_flag = 'canada';
493
+ }
494
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
495
+ $language_name_flag = 'united-states';
496
+ }
497
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
498
+ $language_name_flag = 'mexico';
499
+ }
500
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
501
+ $language_name_flag = 'brazil';
502
+ }
 
503
 
504
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
 
505
  } //foreach
506
  else:
507
  foreach ($new_languages_array_codes as $value) {
509
  $language_code = array_search ($language_name, $this->languages_array);
510
  $language_name_flag = $language_name;
511
 
512
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
513
+ $language_name_flag = 'canada';
514
+ }
515
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
516
+ $language_name_flag = 'united-states';
517
+ }
518
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
519
+ $language_name_flag = 'mexico';
520
+ }
521
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
522
+ $language_name_flag = 'brazil';
523
+ }
524
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
 
 
 
525
  }//foreach
526
  endif;
527
  endif;
528
+
529
  $str.='</ul>';
530
  $str.='</div>';
531
+
532
+ endif; //show_flags
533
+
534
+ $str.='<div id="google_language_translator"></div>'; return $str;
535
+
536
  endif;
537
  } // End glt_vertical
538
 
539
+ public function googlelanguagetranslator_horizontal() {
540
+ global $started;
541
+ global $horizontal;
542
+ $horizontal = 1;
543
+ $started = false;
544
  $new_languages_array_string = get_option('googlelanguagetranslator_flags_order');
545
  $new_languages_array = explode(",",$new_languages_array_string);
546
  $new_languages_array_codes = array_values($new_languages_array);
547
  $new_languages_array_count = count($new_languages_array);
548
  $get_language_choices = get_option ('language_display_settings');
549
+ $show_flags = get_option('googlelanguagetranslator_flags');
550
  $flag_width = get_option('googlelanguagetranslator_flag_size');
551
  $default_language_code = get_option('googlelanguagetranslator_language');
552
  $english_flag_choice = get_option('googlelanguagetranslator_english_flag_choice');
557
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
558
  $str = '';
559
 
560
+ if ($is_active==1):
561
+ if ($show_flags==1):
562
  $str.='<div id="flags" class="size'.$flag_width.'">';
563
  $str.='<ul id="sortable" class="ui-sortable" style="float:left">';
564
 
567
  $language_code = $key;
568
  $language_name = $value;
569
  $language_name_flag = $language_name;
570
+
571
+ if (!empty($get_language_choices[$language_code]) && $get_language_choices[$language_code]==1) {
572
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
573
+ $language_name_flag = 'canada';
574
+ }
575
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
576
+ $language_name_flag = 'united-states';
577
+ }
578
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
579
+ $language_name_flag = 'mexico';
580
+ }
581
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
582
+ $language_name_flag = 'brazil';
583
+ }
584
+ $str.="<li id='".$language_name."'><a title='".$language_name."' class='notranslate flag ".$language_code." ".$language_name_flag."'></a></li>";
 
585
  } //endif
586
  }//foreach
587
  else:
591
  $language_name = $this->languages_array[$key];
592
  $language_name_flag = $language_name;
593
 
594
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
595
+ $language_name_flag = 'canada';
596
+ }
597
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
598
+ $language_name_flag = 'united-states';
599
+ }
600
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
601
+ $language_name_flag = 'mexico';
602
+ }
603
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
604
+ $language_name_flag = 'brazil';
605
+ }
606
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
 
 
 
607
  } //foreach
608
  else:
609
  foreach ($new_languages_array_codes as $value) {
611
  $language_code = array_search ($language_name, $this->languages_array);
612
  $language_name_flag = $language_name;
613
 
614
+ if ( $language_name == 'English' && $english_flag_choice == 'canadian_flag') {
615
+ $language_name_flag = 'canada';
616
+ }
617
+ if ( $language_name == "English" && $english_flag_choice == 'us_flag') {
618
+ $language_name_flag = 'united-states';
619
+ }
620
+ if ( $language_name == 'Spanish' && $spanish_flag_choice == 'mexican_flag') {
621
+ $language_name_flag = 'mexico';
622
+ }
623
+ if ( $language_name == 'Portuguese' && $portuguese_flag_choice == 'brazilian_flag') {
624
+ $language_name_flag = 'brazil';
625
+ }
626
+ $str.='<li id="'.$language_name.'"><a title="'.$language_name.'" class="nturl notranslate '.$language_code.' flag '.$language_name_flag.'"></a>';
 
 
 
627
  }//foreach
628
  endif;
629
  endif;
630
  $str.='</ul>';
631
  $str.='</div>';
632
+
633
+ endif; //show_flags
634
+
635
+ $str.='<div id="google_language_translator"></div>'; return $str;
636
+
637
  endif;
638
  } // End glt_horizontal
639
 
1128
  <td class="choose_flags_intro"><?php $this->googlelanguagetranslator_flags_cb(); ?></td>
1129
  </tr>
1130
 
 
 
1131
  <tr class="notranslate">
1132
  <td>Show or hide the langauge switcher?</td>
1133
  <td><?php $this->googlelanguagetranslator_translatebox_cb(); ?></td>
1308
 
1309
  <div class="metabox-holder box-right notranslate" style="float: right; width: 33%;">
1310
  <div class="postbox">
1311
+ <h3>GLT Premium 5.0.42 is Here! $30</h3>
1312
  <div class="inside">
1313
  <a class="wp-studio-logo" href="http://www.wp-studio.net/" target="_blank"><img style="background:#444; border-radius:3px; -webkit-border-radius:3px; -moz-border-radius:3px; width:177px;" src="<?php echo plugins_url( 'images/logo.png' , __FILE__ ); ?>"></a><br />
1314
  <ul id="features" style="margin-left:15px">
1315
  <li style="list-style:square outside">104 Languages with flags</li>
1316
  <li style="list-style:square outside">Edit up to 5 phrases in any language, while using auto-translation</li>
1317
+ <li style="list-style:square outside">Adjust language switcher background, text color, and flag display</li>
1318
  <li style="list-style:square outside">6 Floating Widget positions</li>
1319
+ <li style="list-style:square outside">Adjust floating widget text color, background, and toolbar colors</li>
1320
  <li style="list-style:square outside">Exclude specific areas from translation</li>
1321
  <li style="list-style:square outside">jQuery-powered language switcher</li>
1322
  <li style="list-style:square outside">Add single languages to your menus/pages/posts</li>
js/load-sortable-flags.js DELETED
@@ -1,17 +0,0 @@
1
- jQuery(document).ready(function($) {
2
- $("#sortable,#sortable-toolbar").sortable({
3
- opacity: 0.7,
4
- distance: 10,
5
- helper: "clone",
6
- forcePlaceholderSize:true,
7
- update: function(event,ui) {
8
- var newOrder = $(this).sortable('toArray').toString();
9
- $.post("options.php",{order: newOrder});
10
- $('#order').val(newOrder);
11
- },
12
- });
13
-
14
- $("#sortable,#sortable-toolbar").disableSelection();
15
- });
16
-
17
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin link: http://wp-studio.net/how-it-works
5
  Tags: language translator, google translator, language translate, translate wordpress, google language translator, translation, translate, multi language
6
  Requires at least: 2.9
7
  Tested up to: 4.9.2
8
- Stable tag: 5.0.40
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
 
@@ -46,6 +46,9 @@ A: Yes! Add the "notranslate" class to the HTML element containing your text. Fo
46
 
47
  == Changelog ==
48
 
 
 
 
49
  5.0.40
50
  - Fixed a minor 'undefined index' error in google-language-translator.php
51
 
5
  Tags: language translator, google translator, language translate, translate wordpress, google language translator, translation, translate, multi language
6
  Requires at least: 2.9
7
  Tested up to: 4.9.2
8
+ Stable tag: 5.0.41
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
 
46
 
47
  == Changelog ==
48
 
49
+ 5.0.41
50
+ - Re-factored code in google-language-translator.php to remove the duplicate id "flags".
51
+
52
  5.0.40
53
  - Fixed a minor 'undefined index' error in google-language-translator.php
54