Version Description
Download this release
Release Info
Developer | rm2773 |
Plugin | Google Language Translator |
Version | 2.2 |
Comparing to | |
See all releases |
Code changes from version 2.1 to 2.2
- google-language-translator.php +28 -22
- images/united-kingdom.png +0 -0
- images/united-states.png +0 -0
- readme.txt +9 -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: 2.
|
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/
|
@@ -157,7 +157,7 @@ function googlelanguagetranslator_menu_options(){
|
|
157 |
$get_language_choices['fa'] = $_POST['fa'];
|
158 |
$get_language_choices['pl'] = $_POST['pl'];
|
159 |
$get_language_choices['pt'] = $_POST['pt'];
|
160 |
-
$get_language_choices['ro'] = $_POST['
|
161 |
$get_language_choices['ru'] = $_POST['ru'];
|
162 |
$get_language_choices['sr'] = $_POST['sr'];
|
163 |
$get_language_choices['sk'] = $_POST['sk'];
|
@@ -222,6 +222,8 @@ function googlelanguagetranslator_menu(){
|
|
222 |
<option value="it" <?php if(get_option('googlelanguagetranslator_language')=='it'){echo "selected";}?>>Italian</option>
|
223 |
<option value="da" <?php if(get_option('googlelanguagetranslator_language')=='da'){echo "selected";}?>>Danish</option>
|
224 |
<option value="nl" <?php if(get_option('googlelanguagetranslator_language')=='nl'){echo "selected";}?>>Dutch</option>
|
|
|
|
|
225 |
<option value="ja" <?php if(get_option('googlelanguagetranslator_language')=='ja'){echo "selected";}?>>Japanese</option>
|
226 |
<option value="zh-CN" <?php if(get_option('googlelanguagetranslator_language')=='zh-CN'){echo "selected";}?>>Chinese</option>
|
227 |
<option value="ru" <?php if(get_option('googlelanguagetranslator_language')=='ru') {echo "selected";}?>>Russian</option>
|
@@ -301,7 +303,7 @@ function googlelanguagetranslator_menu(){
|
|
301 |
<div><input type="checkbox" name="no" value="1"<?php checked( isset ( $get_language_choices['no'] ) ); ?> /> Norwegian</div>
|
302 |
<div><input type="checkbox" name="fa" value="1"<?php checked( isset ( $get_language_choices['fa'] ) ); ?> /> Persian</div>
|
303 |
<div><input type="checkbox" name="pl" value="1"<?php checked( isset ( $get_language_choices['pl'] ) ); ?> /> Polish</div>
|
304 |
-
<div><input type="checkbox" name="pt" value="1"<?php checked( isset ( $get_language_choices['pt'] ) ); ?> /> Portuguese</div>
|
305 |
<div><input type="checkbox" name="ro" value="1"<?php checked( isset ( $get_language_choices['ro'] ) ); ?> /> Romanian</div>
|
306 |
<div><input type="checkbox" name="ru" value="1"<?php checked( isset ( $get_language_choices['ru'] ) ); ?> /> Russian</div>
|
307 |
</div>
|
@@ -388,12 +390,15 @@ function googlelanguagetranslator_menu(){
|
|
388 |
</tr>
|
389 |
|
390 |
<tr>
|
391 |
-
|
|
|
|
|
392 |
<td>
|
393 |
<select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
|
394 |
<option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
|
395 |
<option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
|
396 |
-
</select>
|
|
|
397 |
</tr>
|
398 |
|
399 |
<tr>
|
@@ -499,25 +504,25 @@ function googlelanguagetranslator_vertical(){
|
|
499 |
$language_choices = googlelanguagetranslator_included_languages();
|
500 |
if(get_option('googlelanguagetranslator_active')==1){
|
501 |
$str.= '<div id="flags">
|
502 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
503 |
|
504 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
505 |
|
506 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
507 |
|
508 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
509 |
|
510 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
511 |
|
512 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
513 |
|
514 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
515 |
|
516 |
</div>
|
517 |
<script type="text/javascript">
|
518 |
|
519 |
function GoogleLanguageTranslatorInit() {
|
520 |
-
new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.' }, \'google_language_translator\');}
|
521 |
</script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
|
522 |
<div id="google_language_translator"></div>';
|
523 |
// $str.='<div id="google_translate_element"></div><script>
|
@@ -535,24 +540,24 @@ function googlelanguagetranslator_horizontal(){
|
|
535 |
$language_choices = googlelanguagetranslator_included_languages();
|
536 |
if(get_option('googlelanguagetranslator_active')==1){
|
537 |
$str.= '<div id="flags">
|
538 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
539 |
|
540 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
541 |
|
542 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
543 |
|
544 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
545 |
|
546 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
547 |
|
548 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
549 |
|
550 |
-
<a href="#" onclick="doGoogleLanguageTranslator(\'
|
551 |
|
552 |
</div>
|
553 |
<script type="text/javascript">
|
554 |
function GoogleLanguageTranslatorInit() {
|
555 |
-
new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.' layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL }, \'google_language_translator\'); }
|
556 |
</script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
|
557 |
<div id="google_language_translator"></div>';
|
558 |
//$language_choices = googlelanguagetranslator_included_languages();
|
@@ -641,6 +646,7 @@ function googlelanguagetranslator_showbranding_no() {
|
|
641 |
|
642 |
function googlelanguagetranslator_flags_display() { ?>
|
643 |
<style type="text/css">
|
|
|
644 |
#flags a { display:inline-block; width:16px; height:12px; }
|
645 |
</style>
|
646 |
<?php $get_flag_choices = get_option ('flag_display_settings');
|
@@ -658,7 +664,7 @@ function googlelanguagetranslator_flags_display() { ?>
|
|
658 |
|
659 |
if ( isset ( $get_flag_choices['flag-en'] ) && (get_option('googlelanguagetranslator_language_option')=='all') ) { ?>
|
660 |
<style type="text/css">
|
661 |
-
#flags a.english { background:url("<?php echo plugins_url(); ?>/google-language-translator/images/united-
|
662 |
</style>
|
663 |
<?php } else { ?>
|
664 |
<style type="text/css">
|
2 |
/*
|
3 |
Plugin Name: Google Language Translator
|
4 |
Plugin URI: http://www.studio88design.com/plugins/google-language-translator
|
5 |
+
Version: 2.2
|
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/
|
157 |
$get_language_choices['fa'] = $_POST['fa'];
|
158 |
$get_language_choices['pl'] = $_POST['pl'];
|
159 |
$get_language_choices['pt'] = $_POST['pt'];
|
160 |
+
$get_language_choices['ro'] = $_POST['ro'];
|
161 |
$get_language_choices['ru'] = $_POST['ru'];
|
162 |
$get_language_choices['sr'] = $_POST['sr'];
|
163 |
$get_language_choices['sk'] = $_POST['sk'];
|
222 |
<option value="it" <?php if(get_option('googlelanguagetranslator_language')=='it'){echo "selected";}?>>Italian</option>
|
223 |
<option value="da" <?php if(get_option('googlelanguagetranslator_language')=='da'){echo "selected";}?>>Danish</option>
|
224 |
<option value="nl" <?php if(get_option('googlelanguagetranslator_language')=='nl'){echo "selected";}?>>Dutch</option>
|
225 |
+
<option value="de" <?php if(get_option('googlelanguagetranslator_language')=="de"){echo "selected";}?>>German</option>
|
226 |
+
<option value="pt" <?php if(get_option('googlelanguagetranslator_language')=="pt"){echo "selected";}?>>Portuguese</option>
|
227 |
<option value="ja" <?php if(get_option('googlelanguagetranslator_language')=='ja'){echo "selected";}?>>Japanese</option>
|
228 |
<option value="zh-CN" <?php if(get_option('googlelanguagetranslator_language')=='zh-CN'){echo "selected";}?>>Chinese</option>
|
229 |
<option value="ru" <?php if(get_option('googlelanguagetranslator_language')=='ru') {echo "selected";}?>>Russian</option>
|
303 |
<div><input type="checkbox" name="no" value="1"<?php checked( isset ( $get_language_choices['no'] ) ); ?> /> Norwegian</div>
|
304 |
<div><input type="checkbox" name="fa" value="1"<?php checked( isset ( $get_language_choices['fa'] ) ); ?> /> Persian</div>
|
305 |
<div><input type="checkbox" name="pl" value="1"<?php checked( isset ( $get_language_choices['pl'] ) ); ?> /> Polish</div>
|
306 |
+
<div><input type="checkbox" name="pt" value="1"<?php checked( isset ( $get_language_choices['pt'] ) ); ?> /> Portuguese</div>
|
307 |
<div><input type="checkbox" name="ro" value="1"<?php checked( isset ( $get_language_choices['ro'] ) ); ?> /> Romanian</div>
|
308 |
<div><input type="checkbox" name="ru" value="1"<?php checked( isset ( $get_language_choices['ru'] ) ); ?> /> Russian</div>
|
309 |
</div>
|
390 |
</tr>
|
391 |
|
392 |
<tr>
|
393 |
+
<td>Show Google Branding?<br/>
|
394 |
+
<span>(<a href="https://developers.google.com/translate/v2/attribution" target="_blank">Learn more</a> about Google's Attribution Requirments.)</span>
|
395 |
+
</td>
|
396 |
<td>
|
397 |
<select name="googlelanguagetranslator_showbranding" id="googlelanguagetranslator_showbranding" style="width:170px;">
|
398 |
<option value="Yes" <?php if(get_option('googlelanguagetranslator_showbranding')=='Yes'){echo "selected";}?>>Yes</option>
|
399 |
<option value="No" <?php if(get_option('googlelanguagetranslator_showbranding')=='No'){echo "selected";}?>>No</option>
|
400 |
+
</select>
|
401 |
+
</td>
|
402 |
</tr>
|
403 |
|
404 |
<tr>
|
504 |
$language_choices = googlelanguagetranslator_included_languages();
|
505 |
if(get_option('googlelanguagetranslator_active')==1){
|
506 |
$str.= '<div id="flags">
|
507 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|en\');return false;" title="English" class="flag english"></a>
|
508 |
|
509 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|es\');return false;" title="Spanish" class="flag spanish"></a>
|
510 |
|
511 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|fr\');return false;" title="French" class="flag french"></a>
|
512 |
|
513 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|it\');return false;" title="Italian" class="flag italian"></a>
|
514 |
|
515 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|de\');return false;" title="German" class="flag german"></a>
|
516 |
|
517 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|da\');return false;" title="Danish" class="flag danish"></a>
|
518 |
|
519 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|zh-CN\');return false;" title="Chinese" class="flag chinese"></a>
|
520 |
|
521 |
</div>
|
522 |
<script type="text/javascript">
|
523 |
|
524 |
function GoogleLanguageTranslatorInit() {
|
525 |
+
new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.'autoDisplay: false }, \'google_language_translator\');}
|
526 |
</script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
|
527 |
<div id="google_language_translator"></div>';
|
528 |
// $str.='<div id="google_translate_element"></div><script>
|
540 |
$language_choices = googlelanguagetranslator_included_languages();
|
541 |
if(get_option('googlelanguagetranslator_active')==1){
|
542 |
$str.= '<div id="flags">
|
543 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|en\');return false;" title="English" class="flag english"></a>
|
544 |
|
545 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|es\');return false;" title="Spanish" class="flag spanish"></a>
|
546 |
|
547 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|fr\');return false;" title="French" class="flag french"></a>
|
548 |
|
549 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|it\');return false;" title="Italian" class="flag italian"></a>
|
550 |
|
551 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|de\');return false;" title="German" class="flag german"></a>
|
552 |
|
553 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|da\');return false;" title="Danish" class="flag danish"></a>
|
554 |
|
555 |
+
<a href="#" onclick="doGoogleLanguageTranslator(\''.get_option('googlelanguagetranslator_language').'|zh-CN\');return false;" title="Chinese" class="flag chinese"></a>
|
556 |
|
557 |
</div>
|
558 |
<script type="text/javascript">
|
559 |
function GoogleLanguageTranslatorInit() {
|
560 |
+
new google.translate.TranslateElement({pageLanguage: \''.get_option('googlelanguagetranslator_language').'\', '.$language_choices.' layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL,autoDisplay: false }, \'google_language_translator\'); }
|
561 |
</script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=GoogleLanguageTranslatorInit"></script>
|
562 |
<div id="google_language_translator"></div>';
|
563 |
//$language_choices = googlelanguagetranslator_included_languages();
|
646 |
|
647 |
function googlelanguagetranslator_flags_display() { ?>
|
648 |
<style type="text/css">
|
649 |
+
#flags { width:140px; }
|
650 |
#flags a { display:inline-block; width:16px; height:12px; }
|
651 |
</style>
|
652 |
<?php $get_flag_choices = get_option ('flag_display_settings');
|
664 |
|
665 |
if ( isset ( $get_flag_choices['flag-en'] ) && (get_option('googlelanguagetranslator_language_option')=='all') ) { ?>
|
666 |
<style type="text/css">
|
667 |
+
#flags a.english { background:url("<?php echo plugins_url(); ?>/google-language-translator/images/united-kingdom.png") 0px -2px no-repeat; }
|
668 |
</style>
|
669 |
<?php } else { ?>
|
670 |
<style type="text/css">
|
images/united-kingdom.png
ADDED
Binary file
|
images/united-states.png
DELETED
Binary file
|
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.52
|
8 |
-
stable tag: 2.
|
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 |
|
@@ -66,6 +66,14 @@ Settings include: inline or vertical layout, show/hide specific languages, hide/
|
|
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 |
== Screenshots ==
|
70 |
|
71 |
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.52
|
8 |
+
stable tag: 2.2
|
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 |
|
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 |
== Screenshots ==
|
78 |
|
79 |
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.
|