Google Language Translator - Version 1.8

Version Description

Download this release

Release Info

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

Code changes from version 1.7 to 1.8

Files changed (2) hide show
  1. google-language-translator.php +12 -8
  2. readme.txt +3 -1
google-language-translator.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 1.7
6
- Description: The MOST SIMPLE Google Translator plugin. This plugin adds Google Translator to your website by using a single shortcode, [google-translator]. Setting options include: layout style, 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
  */
@@ -207,7 +207,6 @@ function googlelanguagetranslator_menu(){
207
  </tr>
208
 
209
  <tr>
210
-
211
  <td colspan="2">
212
  <div class="languages" style="width:25%; float:left">
213
  <?php $get_language_choices = get_option ('language_display_settings'); ?>
@@ -408,11 +407,17 @@ function googlelanguagetranslator_included_languages() {
408
  $items[] = $key;
409
  }
410
  }
411
- $comma_separated = implode(",",array_values($items));
 
 
412
  $lang .= 'includedLanguages:\''.$comma_separated.'\'';
413
  return $lang;
414
- }
415
- }
 
 
 
 
416
 
417
  function googlelanguagetranslator_vertical(){
418
  $language_choices = googlelanguagetranslator_included_languages();
@@ -434,7 +439,7 @@ function googlelanguagetranslator_horizontal(){
434
  $str.='<div id="google_translate_element"></div><script>
435
  function googleTranslateElementInit() {
436
  new google.translate.TranslateElement({
437
- pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
438
  }, \'google_translate_element\');
439
  }
440
  </script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>';
@@ -491,5 +496,4 @@ function googlelanguagetranslator_showbranding_no() {
491
  <?php
492
  }
493
  }
494
-
495
  ?>
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
+ Version: 1.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
  */
207
  </tr>
208
 
209
  <tr>
 
210
  <td colspan="2">
211
  <div class="languages" style="width:25%; float:left">
212
  <?php $get_language_choices = get_option ('language_display_settings'); ?>
407
  $items[] = $key;
408
  }
409
  }
410
+ $comma_separated = implode(",",array_values($items));
411
+
412
+ if ( get_option('googlelanguagetranslator_display') == 'Vertical') {
413
  $lang .= 'includedLanguages:\''.$comma_separated.'\'';
414
  return $lang;
415
+ } elseif ( get_option('googlelanguagetranslator_display') == 'Horizontal') {
416
+ $lang .= 'includedLanguages:\''.$comma_separated.'\',';
417
+ return $lang;
418
+ }
419
+ }
420
+ }
421
 
422
  function googlelanguagetranslator_vertical(){
423
  $language_choices = googlelanguagetranslator_included_languages();
439
  $str.='<div id="google_translate_element"></div><script>
440
  function googleTranslateElementInit() {
441
  new google.translate.TranslateElement({
442
+ pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.' layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL
443
  }, \'google_translate_element\');
444
  }
445
  </script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>';
496
  <?php
497
  }
498
  }
 
499
  ?>
readme.txt CHANGED
@@ -5,7 +5,7 @@ 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.51
8
- stable tag: 1.7
9
 
10
  Welcome to Google Language Tranlator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
 
@@ -40,6 +40,8 @@ Settings include: inline or vertical layout, show/hide specific languages, hide/
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
  == Screenshots ==
44
 
45
  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.
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.51
8
+ stable tag: 1.8
9
 
10
  Welcome to Google Language Tranlator! This plugin allows you to insert the Google Language Translator tool anywhere on your website using shortcode.
11
 
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
  == Screenshots ==
46
 
47
  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.