Google Language Translator - Version 5.0.37

Version Description

Download this release

Release Info

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

Code changes from version 5.0.36 to 5.0.37

Files changed (2) hide show
  1. google-language-translator.php +12 -35
  2. readme.txt +4 -1
google-language-translator.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
- Version: 5.0.36
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/
@@ -148,7 +148,6 @@ class google_language_translator {
148
  public function glt_activate() {
149
  add_option('googlelanguagetranslator_active', 1);
150
  add_option('googlelanguagetranslator_language','en');
151
- add_option('googlelanguagetranslator_language_option','all');
152
  add_option('googlelanguagetranslator_flags', 1);
153
  add_option('language_display_settings',array ('en' => 1));
154
  add_option('googlelanguagetranslator_translatebox','yes');
@@ -174,6 +173,7 @@ class google_language_translator {
174
 
175
  public function glt_deactivate() {
176
  delete_option('flag_display_settings');
 
177
  }
178
 
179
  public function glt_settings_link ( $links ) {
@@ -239,19 +239,17 @@ class google_language_translator {
239
  }
240
 
241
  public function googlelanguagetranslator_included_languages() {
242
- if ( get_option('googlelanguagetranslator_language_option')=='specific') {
243
- $get_language_choices = get_option ('language_display_settings');
244
 
245
- foreach ($get_language_choices as $key=>$value) {
246
- if($value == 1) {
247
- $items[] = $key;
248
- }
249
- }
250
 
251
- $comma_separated = implode(",",array_values($items));
252
- $lang = ", includedLanguages:'".$comma_separated."'";
253
- return $lang;
254
- }
255
  }
256
 
257
  public function analytics() {
@@ -322,7 +320,6 @@ class google_language_translator {
322
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
323
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
324
  $flag_width = get_option('googlelanguagetranslator_flag_size');
325
- $get_language_option = get_option('googlelanguagetranslator_language_option');
326
  $get_language_choices = get_option('language_display_settings');
327
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
328
  $floating_widget_text = get_option ('googlelanguagetranslator_floating_widget_text');
@@ -453,7 +450,6 @@ class google_language_translator {
453
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
454
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
455
  $is_active = get_option ( 'googlelanguagetranslator_active' );
456
- $get_language_option = get_option('googlelanguagetranslator_language_option');
457
  $language_choices = $this->googlelanguagetranslator_included_languages();
458
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
459
  $str = '';
@@ -556,7 +552,6 @@ class google_language_translator {
556
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
557
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
558
  $is_active = get_option ( 'googlelanguagetranslator_active' );
559
- $get_language_option = get_option('googlelanguagetranslator_language_option');
560
  $language_choices = $this->googlelanguagetranslator_included_languages();
561
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
562
  $str = '';
@@ -650,7 +645,7 @@ class google_language_translator {
650
  add_settings_section('glt_settings','Settings','','google_language_translator');
651
 
652
  $settings_name_array = array (
653
- 'googlelanguagetranslator_active','googlelanguagetranslator_language','googlelanguagetranslator_language_option','language_display_settings','googlelanguagetranslator_flags','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_english_flag_choice','googlelanguagetranslator_spanish_flag_choice','googlelanguagetranslator_portuguese_flag_choice','googlelanguagetranslator_floating_widget_text','googlelanguagetranslator_floating_widget_text_allow_translation'
654
  );
655
 
656
  foreach ($settings_name_array as $setting) {
@@ -700,24 +695,6 @@ class google_language_translator {
700
  <?php
701
  }
702
 
703
- public function googlelanguagetranslator_language_option_cb() {
704
-
705
- $option_name = 'googlelanguagetranslator_language_option' ;
706
- $new_value = 'all';
707
-
708
- if ( get_option( $option_name ) === false ) {
709
-
710
- // The option does not exist, so we update it.
711
- update_option( $option_name, $new_value );
712
- }
713
-
714
- $options = get_option (''.$option_name.''); ?>
715
-
716
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="all" <?php if($options=='all'){echo "checked";}?>/> All Languages<br/>
717
- <input type="radio" name="googlelanguagetranslator_language_option" id="googlelanguagetranslator_language_option" value="specific" <?php if($options=='specific'){echo "checked";}?>/> Specific Languages
718
- <?php
719
- }
720
-
721
  public function language_display_settings_cb() {
722
  $default_language_code = get_option('googlelanguagetranslator_language');
723
  $option_name = 'language_display_settings';
2
  /*
3
  Plugin Name: Google Language Translator
4
  Plugin URI: http://www.studio88design.com/plugins/google-language-translator
5
+ Version: 5.0.37
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/
148
  public function glt_activate() {
149
  add_option('googlelanguagetranslator_active', 1);
150
  add_option('googlelanguagetranslator_language','en');
 
151
  add_option('googlelanguagetranslator_flags', 1);
152
  add_option('language_display_settings',array ('en' => 1));
153
  add_option('googlelanguagetranslator_translatebox','yes');
173
 
174
  public function glt_deactivate() {
175
  delete_option('flag_display_settings');
176
+ delete_option('googlelanguagetranslator_language_option');
177
  }
178
 
179
  public function glt_settings_link ( $links ) {
239
  }
240
 
241
  public function googlelanguagetranslator_included_languages() {
242
+ $get_language_choices = get_option ('language_display_settings');
 
243
 
244
+ foreach ($get_language_choices as $key=>$value):
245
+ if ($value == 1):
246
+ $items[] = $key;
247
+ endif;
248
+ endforeach;
249
 
250
+ $comma_separated = implode(",",array_values($items));
251
+ $lang = ", includedLanguages:'".$comma_separated."'";
252
+ return $lang;
 
253
  }
254
 
255
  public function analytics() {
320
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
321
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
322
  $flag_width = get_option('googlelanguagetranslator_flag_size');
 
323
  $get_language_choices = get_option('language_display_settings');
324
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
325
  $floating_widget_text = get_option ('googlelanguagetranslator_floating_widget_text');
450
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
451
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
452
  $is_active = get_option ( 'googlelanguagetranslator_active' );
 
453
  $language_choices = $this->googlelanguagetranslator_included_languages();
454
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
455
  $str = '';
552
  $spanish_flag_choice = get_option('googlelanguagetranslator_spanish_flag_choice');
553
  $portuguese_flag_choice = get_option('googlelanguagetranslator_portuguese_flag_choice');
554
  $is_active = get_option ( 'googlelanguagetranslator_active' );
 
555
  $language_choices = $this->googlelanguagetranslator_included_languages();
556
  $floating_widget = get_option ('googlelanguagetranslator_floating_widget');
557
  $str = '';
645
  add_settings_section('glt_settings','Settings','','google_language_translator');
646
 
647
  $settings_name_array = array (
648
+ 'googlelanguagetranslator_active','googlelanguagetranslator_language','language_display_settings','googlelanguagetranslator_flags','googlelanguagetranslator_translatebox','googlelanguagetranslator_display','googlelanguagetranslator_toolbar','googlelanguagetranslator_showbranding','googlelanguagetranslator_flags_alignment','googlelanguagetranslator_analytics','googlelanguagetranslator_analytics_id','googlelanguagetranslator_css','googlelanguagetranslator_multilanguage','googlelanguagetranslator_floating_widget','googlelanguagetranslator_flag_size','googlelanguagetranslator_flags_order','googlelanguagetranslator_english_flag_choice','googlelanguagetranslator_spanish_flag_choice','googlelanguagetranslator_portuguese_flag_choice','googlelanguagetranslator_floating_widget_text','googlelanguagetranslator_floating_widget_text_allow_translation'
649
  );
650
 
651
  foreach ($settings_name_array as $setting) {
695
  <?php
696
  }
697
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
698
  public function language_display_settings_cb() {
699
  $default_language_code = get_option('googlelanguagetranslator_language');
700
  $option_name = 'language_display_settings';
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.36
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.36
50
  - Removed undefined variable PHP errors.
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.37
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.37
50
+ - Made some additional adjustments in code for the settings page.
51
+
52
  5.0.36
53
  - Removed undefined variable PHP errors.
54