Version Description
- No-scroll option added for floating language selector
- Now you can add more than one GTranslate widget to your sidebar
Download this release
Release Info
Developer | edo888 |
Plugin | Translate WordPress with GTranslate |
Version | 2.8.24 |
Comparing to | |
See all releases |
Code changes from version 2.8.23 to 2.8.24
- gtranslate.php +105 -29
- readme.txt +7 -3
gtranslate.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: GTranslate
|
4 |
Plugin URI: https://gtranslate.io/?xyz=998
|
5 |
Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://wordpress.org/support/plugin/gtranslate">GTranslate Support</a>.
|
6 |
-
Version: 2.8.
|
7 |
Author: Edvard Ananyan
|
8 |
Author URI: https://gtranslate.io
|
9 |
Text Domain: gtranslate
|
@@ -163,8 +163,9 @@ class GTranslate extends WP_Widget {
|
|
163 |
}
|
164 |
|
165 |
public static function register() {
|
166 |
-
|
167 |
-
|
|
|
168 |
}
|
169 |
|
170 |
public static function admin_menu() {
|
@@ -781,8 +782,8 @@ EOT;
|
|
781 |
<td class="option_name"><?php _e('Widget look', 'gtranslate'); ?>:</td>
|
782 |
<td>
|
783 |
<select id="widget_look" name="widget_look" onChange="RefreshDoWidgetCode()">
|
784 |
-
<option value="flags_dropdown"><?php _e('Flags and dropdown', 'gtranslate'); ?></option>
|
785 |
<option value="dropdown_with_flags"><?php _e('Nice dropdown with flags', 'gtranslate'); ?></option>
|
|
|
786 |
<option value="dropdown"><?php _e('Dropdown', 'gtranslate'); ?></option>
|
787 |
<option value="flags"><?php _e('Flags', 'gtranslate'); ?></option>
|
788 |
<option value="flags_name"><?php _e('Flags with language name', 'gtranslate'); ?></option>
|
@@ -910,11 +911,11 @@ EOT;
|
|
910 |
</tr>
|
911 |
<tr>
|
912 |
<td class="option_name">* <?php _e('Sub-directory URL structure', 'gtranslate'); ?>:<br><code><small>http://example.com/<b>ru</b>/</small></code></td>
|
913 |
-
<td><input id="pro_version" name="pro_version" value="1" type="checkbox" onclick="if(jQuery('#pro_version').is(':checked') && jQuery('#enterprise_version').is(':checked'))jQuery('#enterprise_version').prop('checked', false);RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/> <a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">* <?php _e('paid plans only', 'gtranslate'); ?></a></td>
|
914 |
</tr>
|
915 |
<tr>
|
916 |
<td class="option_name">* <?php _e('Sub-domain URL structure', 'gtranslate'); ?>:<br><code><small>http://<b>es</b>.example.com/</small></code></td>
|
917 |
-
<td><input id="enterprise_version" name="enterprise_version" value="1" type="checkbox" onclick="if(jQuery('#pro_version').is(':checked') && jQuery('#enterprise_version').is(':checked'))jQuery('#pro_version').prop('checked', false);RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/> <a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">* <?php _e('paid plans only', 'gtranslate'); ?></a></td>
|
918 |
</tr>
|
919 |
<tr id="url_translation_option" style="display:none;">
|
920 |
<td class="option_name"><?php _e('Enable URL Translation', 'gtranslate'); ?>:</td>
|
@@ -942,9 +943,13 @@ EOT;
|
|
942 |
<select id="floating_language_selector" name="floating_language_selector">
|
943 |
<option value="no"><?php _e('No', 'gtranslate'); ?></option>
|
944 |
<option value="top_left"><?php _e('Top left', 'gtranslate'); ?></option>
|
|
|
945 |
<option value="top_right"><?php _e('Top right', 'gtranslate'); ?></option>
|
|
|
946 |
<option value="bottom_left"><?php _e('Bottom left', 'gtranslate'); ?></option>
|
|
|
947 |
<option value="bottom_right"><?php _e('Bottom right', 'gtranslate'); ?></option>
|
|
|
948 |
</select>
|
949 |
</td>
|
950 |
</tr>
|
@@ -1018,8 +1023,9 @@ EOT;
|
|
1018 |
|
1019 |
<div id="poststuff">
|
1020 |
<div class="postbox">
|
1021 |
-
<h3 id="settings"><?php _e('Widget code', 'gtranslate'); ?></h3>
|
1022 |
<div class="inside">
|
|
|
1023 |
<?php _e('You can edit this if you wish', 'gtranslate'); ?>:<br />
|
1024 |
<textarea id="widget_code" name="widget_code" onchange="ShowWidgetPreview(this.value)" style="font-family:Monospace;font-size:11px;height:150px;width:565px;"><?php echo $widget_code; ?></textarea><br />
|
1025 |
<span style="color:red;"><?php _e('DO NOT COPY THIS INTO YOUR POSTS OR PAGES! Use [GTranslate] shortcode inside the post/page <br />or add a GTranslate widget into your sidebar from Appearance -> Widgets instead.', 'gtranslate'); ?></span><br /><br />
|
@@ -1068,13 +1074,13 @@ EOT;
|
|
1068 |
<li style="margin:0;"><?php _e('Enable search engine indexing', 'gtranslate'); ?></li>
|
1069 |
<li style="margin:0;"><?php _e('Search engine friendly (SEF) URLs', 'gtranslate'); ?></li>
|
1070 |
<li style="margin:0;"><?php _e('Human level neural translations', 'gtranslate'); ?></li>
|
1071 |
-
<li style="margin:0;"><?php _e('Increase traffic and AdSense revenue', 'gtranslate'); ?></li>
|
1072 |
-
<li style="margin:0;"><?php _e('Meta data translation', 'gtranslate'); ?></li>
|
1073 |
<li style="margin:0;"><?php _e('Edit translations manually', 'gtranslate'); ?></li>
|
|
|
1074 |
<li style="margin:0;"><?php _e('URL/slug translation', 'gtranslate'); ?></li>
|
1075 |
<li style="margin:0;"><?php _e('Language hosting (example.fr, example.es)', 'gtranslate'); ?></li>
|
1076 |
<li style="margin:0;"><?php _e('Seamless updates', 'gtranslate'); ?></li>
|
1077 |
-
<li style="margin:0;"><?php _e('
|
|
|
1078 |
</ul>
|
1079 |
|
1080 |
<a href="https://gtranslate.io/?xyz=998#pricing" target="_blank"><?php _e('15 day free trial', 'gtranslate'); ?></a> | <a href="https://gtranslate.io/?xyz=998#faq" target="_blank"><?php _e('FAQ', 'gtranslate'); ?></a> | <a href="https://gtranslate.io/?xyz=998#contact" target="_blank"><?php _e('Live Chat', 'gtranslate'); ?></a>
|
@@ -1102,21 +1108,38 @@ EOT;
|
|
1102 |
</div>
|
1103 |
</div>
|
1104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1105 |
<div id="poststuff">
|
1106 |
<div class="postbox">
|
1107 |
<h3 id="settings"><?php _e('GTranslate Tour Video', 'gtranslate'); ?></h3>
|
1108 |
<div class="inside">
|
1109 |
<iframe width="480" height="270" src="https://www.youtube.com/embed/R4mfiKGZh_g" frameborder="0" allowfullscreen></iframe>
|
1110 |
-
<!--iframe src="//player.vimeo.com/video/30132555?title=1&byline=0&portrait=0" width="568" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe-->
|
1111 |
</div>
|
1112 |
</div>
|
1113 |
</div>
|
|
|
1114 |
<div id="poststuff">
|
1115 |
<div class="postbox">
|
1116 |
-
<h3 id="settings"><?php _e('
|
1117 |
<div class="inside">
|
1118 |
-
<
|
1119 |
-
|
1120 |
</div>
|
1121 |
</div>
|
1122 |
</div>
|
@@ -1267,6 +1290,54 @@ EOT;
|
|
1267 |
}
|
1268 |
}
|
1269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1270 |
class GTranslate_Notices {
|
1271 |
protected $prefix = 'gtranslate';
|
1272 |
public $notice_spam = 0;
|
@@ -1473,6 +1544,7 @@ class GTranslate_Notices {
|
|
1473 |
}
|
1474 |
|
1475 |
public function gt_admin_notices() {
|
|
|
1476 |
$one_week_support = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'one_week_support')));
|
1477 |
|
1478 |
$notices['one_week_support'] = array(
|
@@ -1483,9 +1555,10 @@ class GTranslate_Notices {
|
|
1483 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1484 |
'int' => 1
|
1485 |
);
|
|
|
1486 |
|
1487 |
$two_week_review_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'two_week_review')));
|
1488 |
-
$two_week_review_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'gt_int' =>
|
1489 |
|
1490 |
$notices['two_week_review'] = array(
|
1491 |
'title' => __('Please Leave a Review', 'gtranslate'),
|
@@ -1502,58 +1575,57 @@ class GTranslate_Notices {
|
|
1502 |
GTranslate::load_defaults($data);
|
1503 |
|
1504 |
$upgrade_tips_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'upgrade_tips')));
|
1505 |
-
$upgrade_tips_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'upgrade_tips', 'gt_int' =>
|
1506 |
|
1507 |
if($data['pro_version'] != '1' and $data['enterprise_version'] != '1') {
|
1508 |
$notices['upgrade_tips'][] = array(
|
1509 |
'title' => __('Did you know?', 'gtranslate'),
|
1510 |
-
'msg' => __('You can <b>
|
1511 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1512 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1513 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1514 |
'later_link' => $upgrade_tips_temp,
|
1515 |
-
'int' =>
|
1516 |
);
|
1517 |
|
1518 |
$notices['upgrade_tips'][] = array(
|
1519 |
'title' => __('Did you know?', 'gtranslate'),
|
1520 |
-
'msg' => __('You can
|
1521 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1522 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1523 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1524 |
'later_link' => $upgrade_tips_temp,
|
1525 |
-
'int' =>
|
1526 |
);
|
1527 |
|
1528 |
$notices['upgrade_tips'][] = array(
|
1529 |
'title' => __('Did you know?', 'gtranslate'),
|
1530 |
-
'msg' => __('You can
|
1531 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1532 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1533 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1534 |
'later_link' => $upgrade_tips_temp,
|
1535 |
-
'int' =>
|
1536 |
);
|
1537 |
|
1538 |
$notices['upgrade_tips'][] = array(
|
1539 |
'title' => __('Did you know?', 'gtranslate'),
|
1540 |
-
'msg' => __('You can <b>
|
1541 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1542 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1543 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1544 |
'later_link' => $upgrade_tips_temp,
|
1545 |
-
'int' =>
|
1546 |
);
|
1547 |
|
1548 |
$notices['upgrade_tips'][] = array(
|
1549 |
'title' => __('Did you know?', 'gtranslate'),
|
1550 |
-
'msg' => __('You can
|
1551 |
-
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#
|
1552 |
-
'<li><span class="dashicons dashicons-external"></span><a href="https://wordpress.org/support/plugin/gtranslate" target="_blank">' . __('Support Forum', 'gtranslate') . '</a></li>' .
|
1553 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1554 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1555 |
'later_link' => $upgrade_tips_temp,
|
1556 |
-
'int' =>
|
1557 |
);
|
1558 |
|
1559 |
shuffle($notices['upgrade_tips']);
|
@@ -1628,7 +1700,7 @@ if($data['floating_language_selector'] != 'no' and !is_admin()) {
|
|
1628 |
GTranslate::load_defaults($data);
|
1629 |
|
1630 |
if($data['widget_look'] == 'dropdown_with_flags')
|
1631 |
-
if(is_admin_bar_showing() and ($data['floating_language_selector'] == 'top_left' or $data['floating_language_selector'] == 'top_right'))
|
1632 |
$vertical_location = '32px';
|
1633 |
else
|
1634 |
$vertical_location = '0';
|
@@ -1637,9 +1709,13 @@ if($data['floating_language_selector'] != 'no' and !is_admin()) {
|
|
1637 |
|
1638 |
switch($data['floating_language_selector']) {
|
1639 |
case 'top_left': $html = '<div style="position:fixed;top:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
|
|
1640 |
case 'top_right': $html = '<div style="position:fixed;top:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
|
|
1641 |
case 'bottom_left': $html = '<div style="position:fixed;bottom:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
|
|
1642 |
case 'bottom_right': $html = '<div style="position:fixed;bottom:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
|
|
1643 |
default: $html = ''; break;
|
1644 |
}
|
1645 |
|
3 |
Plugin Name: GTranslate
|
4 |
Plugin URI: https://gtranslate.io/?xyz=998
|
5 |
Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="https://wordpress.org/support/plugin/gtranslate">GTranslate Support</a>.
|
6 |
+
Version: 2.8.24
|
7 |
Author: Edvard Ananyan
|
8 |
Author URI: https://gtranslate.io
|
9 |
Text Domain: gtranslate
|
163 |
}
|
164 |
|
165 |
public static function register() {
|
166 |
+
register_widget('GTranslateWidget');
|
167 |
+
//wp_register_sidebar_widget('gtranslate', 'GTranslate', array('GTranslate', 'widget2'), array('description' => __('Google Automatic Translations')));
|
168 |
+
//wp_register_widget_control('gtranslate', 'GTranslate', array('GTranslate', 'control'));
|
169 |
}
|
170 |
|
171 |
public static function admin_menu() {
|
782 |
<td class="option_name"><?php _e('Widget look', 'gtranslate'); ?>:</td>
|
783 |
<td>
|
784 |
<select id="widget_look" name="widget_look" onChange="RefreshDoWidgetCode()">
|
|
|
785 |
<option value="dropdown_with_flags"><?php _e('Nice dropdown with flags', 'gtranslate'); ?></option>
|
786 |
+
<option value="flags_dropdown"><?php _e('Flags and dropdown', 'gtranslate'); ?></option>
|
787 |
<option value="dropdown"><?php _e('Dropdown', 'gtranslate'); ?></option>
|
788 |
<option value="flags"><?php _e('Flags', 'gtranslate'); ?></option>
|
789 |
<option value="flags_name"><?php _e('Flags with language name', 'gtranslate'); ?></option>
|
911 |
</tr>
|
912 |
<tr>
|
913 |
<td class="option_name">* <?php _e('Sub-directory URL structure', 'gtranslate'); ?>:<br><code><small>http://example.com/<b>ru</b>/</small></code></td>
|
914 |
+
<td><input id="pro_version" name="pro_version" value="1" type="checkbox" onclick="if(jQuery('#pro_version').is(':checked') && jQuery('#enterprise_version').is(':checked'))jQuery('#enterprise_version').prop('checked', false);RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/> <a href="https://gtranslate.io/?xyz=998#pricing" target="_blank" title="If you already have a subscription, you can enable this.">* <?php _e('paid plans only', 'gtranslate'); ?></a></td>
|
915 |
</tr>
|
916 |
<tr>
|
917 |
<td class="option_name">* <?php _e('Sub-domain URL structure', 'gtranslate'); ?>:<br><code><small>http://<b>es</b>.example.com/</small></code></td>
|
918 |
+
<td><input id="enterprise_version" name="enterprise_version" value="1" type="checkbox" onclick="if(jQuery('#pro_version').is(':checked') && jQuery('#enterprise_version').is(':checked'))jQuery('#pro_version').prop('checked', false);RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/> <a href="https://gtranslate.io/?xyz=998#pricing" target="_blank" title="If you already have a subscription, you can enable this.">* <?php _e('paid plans only', 'gtranslate'); ?></a></td>
|
919 |
</tr>
|
920 |
<tr id="url_translation_option" style="display:none;">
|
921 |
<td class="option_name"><?php _e('Enable URL Translation', 'gtranslate'); ?>:</td>
|
943 |
<select id="floating_language_selector" name="floating_language_selector">
|
944 |
<option value="no"><?php _e('No', 'gtranslate'); ?></option>
|
945 |
<option value="top_left"><?php _e('Top left', 'gtranslate'); ?></option>
|
946 |
+
<option value="top_left_sticky"><?php _e('Top left (no-scroll)', 'gtranslate'); ?></option>
|
947 |
<option value="top_right"><?php _e('Top right', 'gtranslate'); ?></option>
|
948 |
+
<option value="top_right_sticky"><?php _e('Top right (no-scroll)', 'gtranslate'); ?></option>
|
949 |
<option value="bottom_left"><?php _e('Bottom left', 'gtranslate'); ?></option>
|
950 |
+
<option value="bottom_left_sticky"><?php _e('Bottom left (no-scroll)', 'gtranslate'); ?></option>
|
951 |
<option value="bottom_right"><?php _e('Bottom right', 'gtranslate'); ?></option>
|
952 |
+
<option value="bottom_right_sticky"><?php _e('Bottom right (no-scroll)', 'gtranslate'); ?></option>
|
953 |
</select>
|
954 |
</td>
|
955 |
</tr>
|
1023 |
|
1024 |
<div id="poststuff">
|
1025 |
<div class="postbox">
|
1026 |
+
<h3 id="settings"><?php _e('Widget code (for advanced users)', 'gtranslate'); ?></h3>
|
1027 |
<div class="inside">
|
1028 |
+
<p><?php _e('This area is for advanced users ONLY who know HTML/CSS/Javascript and do not want to use "Show floating language selector" option.', 'gtranslate'); ?></p>
|
1029 |
<?php _e('You can edit this if you wish', 'gtranslate'); ?>:<br />
|
1030 |
<textarea id="widget_code" name="widget_code" onchange="ShowWidgetPreview(this.value)" style="font-family:Monospace;font-size:11px;height:150px;width:565px;"><?php echo $widget_code; ?></textarea><br />
|
1031 |
<span style="color:red;"><?php _e('DO NOT COPY THIS INTO YOUR POSTS OR PAGES! Use [GTranslate] shortcode inside the post/page <br />or add a GTranslate widget into your sidebar from Appearance -> Widgets instead.', 'gtranslate'); ?></span><br /><br />
|
1074 |
<li style="margin:0;"><?php _e('Enable search engine indexing', 'gtranslate'); ?></li>
|
1075 |
<li style="margin:0;"><?php _e('Search engine friendly (SEF) URLs', 'gtranslate'); ?></li>
|
1076 |
<li style="margin:0;"><?php _e('Human level neural translations', 'gtranslate'); ?></li>
|
|
|
|
|
1077 |
<li style="margin:0;"><?php _e('Edit translations manually', 'gtranslate'); ?></li>
|
1078 |
+
<li style="margin:0;"><?php _e('Meta data translation', 'gtranslate'); ?></li>
|
1079 |
<li style="margin:0;"><?php _e('URL/slug translation', 'gtranslate'); ?></li>
|
1080 |
<li style="margin:0;"><?php _e('Language hosting (example.fr, example.es)', 'gtranslate'); ?></li>
|
1081 |
<li style="margin:0;"><?php _e('Seamless updates', 'gtranslate'); ?></li>
|
1082 |
+
<li style="margin:0;"><?php _e('Increase traffic and AdSense revenue', 'gtranslate'); ?></li>
|
1083 |
+
<li style="margin:0;"><?php _e('Works for visitors from China', 'gtranslate'); ?></li>
|
1084 |
</ul>
|
1085 |
|
1086 |
<a href="https://gtranslate.io/?xyz=998#pricing" target="_blank"><?php _e('15 day free trial', 'gtranslate'); ?></a> | <a href="https://gtranslate.io/?xyz=998#faq" target="_blank"><?php _e('FAQ', 'gtranslate'); ?></a> | <a href="https://gtranslate.io/?xyz=998#contact" target="_blank"><?php _e('Live Chat', 'gtranslate'); ?></a>
|
1108 |
</div>
|
1109 |
</div>
|
1110 |
|
1111 |
+
<div id="poststuff">
|
1112 |
+
<div class="postbox">
|
1113 |
+
<h3 id="settings"><?php _e('Useful links', 'gtranslate'); ?></h3>
|
1114 |
+
<div class="inside">
|
1115 |
+
<ul style="list-style-type:square;padding-left:20px;">
|
1116 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://wordpress.org/plugins/gtranslate/#installation" target="_blank"><?php _e('Quick instructions', 'gtranslate'); ?></a></li>
|
1117 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://gtranslate.io/videos" target="_blank"><?php _e('Videos', 'gtranslate'); ?></a></li>
|
1118 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://gtranslate.io/?xyz=998#faq" target="_blank"><?php _e('FAQ', 'gtranslate'); ?></a></li>
|
1119 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://gtranslate.io/forum/" target="_blank"><?php _e('Support forum', 'gtranslate'); ?></a></li>
|
1120 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://gtranslate.io/?xyz=998#pricing" target="_blank"><?php _e('Compare plans', 'gtranslate'); ?></a></li>
|
1121 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://gtranslate.io/about-us" target="_blank"><?php _e('About GTranslate team', 'gtranslate'); ?></a></li>
|
1122 |
+
<li style="margin:0;"><a style="text-decoration:none;" href="https://wordpress.org/support/plugin/gtranslate/reviews/" target="_blank"><?php _e('Reviews', 'gtranslate'); ?></a></li>
|
1123 |
+
</ul>
|
1124 |
+
</div>
|
1125 |
+
</div>
|
1126 |
+
</div>
|
1127 |
+
|
1128 |
<div id="poststuff">
|
1129 |
<div class="postbox">
|
1130 |
<h3 id="settings"><?php _e('GTranslate Tour Video', 'gtranslate'); ?></h3>
|
1131 |
<div class="inside">
|
1132 |
<iframe width="480" height="270" src="https://www.youtube.com/embed/R4mfiKGZh_g" frameborder="0" allowfullscreen></iframe>
|
|
|
1133 |
</div>
|
1134 |
</div>
|
1135 |
</div>
|
1136 |
+
|
1137 |
<div id="poststuff">
|
1138 |
<div class="postbox">
|
1139 |
+
<h3 id="settings"><?php _e('Live chat', 'gtranslate'); ?></h3>
|
1140 |
<div class="inside">
|
1141 |
+
<p>9am - 6pm (Mon - Fri) New York Time</p>
|
1142 |
+
<p>We try to help everyone.</p>
|
1143 |
</div>
|
1144 |
</div>
|
1145 |
</div>
|
1290 |
}
|
1291 |
}
|
1292 |
|
1293 |
+
class GTranslateWidget extends WP_Widget {
|
1294 |
+
|
1295 |
+
function __construct() {
|
1296 |
+
parent::__construct('gtranslate', esc_html__('GTranslate', 'gtranslate'), array('description' => esc_html__('GTranslate language switcher', 'gtranslate')));
|
1297 |
+
}
|
1298 |
+
|
1299 |
+
public function widget($args, $instance) {
|
1300 |
+
echo $args['before_widget'];
|
1301 |
+
|
1302 |
+
if(!empty($instance['title'])) {
|
1303 |
+
echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
|
1304 |
+
}
|
1305 |
+
|
1306 |
+
$data = get_option('GTranslate');
|
1307 |
+
GTranslate::load_defaults($data);
|
1308 |
+
|
1309 |
+
if(empty($data['widget_code']))
|
1310 |
+
_e('<b>Notice:</b> Please configure GTranslate from WP-Admin -> Settings -> GTranslate to see it in action.', 'gtranslate');
|
1311 |
+
else
|
1312 |
+
echo $data['widget_code'];
|
1313 |
+
|
1314 |
+
// avoid caching issues
|
1315 |
+
if($data['widget_look'] == 'dropdown_with_flags' and ($data['pro_version'] or $data['enterprise_version'])) {
|
1316 |
+
echo '<script>jQuery(document).ready(function() {jQuery(\'.switcher div.selected a\').html(jQuery(".switcher div.option a[onclick*=\'|"+jQuery(\'html\').attr(\'lang\')+"\']").html())});</script>';
|
1317 |
+
}
|
1318 |
+
|
1319 |
+
echo $args['after_widget'];
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
public function form($instance) {
|
1323 |
+
$title = !empty($instance['title']) ? $instance['title'] : '';
|
1324 |
+
?>
|
1325 |
+
<p>
|
1326 |
+
<label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'gtranslate'); ?></label>
|
1327 |
+
<input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>">
|
1328 |
+
</p>
|
1329 |
+
<?php
|
1330 |
+
}
|
1331 |
+
|
1332 |
+
public function update($new_instance, $old_instance) {
|
1333 |
+
$instance = array();
|
1334 |
+
$instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
|
1335 |
+
|
1336 |
+
return $instance;
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
}
|
1340 |
+
|
1341 |
class GTranslate_Notices {
|
1342 |
protected $prefix = 'gtranslate';
|
1343 |
public $notice_spam = 0;
|
1544 |
}
|
1545 |
|
1546 |
public function gt_admin_notices() {
|
1547 |
+
/*
|
1548 |
$one_week_support = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'one_week_support')));
|
1549 |
|
1550 |
$notices['one_week_support'] = array(
|
1555 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $one_week_support . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1556 |
'int' => 1
|
1557 |
);
|
1558 |
+
*/
|
1559 |
|
1560 |
$two_week_review_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'two_week_review')));
|
1561 |
+
$two_week_review_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'two_week_review', 'gt_int' => 6)));
|
1562 |
|
1563 |
$notices['two_week_review'] = array(
|
1564 |
'title' => __('Please Leave a Review', 'gtranslate'),
|
1575 |
GTranslate::load_defaults($data);
|
1576 |
|
1577 |
$upgrade_tips_ignore = esc_url(add_query_arg(array($this->prefix . '_admin_notice_ignore' => 'upgrade_tips')));
|
1578 |
+
$upgrade_tips_temp = esc_url(add_query_arg(array($this->prefix . '_admin_notice_temp_ignore' => 'upgrade_tips', 'gt_int' => 7)));
|
1579 |
|
1580 |
if($data['pro_version'] != '1' and $data['enterprise_version'] != '1') {
|
1581 |
$notices['upgrade_tips'][] = array(
|
1582 |
'title' => __('Did you know?', 'gtranslate'),
|
1583 |
+
'msg' => __('You can have <b>neural machine translations</b> which are human level by upgrading your GTranslate.', 'gtranslate'),
|
1584 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1585 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1586 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1587 |
'later_link' => $upgrade_tips_temp,
|
1588 |
+
'int' => 5
|
1589 |
);
|
1590 |
|
1591 |
$notices['upgrade_tips'][] = array(
|
1592 |
'title' => __('Did you know?', 'gtranslate'),
|
1593 |
+
'msg' => __('You can <b>increase</b> your international <b>traffic</b> by upgrading your GTranslate.', 'gtranslate'),
|
1594 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1595 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1596 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1597 |
'later_link' => $upgrade_tips_temp,
|
1598 |
+
'int' => 5
|
1599 |
);
|
1600 |
|
1601 |
$notices['upgrade_tips'][] = array(
|
1602 |
'title' => __('Did you know?', 'gtranslate'),
|
1603 |
+
'msg' => __('You can have your <b>translated pages indexed</b> in search engines by upgrading your GTranslate.', 'gtranslate'),
|
1604 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1605 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1606 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1607 |
'later_link' => $upgrade_tips_temp,
|
1608 |
+
'int' => 5
|
1609 |
);
|
1610 |
|
1611 |
$notices['upgrade_tips'][] = array(
|
1612 |
'title' => __('Did you know?', 'gtranslate'),
|
1613 |
+
'msg' => __('You can <b>increase</b> your <b>AdSense revenue</b> by upgrading your GTranslate.', 'gtranslate'),
|
1614 |
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
1615 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1616 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1617 |
'later_link' => $upgrade_tips_temp,
|
1618 |
+
'int' => 5
|
1619 |
);
|
1620 |
|
1621 |
$notices['upgrade_tips'][] = array(
|
1622 |
'title' => __('Did you know?', 'gtranslate'),
|
1623 |
+
'msg' => __('You can <b>edit translations</b> by upgrading your GTranslate.', 'gtranslate'),
|
1624 |
+
'link' => '<li><span class="dashicons dashicons-external"></span><a href="https://gtranslate.io/?xyz=998#pricing" target="_blank">' . __('Learn more', 'gtranslate') . '</a></li>' .
|
|
|
1625 |
'<li><span class="dashicons dashicons-calendar-alt"></span><a href="' . $upgrade_tips_temp . '">' . __('Maybe later', 'gtranslate') . '</a></li>' .
|
1626 |
'<li><span class="dashicons dashicons-dismiss"></span><a href="' . $upgrade_tips_ignore . '">' . __('Never show again', 'gtranslate') . '</a></li>',
|
1627 |
'later_link' => $upgrade_tips_temp,
|
1628 |
+
'int' => 5
|
1629 |
);
|
1630 |
|
1631 |
shuffle($notices['upgrade_tips']);
|
1700 |
GTranslate::load_defaults($data);
|
1701 |
|
1702 |
if($data['widget_look'] == 'dropdown_with_flags')
|
1703 |
+
if(is_admin_bar_showing() and ($data['floating_language_selector'] == 'top_left' or $data['floating_language_selector'] == 'top_right' or $data['floating_language_selector'] == 'top_left_sticky' or $data['floating_language_selector'] == 'top_right_sticky'))
|
1704 |
$vertical_location = '32px';
|
1705 |
else
|
1706 |
$vertical_location = '0';
|
1709 |
|
1710 |
switch($data['floating_language_selector']) {
|
1711 |
case 'top_left': $html = '<div style="position:fixed;top:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1712 |
+
case 'top_left_sticky': $html = '<div style="position:absolute;top:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1713 |
case 'top_right': $html = '<div style="position:fixed;top:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1714 |
+
case 'top_right_sticky': $html = '<div style="position:absolute;top:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1715 |
case 'bottom_left': $html = '<div style="position:fixed;bottom:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1716 |
+
case 'bottom_left_sticky': $html = '<div style="position:absolute;bottom:'.$vertical_location.';left:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1717 |
case 'bottom_right': $html = '<div style="position:fixed;bottom:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1718 |
+
case 'bottom_right_sticky': $html = '<div style="position:absolute;bottom:'.$vertical_location.';right:8%;z-index:999999;">'.GTranslate::get_widget_code(false).'</div>'; break;
|
1719 |
default: $html = ''; break;
|
1720 |
}
|
1721 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Translate Wordpress with GTranslate ===
|
2 |
Contributors: edo888
|
3 |
Author: Edvard Ananyan
|
4 |
-
Tags:
|
5 |
Requires at least: 2.8.1
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.8.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Donate link: https://gtranslate.io/?xyz=998#pricing
|
@@ -218,6 +218,10 @@ You need to go to the language you want to edit, for instance, French: http://do
|
|
218 |
|
219 |
== Changelog ==
|
220 |
|
|
|
|
|
|
|
|
|
221 |
= 2.8.23 =
|
222 |
* Show native language names option turned off by default
|
223 |
* Fixed issue with initial rendering of the language selector
|
1 |
=== Translate Wordpress with GTranslate ===
|
2 |
Contributors: edo888
|
3 |
Author: Edvard Ananyan
|
4 |
+
Tags: translate wordpress, multilingual, translate, translation, language, bilingual, localization, translation proxy, i18n, l10n, localisation, multilanguage, google translate
|
5 |
Requires at least: 2.8.1
|
6 |
+
Tested up to: 4.8
|
7 |
+
Stable tag: 2.8.24
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
Donate link: https://gtranslate.io/?xyz=998#pricing
|
218 |
|
219 |
== Changelog ==
|
220 |
|
221 |
+
= 2.8.24 =
|
222 |
+
* No-scroll option added for floating language selector
|
223 |
+
* Now you can add more than one GTranslate widget to your sidebar
|
224 |
+
|
225 |
= 2.8.23 =
|
226 |
* Show native language names option turned off by default
|
227 |
* Fixed issue with initial rendering of the language selector
|