Version Description
- Bug fixed with new versions of PHP
- Translation queue added
Download this release
Release Info
Developer | edo888 |
Plugin | Translate WordPress with GTranslate |
Version | 1.0.37 |
Comparing to | |
See all releases |
Code changes from version 1.0.27 to 1.0.37
- gtranslate.php +91 -63
- jquery-translate.js +0 -96
- readme.txt +36 -12
gtranslate.php
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: GTranslate
|
4 |
-
Plugin URI: http://
|
5 |
-
Description:
|
6 |
-
Version: 1.0.
|
7 |
Author: Edvard Ananyan
|
8 |
-
Author URI: http://
|
9 |
|
10 |
*/
|
11 |
|
12 |
-
/* Copyright 2010 Edvard Ananyan (email : edo888@gmail.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
@@ -37,10 +37,10 @@ add_shortcode('gtranslate', array('GTranslate', 'get_widget_code'));
|
|
37 |
class GTranslate extends WP_Widget {
|
38 |
function activate() {
|
39 |
$data = array(
|
40 |
-
'gtranslate_title' => '
|
41 |
);
|
42 |
$data = get_option('GTranslate');
|
43 |
-
GTranslate::load_defaults(
|
44 |
|
45 |
add_option('GTranslate', $data);
|
46 |
}
|
@@ -63,41 +63,33 @@ class GTranslate extends WP_Widget {
|
|
63 |
|
64 |
function enqueue_scripts() {
|
65 |
$data = get_option('GTranslate');
|
66 |
-
GTranslate::load_defaults(
|
67 |
$wp_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
|
68 |
|
69 |
-
if($data['translation_method'] == 'on_fly' and !is_admin()) {
|
70 |
-
if($data['load_jquery'])
|
71 |
-
wp_enqueue_script('jquery-translate', $wp_plugin_url.'/jquery-translate.js', array('jquery'));
|
72 |
-
else
|
73 |
-
wp_enqueue_script('jquery-translate', $wp_plugin_url.'/jquery-translate.js');
|
74 |
-
}
|
75 |
-
|
76 |
wp_enqueue_style('gtranslate-style', $wp_plugin_url.'/gtranslate-style'.$data['flag_size'].'.css');
|
77 |
}
|
78 |
|
79 |
function widget($args) {
|
80 |
$data = get_option('GTranslate');
|
81 |
-
GTranslate::load_defaults(
|
82 |
|
83 |
echo $args['before_widget'];
|
84 |
-
echo $args['before_title'] .
|
85 |
if(empty($data['widget_code']))
|
86 |
-
echo '
|
87 |
else
|
88 |
echo $data['widget_code'];
|
89 |
echo $args['after_widget'];
|
90 |
-
echo '<noscript>JavaScript is required to use this <a href="http://edo.webmaster.am/gtranslate">website translator</a>, <a href="http://edo.webmaster.am/gtranslate">site translator</a>, <a href="http://edo.webmaster.am/gtranslate">automatic translation</a>, <a href="http://edo.webmaster.am/gtranslate">free translation</a>. Buy <a href="http://artmaestro.com/">oil paintings</a> on ArtMaestro.</noscript>';
|
91 |
}
|
92 |
|
93 |
function get_widget_code($atts) {
|
94 |
$data = get_option('GTranslate');
|
95 |
-
GTranslate::load_defaults(
|
96 |
|
97 |
if(empty($data['widget_code']))
|
98 |
-
return '
|
99 |
else
|
100 |
-
return $data['widget_code']
|
101 |
}
|
102 |
|
103 |
function register() {
|
@@ -118,7 +110,7 @@ class GTranslate extends WP_Widget {
|
|
118 |
if($_POST['save'])
|
119 |
GTranslate::control_options();
|
120 |
$data = get_option('GTranslate');
|
121 |
-
GTranslate::load_defaults(
|
122 |
|
123 |
$site_url = site_url();
|
124 |
|
@@ -135,15 +127,22 @@ var languages_map = {en_x: 0, en_y: 0, ar_x: 100, ar_y: 0, bg_x: 200, bg_y: 0, z
|
|
135 |
|
136 |
function RefreshDoWidgetCode() {
|
137 |
var new_line = "\\n";
|
138 |
-
var widget_preview = '<!-- GTranslate: http://
|
139 |
var widget_code = '';
|
140 |
var translation_method = jQuery('#translation_method').val();
|
141 |
var default_language = jQuery('#default_language').val();
|
142 |
var flag_size = jQuery('#flag_size').val();
|
143 |
var pro_version = jQuery('#pro_version:checked').length > 0 ? true : false;
|
|
|
144 |
var new_window = jQuery('#new_window:checked').length > 0 ? true : false;
|
145 |
var analytics = jQuery('#analytics:checked').length > 0 ? true : false;
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
if(translation_method == 'google_default') {
|
148 |
included_languages = '';
|
149 |
jQuery.each(languages, function(i, val) {
|
@@ -158,12 +157,14 @@ function RefreshDoWidgetCode() {
|
|
158 |
widget_preview += '<script type="text/javascript">'+new_line;
|
159 |
widget_preview += 'function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: \'';
|
160 |
widget_preview += default_language;
|
161 |
-
widget_preview += '\',
|
|
|
|
|
162 |
widget_preview += included_languages;
|
163 |
widget_preview += "'}, 'google_translate_element');}"+new_line;
|
164 |
widget_preview += '<\/script>';
|
165 |
widget_preview += '<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"><\/script>'+new_line;
|
166 |
-
} else if(translation_method == 'on_fly' || translation_method == 'redirect') {
|
167 |
// Adding flags
|
168 |
if(jQuery('#show_flags:checked').length) {
|
169 |
jQuery.each(languages, function(i, val) {
|
@@ -172,7 +173,14 @@ function RefreshDoWidgetCode() {
|
|
172 |
lang_name = val;
|
173 |
flag_x = languages_map[lang.replace('-', '')+'_x'];
|
174 |
flag_y = languages_map[lang.replace('-', '')+'_y'];
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
}
|
177 |
});
|
178 |
}
|
@@ -195,26 +203,58 @@ function RefreshDoWidgetCode() {
|
|
195 |
widget_preview += '</select>';
|
196 |
}
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
// Adding javascript
|
199 |
widget_code += new_line+new_line;
|
200 |
widget_code += '<script type="text/javascript">'+new_line;
|
201 |
-
widget_code += '
|
202 |
if(pro_version && translation_method == 'redirect' && new_window) {
|
203 |
widget_code += "function openTab(url) {var form=document.createElement('form');form.method='post';form.action=url;form.target='_blank';document.body.appendChild(form);form.submit();}"+new_line;
|
204 |
if(analytics)
|
205 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
|
206 |
else
|
207 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
|
208 |
} else if(pro_version && translation_method == 'redirect') {
|
209 |
if(analytics)
|
210 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
|
211 |
else
|
212 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
} else if(translation_method == 'redirect' && new_window) {
|
214 |
widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
|
215 |
widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
|
216 |
if(analytics)
|
217 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')openTab(unescape(gfg('u')));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href));else openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u')));}"+new_line;
|
218 |
else
|
219 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')openTab(unescape(gfg('u')));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href));else openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u')));}"+new_line;
|
220 |
widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
|
@@ -223,19 +263,15 @@ function RefreshDoWidgetCode() {
|
|
223 |
widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
|
224 |
widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
|
225 |
if(analytics)
|
226 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
|
227 |
else
|
228 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
|
229 |
widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
|
230 |
-
} else if(translation_method == '
|
231 |
-
widget_code += "if(
|
232 |
-
if(analytics)
|
233 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];_gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);jQuery.cookie('glang', lang, {path: '/'});jQuery(function(\$){\$('body').translate('"+default_language+"', lang, {toggle:true, not:'.notranslate'});});}"+new_line;
|
234 |
-
else
|
235 |
-
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;var lang=lang_pair.split('|')[1];jQuery.cookie('glang', lang, {path: '/'});jQuery(function(\$){\$('body').translate('"+default_language+"', lang, {toggle:true, not:'.notranslate'});});}"+new_line;
|
236 |
}
|
237 |
|
238 |
-
widget_code += '
|
239 |
widget_code += '<\/script>'+new_line;
|
240 |
|
241 |
}
|
@@ -256,6 +292,7 @@ function ShowWidgetPreview(widget_preview) {
|
|
256 |
}
|
257 |
|
258 |
jQuery('#pro_version').attr('checked', '$pro_version'.length > 0);
|
|
|
259 |
jQuery('#new_window').attr('checked', '$new_window'.length > 0);
|
260 |
jQuery('#analytics').attr('checked', '$analytics'.length > 0);
|
261 |
jQuery('#load_jquery').attr('checked', '$load_jquery'.length > 0);
|
@@ -285,7 +322,8 @@ foreach($fincl_langs as $lang)
|
|
285 |
?>
|
286 |
<form id="gtranslate" name="form1" method="post" action="<?php echo admin_url() . '/options-general.php?page=gtranslate_options' ?>">
|
287 |
<p>Use the configuration form below to customize the GTranslate widget.</p>
|
288 |
-
<p>If you would like to edit translations manually and have SEF URLs (<?php echo $site_url; ?><b>/es/</b>, <?php echo $site_url; ?><b>/fr/</b>, <?php echo $site_url; ?><b>/it/</b>, etc.) for translated languages or you want your translated pages to be indexed in search engines you may consider <a href="http://
|
|
|
289 |
<div style="float:left;width:270px;">
|
290 |
<h4>Widget options</h4>
|
291 |
<table style="font-size:11px;">
|
@@ -294,8 +332,8 @@ foreach($fincl_langs as $lang)
|
|
294 |
<td>
|
295 |
<select id="translation_method" name="translation_method" onChange="RefreshDoWidgetCode()">
|
296 |
<option value="google_default">Google Default</option>
|
297 |
-
<option value="on_fly" selected>On Fly (jQuery)</option>
|
298 |
<option value="redirect">Redirect</option>
|
|
|
299 |
</select>
|
300 |
</td>
|
301 |
</tr>
|
@@ -364,10 +402,6 @@ foreach($fincl_langs as $lang)
|
|
364 |
</select>
|
365 |
</td>
|
366 |
</tr>
|
367 |
-
<tr>
|
368 |
-
<td class="option_name">Load jQuery library:</td>
|
369 |
-
<td><input id="load_jquery" name="load_jquery" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
370 |
-
</tr>
|
371 |
<tr>
|
372 |
<td class="option_name">Open in new window:</td>
|
373 |
<td><input id="new_window" name="new_window" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
@@ -380,6 +414,10 @@ foreach($fincl_langs as $lang)
|
|
380 |
<td class="option_name">Operate with Pro version:</td>
|
381 |
<td><input id="pro_version" name="pro_version" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
382 |
</tr>
|
|
|
|
|
|
|
|
|
383 |
<tr>
|
384 |
<td class="option_name">Show flags:</td>
|
385 |
<td><input id="show_flags" name="show_flags" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
@@ -554,6 +592,10 @@ foreach($fincl_langs as $lang)
|
|
554 |
</div>
|
555 |
<p class="submit"><input type="submit" class="button-primary" name="save" value="<?php _e('Save Changes'); ?>" /></p>
|
556 |
</form>
|
|
|
|
|
|
|
|
|
557 |
</div>
|
558 |
<script type="text/javascript"><?php echo $script; ?></script>
|
559 |
<?php
|
@@ -565,6 +607,7 @@ foreach($fincl_langs as $lang)
|
|
565 |
$data = get_option('GTranslate');
|
566 |
|
567 |
$data['pro_version'] = isset($_POST['pro_version']) ? $_POST['pro_version'] : '';
|
|
|
568 |
$data['new_window'] = isset($_POST['new_window']) ? $_POST['new_window'] : '';
|
569 |
$data['analytics'] = isset($_POST['analytics']) ? $_POST['analytics'] : '';
|
570 |
$data['load_jquery'] = isset($_POST['load_jquery']) ? $_POST['load_jquery'] : '';
|
@@ -584,6 +627,7 @@ foreach($fincl_langs as $lang)
|
|
584 |
|
585 |
function load_defaults(& $data) {
|
586 |
$data['pro_version'] = isset($data['pro_version']) ? $data['pro_version'] : '';
|
|
|
587 |
$data['new_window'] = isset($data['new_window']) ? $data['new_window'] : '';
|
588 |
$data['analytics'] = isset($data['analytics']) ? $data['analytics'] : '';
|
589 |
$data['load_jquery'] = isset($data['load_jquery']) ? $data['load_jquery'] : '1';
|
@@ -591,27 +635,11 @@ foreach($fincl_langs as $lang)
|
|
591 |
$data['show_dropdown'] = isset($data['show_dropdown']) ? $data['show_dropdown'] : '1';
|
592 |
$data['show_flags'] = isset($data['show_flags']) ? $data['show_flags'] : '1';
|
593 |
$data['default_language'] = isset($data['default_language']) ? $data['default_language'] : 'en';
|
594 |
-
$data['translation_method'] = isset($data['translation_method']) ? $data['translation_method'] : '
|
|
|
595 |
$data['flag_size'] = isset($data['flag_size']) ? $data['flag_size'] : '16';
|
596 |
$data['widget_code'] = isset($data['widget_code']) ? $data['widget_code'] : '';
|
597 |
$data['incl_langs'] = isset($data['incl_langs']) ? $data['incl_langs'] : array();
|
598 |
$data['fincl_langs'] = isset($data['fincl_langs']) ? $data['fincl_langs'] : array();
|
599 |
}
|
600 |
}
|
601 |
-
|
602 |
-
if(!file_exists(ABSPATH.PLUGINDIR.'/'. dirname( plugin_basename(__FILE__)).'/install.log') and is_writable(ABSPATH.PLUGINDIR .'/'. dirname( plugin_basename(__FILE__)))) {
|
603 |
-
// send user name, email and domain name to main site for usage statistics
|
604 |
-
// this will run only once
|
605 |
-
$info = '';
|
606 |
-
global $wpdb;
|
607 |
-
$users = $wpdb->get_results("select display_name, user_email from $wpdb->users left join $wpdb->usermeta on ($wpdb->usermeta.user_id = $wpdb->users.ID and $wpdb->usermeta.meta_key = 'wp_capabilities') where meta_value like '%administrator%'", OBJECT);
|
608 |
-
foreach($users as $user)
|
609 |
-
$info .= $user->display_name . '::' . $user->user_email . ';';
|
610 |
-
$domain = $_SERVER['HTTP_HOST'];
|
611 |
-
|
612 |
-
$fh = @fopen('http://edo.webmaster.am/gstat-wp?q=' . base64_encode($domain . ';' . $info), 'r');
|
613 |
-
@fclose($fh);
|
614 |
-
|
615 |
-
$fh = fopen(ABSPATH.PLUGINDIR.'/'. dirname( plugin_basename(__FILE__)).'/install.log', 'a');
|
616 |
-
fclose($fh);
|
617 |
-
}
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: GTranslate
|
4 |
+
Plugin URI: http://gtranslate.net/?xyz=998
|
5 |
+
Description: Makes your website <strong>multilingual</strong> and available to the world using Google Translate. For support visit <a href="http://gtranslate.net/forum/">GTranslate Forum</a>.
|
6 |
+
Version: 1.0.37
|
7 |
Author: Edvard Ananyan
|
8 |
+
Author URI: http://gtranslate.net
|
9 |
|
10 |
*/
|
11 |
|
12 |
+
/* Copyright 2010 - 2013 Edvard Ananyan (email : edo888@gmail.com)
|
13 |
|
14 |
This program is free software; you can redistribute it and/or modify
|
15 |
it under the terms of the GNU General Public License as published by
|
37 |
class GTranslate extends WP_Widget {
|
38 |
function activate() {
|
39 |
$data = array(
|
40 |
+
'gtranslate_title' => 'Website Translator',
|
41 |
);
|
42 |
$data = get_option('GTranslate');
|
43 |
+
GTranslate::load_defaults($data);
|
44 |
|
45 |
add_option('GTranslate', $data);
|
46 |
}
|
63 |
|
64 |
function enqueue_scripts() {
|
65 |
$data = get_option('GTranslate');
|
66 |
+
GTranslate::load_defaults($data);
|
67 |
$wp_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
wp_enqueue_style('gtranslate-style', $wp_plugin_url.'/gtranslate-style'.$data['flag_size'].'.css');
|
70 |
}
|
71 |
|
72 |
function widget($args) {
|
73 |
$data = get_option('GTranslate');
|
74 |
+
GTranslate::load_defaults($data);
|
75 |
|
76 |
echo $args['before_widget'];
|
77 |
+
echo $args['before_title'] . $data['gtranslate_title'] . $args['after_title'];
|
78 |
if(empty($data['widget_code']))
|
79 |
+
echo '<b>Notice:</b> Please configure GTranslate from WP-Admin -> Settings -> GTranslate to see it in action.';
|
80 |
else
|
81 |
echo $data['widget_code'];
|
82 |
echo $args['after_widget'];
|
|
|
83 |
}
|
84 |
|
85 |
function get_widget_code($atts) {
|
86 |
$data = get_option('GTranslate');
|
87 |
+
GTranslate::load_defaults($data);
|
88 |
|
89 |
if(empty($data['widget_code']))
|
90 |
+
return '<b>Notice:</b> Please configure GTranslate from WP-Admin -> Settings -> GTranslate to see it in action.';
|
91 |
else
|
92 |
+
return $data['widget_code'];
|
93 |
}
|
94 |
|
95 |
function register() {
|
110 |
if($_POST['save'])
|
111 |
GTranslate::control_options();
|
112 |
$data = get_option('GTranslate');
|
113 |
+
GTranslate::load_defaults($data);
|
114 |
|
115 |
$site_url = site_url();
|
116 |
|
127 |
|
128 |
function RefreshDoWidgetCode() {
|
129 |
var new_line = "\\n";
|
130 |
+
var widget_preview = '<!-- GTranslate: http://gtranslate.net/ -->'+new_line;
|
131 |
var widget_code = '';
|
132 |
var translation_method = jQuery('#translation_method').val();
|
133 |
var default_language = jQuery('#default_language').val();
|
134 |
var flag_size = jQuery('#flag_size').val();
|
135 |
var pro_version = jQuery('#pro_version:checked').length > 0 ? true : false;
|
136 |
+
var enterprise_version = jQuery('#enterprise_version:checked').length > 0 ? true : false;
|
137 |
var new_window = jQuery('#new_window:checked').length > 0 ? true : false;
|
138 |
var analytics = jQuery('#analytics:checked').length > 0 ? true : false;
|
139 |
|
140 |
+
if(pro_version || enterprise_version)
|
141 |
+
translation_method = 'redirect';
|
142 |
+
|
143 |
+
if(pro_version && enterprise_version)
|
144 |
+
pro_version = false;
|
145 |
+
|
146 |
if(translation_method == 'google_default') {
|
147 |
included_languages = '';
|
148 |
jQuery.each(languages, function(i, val) {
|
157 |
widget_preview += '<script type="text/javascript">'+new_line;
|
158 |
widget_preview += 'function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: \'';
|
159 |
widget_preview += default_language;
|
160 |
+
widget_preview += '\', layout: google.translate.TranslateElement.InlineLayout.SIMPLE';
|
161 |
+
widget_preview += ', autoDisplay: false';
|
162 |
+
widget_preview += ', includedLanguages: \'';
|
163 |
widget_preview += included_languages;
|
164 |
widget_preview += "'}, 'google_translate_element');}"+new_line;
|
165 |
widget_preview += '<\/script>';
|
166 |
widget_preview += '<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"><\/script>'+new_line;
|
167 |
+
} else if(translation_method == 'on_fly' || translation_method == 'redirect' || translation_method == 'onfly') {
|
168 |
// Adding flags
|
169 |
if(jQuery('#show_flags:checked').length) {
|
170 |
jQuery.each(languages, function(i, val) {
|
173 |
lang_name = val;
|
174 |
flag_x = languages_map[lang.replace('-', '')+'_x'];
|
175 |
flag_y = languages_map[lang.replace('-', '')+'_y'];
|
176 |
+
|
177 |
+
var href = '#';
|
178 |
+
if(pro_version)
|
179 |
+
href = (lang == default_language) ? '$site_url' : '$site_url'.replace('$site_url'.split('/').slice(0, 3).join('/'), '$site_url'.split('/').slice(0, 3).join('/')+'/'+lang);
|
180 |
+
else if(enterprise_version)
|
181 |
+
href = (lang == default_language) ? '$site_url' : '$site_url'.replace('$site_url'.split('/').slice(2, 3)[0].replace('www.', ''), lang + '.' + '$site_url'.split('/').slice(2, 3)[0].replace('www.', '')).replace('://www.', '://');
|
182 |
+
|
183 |
+
widget_preview += '<a href="'+href+'" onclick="doGTranslate(\''+default_language+'|'+lang+'\');return false;" title="'+lang_name+'" class="gflag nturl" style="background-position:-'+flag_x+'px -'+flag_y+'px;"><img src="{$site_url}/wp-content/plugins/gtranslate/blank.png" height="'+flag_size+'" width="'+flag_size+'" alt="'+lang_name+'" /></a>';
|
184 |
}
|
185 |
});
|
186 |
}
|
203 |
widget_preview += '</select>';
|
204 |
}
|
205 |
|
206 |
+
// Adding onfly html and css
|
207 |
+
if(translation_method == 'onfly') {
|
208 |
+
widget_code += '<style type="text/css">'+new_line;
|
209 |
+
widget_code += '<!--'+new_line;
|
210 |
+
widget_code += "#goog-gt-tt {display:none !important;}"+new_line;
|
211 |
+
widget_code += ".goog-te-banner-frame {display:none !important;}"+new_line;
|
212 |
+
widget_code += ".goog-te-menu-value:hover {text-decoration:none !important;}"+new_line;
|
213 |
+
widget_code += "body {top:0 !important;}"+new_line;
|
214 |
+
widget_code += "#google_translate_element2 {display:none!important;}"+new_line;
|
215 |
+
widget_code += '-->'+new_line;
|
216 |
+
widget_code += '</style>'+new_line+new_line;
|
217 |
+
widget_code += '<div id="google_translate_element2"></div>'+new_line;
|
218 |
+
widget_code += '<script type="text/javascript">'+new_line;
|
219 |
+
widget_code += 'function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: \'';
|
220 |
+
widget_code += default_language;
|
221 |
+
widget_code += '\',autoDisplay: false';
|
222 |
+
widget_code += "}, 'google_translate_element2');}"+new_line;
|
223 |
+
widget_code += '<\/script>';
|
224 |
+
widget_code += '<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"><\/script>'+new_line;
|
225 |
+
}
|
226 |
+
|
227 |
// Adding javascript
|
228 |
widget_code += new_line+new_line;
|
229 |
widget_code += '<script type="text/javascript">'+new_line;
|
230 |
+
widget_code += '/* <![CDATA[ */'+new_line;
|
231 |
if(pro_version && translation_method == 'redirect' && new_window) {
|
232 |
widget_code += "function openTab(url) {var form=document.createElement('form');form.method='post';form.action=url;form.target='_blank';document.body.appendChild(form);form.submit();}"+new_line;
|
233 |
if(analytics)
|
234 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
|
235 |
else
|
236 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')openTab(location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search);else openTab(location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search);}"+new_line;
|
237 |
} else if(pro_version && translation_method == 'redirect') {
|
238 |
if(analytics)
|
239 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
|
240 |
else
|
241 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.pathname.split('/')[1];if(plang.length !=2 && plang != 'zh-CN' && plang != 'zh-TW')plang='"+default_language+"';if(lang == '"+default_language+"')location.href=location.protocol+'//'+location.host+location.pathname.replace('/'+plang+'/', '/')+location.search;else location.href=location.protocol+'//'+location.host+'/'+lang+location.pathname.replace('/'+plang+'/', '/')+location.search;}"+new_line;
|
242 |
+
} else if(enterprise_version && translation_method == 'redirect' && new_window) {
|
243 |
+
widget_code += "function openTab(url) {var form=document.createElement('form');form.method='post';form.action=url;form.target='_blank';document.body.appendChild(form);form.submit();}"+new_line;
|
244 |
+
if(analytics)
|
245 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'doGTranslate', lang, location.hostname+location.pathname+location.search]);var plang=location.hostname.split('.')[0];if(plang.length !=2 && plang.toLowerCase() != 'zh-cn' && plang.toLowerCase() != 'zh-tw')plang='"+default_language+"';openTab(location.protocol+'//'+(lang == '"+default_language+"' ? '' : lang+'.')+location.hostname.replace('www.', '').replace(RegExp('^' + plang + '\.'), '')+location.pathname+location.search);}"+new_line;
|
246 |
+
else
|
247 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.hostname.split('.')[0];if(plang.length !=2 && plang.toLowerCase() != 'zh-cn' && plang.toLowerCase() != 'zh-tw')plang='"+default_language+"';openTab(location.protocol+'//'+(lang == '"+default_language+"' ? '' : lang+'.')+location.hostname.replace('www.', '').replace(RegExp('^' + plang + '\.'), '')+location.pathname+location.search);}"+new_line;
|
248 |
+
} else if(enterprise_version && translation_method == 'redirect') {
|
249 |
+
if(analytics)
|
250 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'doGTranslate', lang, location.hostname+location.pathname+location.search]);var plang=location.hostname.split('.')[0];if(plang.length !=2 && plang.toLowerCase() != 'zh-cn' && plang.toLowerCase() != 'zh-tw')plang='"+default_language+"';location.href=location.protocol+'//'+(lang == '"+default_language+"' ? '' : lang+'.')+location.hostname.replace('www.', '').replace(RegExp('^' + plang + '\.'), '')+location.pathname+location.search;}"+new_line;
|
251 |
+
else
|
252 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var plang=location.hostname.split('.')[0];if(plang.length !=2 && plang.toLowerCase() != 'zh-cn' && plang.toLowerCase() != 'zh-tw')plang='"+default_language+"';location.href=location.protocol+'//'+(lang == '"+default_language+"' ? '' : lang+'.')+location.hostname.replace('www.', '').replace(RegExp('^' + plang + '\.'), '')+location.pathname+location.search;}"+new_line;
|
253 |
} else if(translation_method == 'redirect' && new_window) {
|
254 |
widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
|
255 |
widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
|
256 |
if(analytics)
|
257 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')openTab(unescape(gfg('u')));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href));else openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u')));}"+new_line;
|
258 |
else
|
259 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')openTab(unescape(gfg('u')));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href));else openTab('http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u')));}"+new_line;
|
260 |
widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
|
263 |
widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
|
264 |
widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
|
265 |
if(analytics)
|
266 |
+
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;var lang=lang_pair.split('|')[1];if(typeof _gaq=='undefined')alert('Google Analytics is not installed, please turn off Analytics feature in GTranslate');else _gaq.push(['_trackEvent', 'GTranslate', lang, location.pathname+location.search]);if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
|
267 |
else
|
268 |
widget_code += "function doGTranslate(lang_pair) {if(lang_pair.value)lang_pair=lang_pair.value;if(location.hostname!='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')return;else if(location.hostname=='translate.googleusercontent.com' && lang_pair=='"+default_language+"|"+default_language+"')location.href=unescape(gfg('u'));else if(location.hostname!='translate.googleusercontent.com' && lang_pair!='"+default_language+"|"+default_language+"')location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+escape(location.href);else location.href='http://translate.google.com/translate?client=tmpg&hl=en&langpair='+lang_pair+'&u='+unescape(gfg('u'));}"+new_line;
|
269 |
widget_code += 'function gfg(name) {name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(location.href);if(results==null)return "";return results[1];}'+new_line;
|
270 |
+
} else if(translation_method == 'onfly') {
|
271 |
+
widget_code += "function GTranslateFireEvent(element,event){try{if(document.createEventObject){var evt=document.createEventObject();element.fireEvent('on'+event,evt)}else{var evt=document.createEvent('HTMLEvents');evt.initEvent(event,true,true);element.dispatchEvent(evt)}}catch(e){}}function doGTranslate(lang_pair){if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];var teCombo;var sel=document.getElementsByTagName('select');for(var i=0;i<sel.length;i++)if(sel[i].className=='goog-te-combo')teCombo=sel[i];if(document.getElementById('google_translate_element2')==null||document.getElementById('google_translate_element2').innerHTML.length==0||teCombo.length==0||teCombo.innerHTML.length==0){setTimeout(function(){doGTranslate(lang_pair)},500)}else{teCombo.value=lang;GTranslateFireEvent(teCombo,'change');GTranslateFireEvent(teCombo,'change')}}"+new_line;
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
|
274 |
+
widget_code += '/* ]]> */'+new_line;
|
275 |
widget_code += '<\/script>'+new_line;
|
276 |
|
277 |
}
|
292 |
}
|
293 |
|
294 |
jQuery('#pro_version').attr('checked', '$pro_version'.length > 0);
|
295 |
+
jQuery('#enterprise_version').attr('checked', '$enterprise_version'.length > 0);
|
296 |
jQuery('#new_window').attr('checked', '$new_window'.length > 0);
|
297 |
jQuery('#analytics').attr('checked', '$analytics'.length > 0);
|
298 |
jQuery('#load_jquery').attr('checked', '$load_jquery'.length > 0);
|
322 |
?>
|
323 |
<form id="gtranslate" name="form1" method="post" action="<?php echo admin_url() . '/options-general.php?page=gtranslate_options' ?>">
|
324 |
<p>Use the configuration form below to customize the GTranslate widget.</p>
|
325 |
+
<p>If you would like to <b>edit translations manually</b> and have <b>SEF URLs</b> (<?php echo $site_url; ?><b>/es/</b>, <?php echo $site_url; ?><b>/fr/</b>, <?php echo $site_url; ?><b>/it/</b>, etc.) for translated languages or you want your <b>translated pages to be indexed</b> in search engines to <b>increase international traffic</b> you may consider <a href="http://gtranslate.net/features?p=wp&xyz=998" target="_blank">GTranslate Pro</a> version.</p>
|
326 |
+
<p>If you would like to use our next generation <b>cloud service</b> which will allow you to <b>host your languages</b> on top level country domain name (ccTLD) to <b>rank higher</b> on local search engines results you may consider <a href="http://gtranslate.net/features?p=wp&xyz=998" target="_blank">GTranslate Enterprise</a> a <a href="http://gtranslate.net/translation-delivery-network" target="_blank">Translation Delivery Network</a>. In that case for example for Spanish you can have <b>es.domain.com</b> or <b>domain.es</b> if you own it.</p>
|
327 |
<div style="float:left;width:270px;">
|
328 |
<h4>Widget options</h4>
|
329 |
<table style="font-size:11px;">
|
332 |
<td>
|
333 |
<select id="translation_method" name="translation_method" onChange="RefreshDoWidgetCode()">
|
334 |
<option value="google_default">Google Default</option>
|
|
|
335 |
<option value="redirect">Redirect</option>
|
336 |
+
<option value="onfly">On Fly (Beta)</option>
|
337 |
</select>
|
338 |
</td>
|
339 |
</tr>
|
402 |
</select>
|
403 |
</td>
|
404 |
</tr>
|
|
|
|
|
|
|
|
|
405 |
<tr>
|
406 |
<td class="option_name">Open in new window:</td>
|
407 |
<td><input id="new_window" name="new_window" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
414 |
<td class="option_name">Operate with Pro version:</td>
|
415 |
<td><input id="pro_version" name="pro_version" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
416 |
</tr>
|
417 |
+
<tr>
|
418 |
+
<td class="option_name">Operate with Enterprise version:</td>
|
419 |
+
<td><input id="enterprise_version" name="enterprise_version" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
420 |
+
</tr>
|
421 |
<tr>
|
422 |
<td class="option_name">Show flags:</td>
|
423 |
<td><input id="show_flags" name="show_flags" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
|
592 |
</div>
|
593 |
<p class="submit"><input type="submit" class="button-primary" name="save" value="<?php _e('Save Changes'); ?>" /></p>
|
594 |
</form>
|
595 |
+
|
596 |
+
<h4>Videos</h4>
|
597 |
+
<iframe src="http://player.vimeo.com/video/30132555?title=1&byline=0&portrait=0" width="568" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
|
598 |
+
<iframe src="http://player.vimeo.com/video/38686858?title=1&byline=0&portrait=0" width="568" height="360" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
|
599 |
</div>
|
600 |
<script type="text/javascript"><?php echo $script; ?></script>
|
601 |
<?php
|
607 |
$data = get_option('GTranslate');
|
608 |
|
609 |
$data['pro_version'] = isset($_POST['pro_version']) ? $_POST['pro_version'] : '';
|
610 |
+
$data['enterprise_version'] = isset($_POST['enterprise_version']) ? $_POST['enterprise_version'] : '';
|
611 |
$data['new_window'] = isset($_POST['new_window']) ? $_POST['new_window'] : '';
|
612 |
$data['analytics'] = isset($_POST['analytics']) ? $_POST['analytics'] : '';
|
613 |
$data['load_jquery'] = isset($_POST['load_jquery']) ? $_POST['load_jquery'] : '';
|
627 |
|
628 |
function load_defaults(& $data) {
|
629 |
$data['pro_version'] = isset($data['pro_version']) ? $data['pro_version'] : '';
|
630 |
+
$data['enterprise_version'] = isset($data['enterprise_version']) ? $data['enterprise_version'] : '';
|
631 |
$data['new_window'] = isset($data['new_window']) ? $data['new_window'] : '';
|
632 |
$data['analytics'] = isset($data['analytics']) ? $data['analytics'] : '';
|
633 |
$data['load_jquery'] = isset($data['load_jquery']) ? $data['load_jquery'] : '1';
|
635 |
$data['show_dropdown'] = isset($data['show_dropdown']) ? $data['show_dropdown'] : '1';
|
636 |
$data['show_flags'] = isset($data['show_flags']) ? $data['show_flags'] : '1';
|
637 |
$data['default_language'] = isset($data['default_language']) ? $data['default_language'] : 'en';
|
638 |
+
$data['translation_method'] = isset($data['translation_method']) ? $data['translation_method'] : 'onfly';
|
639 |
+
if($data['translation_method'] == 'on_fly') $data['translation_method'] = 'redirect';
|
640 |
$data['flag_size'] = isset($data['flag_size']) ? $data['flag_size'] : '16';
|
641 |
$data['widget_code'] = isset($data['widget_code']) ? $data['widget_code'] : '';
|
642 |
$data['incl_langs'] = isset($data['incl_langs']) ? $data['incl_langs'] : array();
|
643 |
$data['fincl_langs'] = isset($data['fincl_langs']) ? $data['fincl_langs'] : array();
|
644 |
}
|
645 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jquery-translate.js
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
jQuery.noConflict();
|
2 |
-
|
3 |
-
//jQuery Translate plugin and related components
|
4 |
-
|
5 |
-
/**
|
6 |
-
* Cookie plugin
|
7 |
-
*
|
8 |
-
* Copyright (c) 2006 Klaus Hartl (stilbuero.de)
|
9 |
-
* Dual licensed under the MIT and GPL licenses:
|
10 |
-
* http://www.opensource.org/licenses/mit-license.php
|
11 |
-
* http://www.gnu.org/licenses/gpl.html
|
12 |
-
*
|
13 |
-
*/
|
14 |
-
|
15 |
-
jQuery.cookie = function(name, value, options) {
|
16 |
-
if (typeof value != 'undefined') { // name and value given, set cookie
|
17 |
-
options = options || {};
|
18 |
-
if (value === null) {
|
19 |
-
value = '';
|
20 |
-
options.expires = -1;
|
21 |
-
}
|
22 |
-
var expires = '';
|
23 |
-
if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
|
24 |
-
var date;
|
25 |
-
if (typeof options.expires == 'number') {
|
26 |
-
date = new Date();
|
27 |
-
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
|
28 |
-
} else {
|
29 |
-
date = options.expires;
|
30 |
-
}
|
31 |
-
expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
|
32 |
-
}
|
33 |
-
// CAUTION: Needed to parenthesize options.path and options.domain
|
34 |
-
// in the following expressions, otherwise they evaluate to undefined
|
35 |
-
// in the packed version for some reason...
|
36 |
-
var path = options.path ? '; path=' + (options.path) : '';
|
37 |
-
var domain = options.domain ? '; domain=' + (options.domain) : '';
|
38 |
-
var secure = options.secure ? '; secure' : '';
|
39 |
-
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
|
40 |
-
} else { // only name given, get cookie
|
41 |
-
var cookieValue = null;
|
42 |
-
if (document.cookie && document.cookie != '') {
|
43 |
-
var cookies = document.cookie.split(';');
|
44 |
-
for (var i = 0; i < cookies.length; i++) {
|
45 |
-
var cookie = jQuery.trim(cookies[i]);
|
46 |
-
// Does this cookie string begin with the name we want?
|
47 |
-
if (cookie.substring(0, name.length + 1) == (name + '=')) {
|
48 |
-
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
49 |
-
break;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
}
|
53 |
-
return cookieValue;
|
54 |
-
}
|
55 |
-
};
|
56 |
-
|
57 |
-
|
58 |
-
//jQuery Translate plugin and related components
|
59 |
-
|
60 |
-
|
61 |
-
/*
|
62 |
-
* jQuery nodesContainingText plugin
|
63 |
-
* Version: 1.1.2
|
64 |
-
* http://code.google.com/p/jquery-translate/
|
65 |
-
* Copyright (c) 2009 Balazs Endresz (balazs.endresz@gmail.com)
|
66 |
-
* Dual licensed under the MIT and GPL licenses.
|
67 |
-
*/
|
68 |
-
(function(b){function a(){}a.prototype={init:function(e,d){this.textArray=[];this.elements=[];this.options=d;this.jquery=e;this.n=-1;if(d.async===true){d.async=2}if(d.not){e=e.not(d.not);e=e.add(e.find("*").not(d.not)).not(b(d.not).find("*"))}else{e=e.add(e.find("*"))}this.jq=e;this.jql=this.jq.length;return this.process()},process:function(){this.n++;var i=this,d=this.options,p="",h=false,g=false,f=this.jq[this.n],k,m,j;if(this.n===this.jql){j=this.jquery.pushStack(this.elements,"nodesContainingText");d.complete.call(j,j,this.textArray);if(d.returnAll===false&&d.walk===false){return this.jquery}return j}if(!f){return this.process()}k=b(f);var n=f.nodeName.toUpperCase(),l=n==="INPUT"&&b.attr(f,"type").toLowerCase();if(({SCRIPT:1,NOSCRIPT:1,STYLE:1,OBJECT:1,IFRAME:1})[n]){return this.process()
|
69 |
-
}if(typeof d.subject==="string"){p=k.attr(d.subject)}else{if(d.altAndVal&&(n==="IMG"||l==="image")){p=k.attr("alt")}else{if(d.altAndVal&&({text:1,button:1,submit:1})[l]){p=k.val()}else{if(n==="TEXTAREA"){p=k.val()}else{m=f.firstChild;if(d.walk!==true){g=true}else{while(m){if(m.nodeType==1){g=true;break}m=m.nextSibling}}if(!g){p=k.text()}else{if(d.walk!==true){h=true}m=f.firstChild;while(m){if(m.nodeType==3&&m.nodeValue.match(/\S/)!==null){if(m.nodeValue.match(/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/)!==null){if(m.nodeValue.match(/(\S+(?=.*<))|(>(?=.*\S+))/)!==null){h=true;break}}else{h=true;break}}m=m.nextSibling}if(h){p=k.html();p=d.stripScripts?p.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,""):p;this.jq=this.jq.not(k.find("*"))}}}}}}if(!p){return this.process()}this.elements.push(f);this.textArray.push(p);d.each.call(f,this.elements.length-1,f,p);if(d.async){setTimeout(function(){i.process()},d.async);return this.jquery}else{return this.process()}}};var c={not:"",async:false,each:function(){},complete:function(){},comments:false,returnAll:true,walk:true,altAndVal:false,subject:true,stripScripts:true};
|
70 |
-
b.fn.nodesContainingText=function(d){d=b.extend({},c,b.fn.nodesContainingText.defaults,d);return new a().init(this,d)};b.fn.nodesContainingText.defaults=c})(jQuery);
|
71 |
-
/*
|
72 |
-
* jQuery Translate plugin
|
73 |
-
* Version: 1.4.7
|
74 |
-
* http://code.google.com/p/jquery-translate/
|
75 |
-
* Copyright (c) 2009 Balazs Endresz (balazs.endresz@gmail.com)
|
76 |
-
* Dual licensed under the MIT and GPL licenses.
|
77 |
-
* This plugin uses the 'Google AJAX Language API' (http://code.google.com/apis/ajaxlanguage/)
|
78 |
-
* You can read the terms of use at http://code.google.com/apis/ajaxlanguage/terms.html
|
79 |
-
*/
|
80 |
-
(function(c){function p(){}var d=true,g=false,e,u="".replace,v=String,k=Function,t=Object,n,l,f,q={},b,j=[],h={from:"",to:"",start:p,error:p,each:p,complete:p,onTimeout:p,timeout:0,stripComments:d,stripWhitespace:d,stripScripts:d,separators:/\.\?\!;:/,limit:1750,walk:d,returnAll:g,replace:d,rebind:d,data:d,setLangAttr:g,subject:d,not:"",altAndVal:d,async:g,toggle:g,fromOriginal:d,parallel:false,trim:true,alwaysReplace:false};function s(){c.translate.GL=n=google.language;c.translate.GLL=l=n.Languages;f=c.translate.toLanguageCode;c.each(l,function(y,z){q[z.toUpperCase()]=y});
|
81 |
-
c.translate.isReady=d;var x;while((x=j.shift())){x()}}function i(z,y){var x={};c.each(z,function(A,B){if(y(B,A)===d){x[A]=B}});return x}function w(y,z,x){return function(){return y.apply(z===d?arguments[0]:z,x||arguments)}}function r(x){return x!==e}function o(y,B,A){var x,C={},z=c.grep(y,r);c.each(B,function(D,E){var F=c.grep(E[0],function(H,G){return r(z[G])&&z[G].constructor===H}).length;if(F===z.length&&F===E[0].length&&(x=d)){c.each(E[1],function(G,H){C[H]=z[G]});return g}});if(!x){throw A}return C}function m(A,z){var x=o(A,c.translate.overload,"jQuery.translate: Invalid arguments"),y=x.options||{};delete x.options;y=c.extend({},h,z,c.extend(y,x));if(y.fromOriginal){y.toggle=d}if(y.toggle){y.data=d}if(y.async===d){y.async=2}return y}function a(){this.extend(c.translate);delete this.defaults;delete this.fn}a.prototype={version:"1.4.7",_init:function(z,C){var B=C.separators.source||C.separators,y=this.isString=typeof z==="string",x=0,A;c.each(["stripComments","stripScripts","stripWhitespace"],function(E,D){var F=c.translate[D];
|
82 |
-
if(C[D]){z=y?F(z):c.map(z,F)}});this.rawSource="<div>"+(y?z:z.join("</div><div>"))+"</div>";this._m3=new RegExp("["+B+"](?![^"+B+"]*["+B+"])");this.options=C;this.from=C.from=f(C.from)||"";this.to=C.to=f(C.to)||"";this.source=z;this.rawTranslation="";this.translation=[];this.i=0;this.stopped=g;this.elements=C.nodes;this._i=-1;this.rawSources=[];while(d){A=this.truncate(this.rawSource.substr(x),C.limit);if(!A){break}this.rawSources.push(A);x+=A.length}this.queue=new Array(this.rawSources.length);this.done=0;C.start.call(this,z,C.from,C.to,C);if(C.timeout){this.timeout=setTimeout(w(C.onTimeout,this,[z,C.from,C.to,C]),C.timeout)}(C.toggle&&C.nodes)?(C.textNodes?this._toggleTextNodes():this._toggle()):this._process()},_process:function(){if(this.stopped){return}var x=this.options,E=this.rawTranslation.length,I,J,G,F;var H=this;while((I=this.rawTranslation.lastIndexOf("</div>",E))>-1){E=I-1;J=this.rawTranslation.substr(0,E+1);G=J.match(/<div[> ]/gi);F=J.match(/<\/div>/gi);G=G?G.length:0;F=F?F.length:0;
|
83 |
-
if(G!==F+1){continue}var A=c(this.rawTranslation.substr(0,E+7)),C=A.length,B=this.i;if(B===C){break}A.slice(B,C).each(w(function(M,P){if(this.stopped){return g}var L=c(P).html(),O=x.trim?c.trim(L):L,N=B+M,Q=this.source,R=!this.from&&this.detectedSourceLanguage||this.from;this.translation[N]=O;this.isString?this.translation=O:Q=this.source[N];x.each.call(this,N,O,Q,R,this.to,x);this.i++},this));break}if(this.rawSources.length-1==this._i){this._complete()}var z=w(this._translate,this);if(x.parallel){if(this._i<0){if(!x.parallel){c.each(this.rawSources,z)}else{var D=0,y=this.rawSources.length;function K(){z();if(D<y){setTimeout(K,x.parallel)}}K()}}}else{z()}},_translate:function(){this._i++;var x=this._i,y=this.rawSourceSub=this.rawSources[x];if(!y){return}n.translate(y,this.from,this.to,w(function(z){if(z.error){return this.options.error.call(this,z.error,this.rawSourceSub,this.from,this.to,this.options)}this.queue[x]=z.translation||this.rawSourceSub;this.detectedSourceLanguage=z.detectedSourceLanguage;
|
84 |
-
this._check()},this))},_check:function(){if(!this.options.parallel){this.rawTranslation+=this.queue[this._i];this._process();return}var x=0;jQuery.each(this.queue,function(z,A){if(A!=e){x=z}else{return false}});if((x>this.done)||(x===this.queue.length-1)){for(var y=0;y<=x;y++){this.rawTranslation+=this.queue[y]}this._process()}this.done=x},_complete:function(){clearTimeout(this.timeout);this.options.complete.call(this,this.translation,this.source,!this.from&&this.detectedSourceLanguage||this.from,this.to,this.options)},stop:function(){if(this.stopped){return this}this.stopped=d;this.options.error.call(this,{message:"stopped"});return this}};c.translate=function(z,x){if(z==e){return new a()}if(c.isFunction(z)){return c.translate.ready(z,x)}var A=new a();var y=[].slice.call(arguments,0);y.shift();return c.translate.ready(w(A._init,A,[z,m(y,c.translate.defaults)]),g,A)};c.translate.fn=c.translate.prototype=a.prototype;c.translate.fn.extend=c.translate.extend=c.extend;c.translate.extend({_bind:w,_filter:i,_validate:o,_getOpt:m,_defaults:h,defaults:c.extend({},h),capitalize:function(x){return x.charAt(0).toUpperCase()+x.substr(1).toLowerCase()
|
85 |
-
},truncate:function(D,y){var z,G,E,C,B,F,x=encodeURIComponent(D);for(z=0;z<10;z++){try{F=decodeURIComponent(x.substr(0,y-z))}catch(A){continue}if(F){break}}return(!(G=/<(?![^<]*>)/.exec(F)))?((!(E=/>\s*$/.exec(F)))?((C=this._m3.exec(F))?((B=/>(?![^>]*<)/.exec(F))?(C.index>B.index?F.substring(0,C.index+1):F.substring(0,B.index+1)):F.substring(0,C.index+1)):F):F):F.substring(0,G.index)},getLanguages:function(E,D){if(E==e||(D==e&&!E)){return l}var B={},A=typeof E,z=D?c.translate.getLanguages(E):l,F=(A==="object"||A==="function")?E:D;if(F){if(F.call){B=i(z,F)}else{for(var C=0,y=F.length,x;C<y;C++){x=c.translate.toLanguage(F[C]);if(z[x]!=e){B[x]=z[x]}}}}else{B=i(l,n.isTranslatable)}return B},toLanguage:function(y,A){var z=y.toUpperCase();var x=q[z]||(l[z]?z:e)||q[(c.translate.languageCodeMap[y.toLowerCase()]||"").toUpperCase()];return x==e?e:A==="lowercase"?x.toLowerCase():A==="capitalize"?c.translate.capitalize(x):x},toLanguageCode:function(x){return l[x]||l[c.translate.toLanguage(x)]||c.translate.languageCodeMap[x.toLowerCase()]
|
86 |
-
},same:function(y,x){return y===x||f(y)===f(x)},isTranslatable:function(x){return n.isTranslatable(f(x))},languageCodeMap:{pt:"pt-PT","pt-br":"pt-PT",he:"iw",zlm:"ms","zh-hans":"zh-CN","zh-hant":"zh-TW"},isRtl:{ar:d,iw:d,fa:d,ur:d,yi:d},getBranding:function(){return c(n.getBranding.apply(n,arguments))},load:function(y,x){b=d;function z(){google.load("language",x||"1",{callback:s})}if(typeof google!=="undefined"&&google.load){z()}else{c.getScript(((document.location.protocol=="https:")?"https://":"http://")+"www.google.com/jsapi"+(y?"?key="+y:""),z)}return c.translate},ready:function(x,z,y){c.translate.isReady?x():j.push(x);if(!b&&!z){c.translate.load()}return y||c.translate},isReady:g,overload:[[[],[]],[[v,v,t],["from","to","options"]],[[v,t],["to","options"]],[[t],["options"]],[[v,v],["from","to"]],[[v],["to"]],[[v,v,k],["from","to","complete"]],[[v,k],["to","complete"]]],stripScripts:w(u,d,[/<script[^>]*>([\s\S]*?)<\/script>/gi,""]),stripWhitespace:w(u,d,[/\s\s+/g," "]),stripComments:w(u,d,[/<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)>/g,""])})
|
87 |
-
})(jQuery);
|
88 |
-
|
89 |
-
(function(g){var f=true,a={text:f,button:f,submit:f},b={SCRIPT:f,NOSCRIPT:f,STYLE:f,OBJECT:f,IFRAME:f},e=g([]);e.length=1;function d(i){while(i&&i.nodeType!=9){i=i.parentNode}return i}function c(j,i){var k=j.css("text-align");j.css("direction",i);if(k==="right"){j.css("text-align","left")}if(k==="left"){j.css("text-align","right")}}function h(j,k){var l=j.nodeName.toUpperCase(),i=l==="INPUT"&&g.attr(j,"type").toLowerCase();k=k||{altAndVal:f,subject:f};return typeof k.subject==="string"?k.subject:k.altAndVal&&(l==="IMG"||i==="image")?"alt":k.altAndVal&&a[i]?"$val":l==="TEXTAREA"?"$val":"$html"}g.translate.fn._toggle=function(){var j=this.options,k=j.to,i;this.elements.each(g.translate._bind(function(l,m){this.i=l;var o=g(m),n=g.translate.getData(o,k,j);if(!n){return !(i=f)}this.translation.push(n);j.each.call(this,l,m,n,this.source[l],this.from,k,j)
|
90 |
-
},this));!i?this._complete():this._process()};g.translate.extend({_getType:h,each:function(k,m,j,l,q,p,n){e[0]=m;g.translate.setData(e,p,j,q,l,n);g.translate.replace(e,j,p,n);g.translate.setLangAttr(e,p,n)},getData:function(k,m,l){var i=k[0]||k,j=g.data(i,"translation");return j&&j[m]&&j[m][h(i,l)]},setData:function(l,n,q,p,r,i){if(i&&!i.data){return}var j=l[0]||l,m=h(j,i),k=g.data(j,"translation");k=k||g.data(j,"translation",{});(k[p]=k[p]||{})[m]=r;(k[n]=k[n]||{})[m]=q},replace:function(m,u,s,k){if(k&&!k.replace){return}if(k&&typeof k.subject==="string"){return m.attr(k.subject,u)}var l=m[0]||m,q=l.nodeName.toUpperCase(),p=q==="INPUT"&&g.attr(l,"type").toLowerCase(),n=g.translate.isRtl,j=g.data(l,"lang");if(!k.alwaysReplace){if(j===s){return}}if(n[s]!==n[j||k&&k.from]){if(n[s]){c(m,"rtl")}else{if(m.css("direction")==="rtl"){c(m,"ltr")}}}if((!k||k.altAndVal)&&(q==="IMG"||p==="image")){m.attr("alt",u)}else{if(q==="TEXTAREA"||(!k||k.altAndVal)&&a[p]){m.val(u)}else{if(!k||k.rebind){this.doc=this.doc||d(l);
|
91 |
-
var i=m.find("*").not("script"),r=g(this.doc.createElement("div")).html(u);g.translate.copyEvents(i,r.find("*"));m.html(r.contents())}else{m.html(u)}}}g.data(l,"lang",s)},setLangAttr:function(i,k,j){if(!j||j.setLangAttr){i.attr((!j||j.setLangAttr===f)?"lang":j.setLangAttr,k)}},copyEvents:function(j,i){i.each(function(l,o){var p=j[l];if(!o||!p){return false}if(b[p.nodeName.toUpperCase()]){return f}var k=g.data(p,"events");if(!k){return f}for(var n in k){for(var m in k[n]){g.event.add(o,n,k[n][m],k[n][m].data)}}})}});g.fn.translate=function(j,i,m){var k=g.translate._getOpt(arguments,g.fn.translate.defaults),l=g.extend({},g.translate._defaults,g.fn.translate.defaults,k,{complete:function(o,n){g.translate(function(){var r=g.translate.toLanguageCode(k.from);if(k.fromOriginal){o.each(function(s,t){e[0]=t;var u=g.translate.getData(e,r,k);if(!u){return true}n[s]=u})}var q=k.each;function p(s){return function(){[].unshift.call(arguments,this.elements);s.apply(this,arguments)}}k.nodes=o;k.start=p(k.start);
|
92 |
-
k.onTimeout=p(k.onTimeout);k.complete=p(k.complete);k.each=function(t){var s=arguments;if(arguments.length!==7){[].splice.call(s,1,0,this.elements[t])}this.each.apply(this,s);q.apply(this,s)};g.translate(n,k)})},each:function(){}});if(this.nodesContainingText){return this.nodesContainingText(l)}k.nodes=this;g.translate(g.map(this,function(n){return g(n).html()||g(n).val()}),k);return this};g.fn.translate.defaults=g.extend({},g.translate._defaults)})(jQuery);
|
93 |
-
|
94 |
-
(function(a){var b={tags:["select","option"],filter:a.translate.isTranslatable,label:a.translate.toNativeLanguage||function(d,c){return a.translate.capitalize(c)},includeUnknown:false};a.translate.ui=function(){var g={},f="",d="",c="";if(typeof arguments[0]==="string"){g.tags=a.makeArray(arguments)}else{g=arguments[0]}g=a.extend({},b,a.translate.ui.defaults,g);if(g.tags[2]){d="<"+g.tags[2]+">";c="</"+g.tags[2]+">"}var e=a.translate.getLanguages(g.filter);if(!g.includeUnknown){delete e.UNKNOWN}a.each(e,function(h,i){f+=("<"+g.tags[1]+" value="+i+">"+d+g.label(i,h)+c+"</"+g.tags[1]+">")});return a("<"+g.tags[0]+' class="jq-translate-ui">'+f+"</"+g.tags[0]+">")};a.translate.ui.defaults=a.extend({},b)})(jQuery);
|
95 |
-
|
96 |
-
jQuery.translate.fn.progress=function(a,c){if(!this.i){this._pr=0}this._pr+=this.source[this.i].length;var b=100*this._pr/(this.rawSource.length-(11*(this.i+1)));if(a){var d=jQuery(a);if(!this.i&&!d.hasClass("ui-progressbar")){d.progressbar(c)}d.progressbar("option","value",b)}return b};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,21 +1,20 @@
|
|
1 |
=== GTranslate ===
|
2 |
Contributors: edo888
|
3 |
Author: Edvard Ananyan
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
9 |
|
10 |
Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
This module uses Google Translate
|
15 |
|
16 |
-
|
17 |
-
|
18 |
-
Please `use` [GTranslate Forum](http://edo.webmaster.am/forum/gtranslate/) for your questions and support requests!
|
19 |
|
20 |
* Hides "Suggest better translation" pop-up
|
21 |
* Hides Google top frame after translation
|
@@ -26,9 +25,9 @@ Please `use` [GTranslate Forum](http://edo.webmaster.am/forum/gtranslate/) for y
|
|
26 |
* Option to translate the page on fly
|
27 |
* Available styles Dropdown/Flags/flags with dropdown
|
28 |
* Valid XHTML
|
29 |
-
* Option to operate with [Pro version](http://edo.webmaster.am/gtranslate?xyz=998) to have SEF URLs, refine/edit translations manually and [index translated pages](http://edo.webmaster.am/gtranslate?xyz=998) in search engines
|
30 |
|
31 |
-
|
|
|
32 |
|
33 |
== Installation ==
|
34 |
|
@@ -43,7 +42,7 @@ To configure the widget go to Settings -> GTranslate
|
|
43 |
== Frequently Asked Questions ==
|
44 |
|
45 |
= It doesn't work, what to do? =
|
46 |
-
Please check the [Troubleshooting](http://
|
47 |
|
48 |
= Where I can see analytics data? =
|
49 |
You need to login to your Google Analytics account -> Content -> Event Tracking. The event name will be GTranslate and you will see event categories for each language code. If you want to see French language usage you can click on fr and you will see which pages are translated to French by your visitors.
|
@@ -63,6 +62,31 @@ Yes, you need to wrap the text you don't want to be translated with <span cla
|
|
63 |
|
64 |
== Changelog ==
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
= 1.0.27 =
|
67 |
* Changed text in noscript tag
|
68 |
|
1 |
=== GTranslate ===
|
2 |
Contributors: edo888
|
3 |
Author: Edvard Ananyan
|
4 |
+
Tags: plugin, widget, sidebar, google, translate, translation, automatic translator, google translate, ajax translator, jquery translator
|
5 |
+
Requires at least: 2.8
|
6 |
+
Tested up to: 3.9
|
7 |
+
Stable tag: 1.0.37
|
8 |
+
License: GPLv2 or later
|
9 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
Get translations with a single click between 58 languages (more than 98% of internet users) on your website!
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
This module uses Google Translate automatic translation service to translate your web page with Google power. With 58 available languages your site will be available to more than 98% of internet users.
|
16 |
|
17 |
+
Please `use` [GTranslate Forum](http://gtranslate.net/forum/) for your questions and support requests!
|
|
|
|
|
18 |
|
19 |
* Hides "Suggest better translation" pop-up
|
20 |
* Hides Google top frame after translation
|
25 |
* Option to translate the page on fly
|
26 |
* Available styles Dropdown/Flags/flags with dropdown
|
27 |
* Valid XHTML
|
|
|
28 |
|
29 |
+
**Watch GTranslate Tour**
|
30 |
+
[vimeo http://vimeo.com/30132555]
|
31 |
|
32 |
== Installation ==
|
33 |
|
42 |
== Frequently Asked Questions ==
|
43 |
|
44 |
= It doesn't work, what to do? =
|
45 |
+
Please check the [Troubleshooting](http://gtranslate.net/forum/troubleshooting-gtranslate-free-t370.html) and feel free to create a new topic if you cannot find your case.
|
46 |
|
47 |
= Where I can see analytics data? =
|
48 |
You need to login to your Google Analytics account -> Content -> Event Tracking. The event name will be GTranslate and you will see event categories for each language code. If you want to see French language usage you can click on fr and you will see which pages are translated to French by your visitors.
|
62 |
|
63 |
== Changelog ==
|
64 |
|
65 |
+
= 1.0.37 =
|
66 |
+
* Bug fixed with new versions of PHP
|
67 |
+
* Translation queue added
|
68 |
+
|
69 |
+
= 1.0.36 =
|
70 |
+
* On Fly IE9 bug fixed
|
71 |
+
|
72 |
+
= 1.0.35 =
|
73 |
+
* On Fly method is back
|
74 |
+
|
75 |
+
= 1.0.34 =
|
76 |
+
* Error fixed with Chinese language in Enterprise mode
|
77 |
+
|
78 |
+
= 1.0.33 =
|
79 |
+
* Support for Enterprise version added
|
80 |
+
|
81 |
+
= 1.0.30 =
|
82 |
+
* Link and call home updated
|
83 |
+
|
84 |
+
= 1.0.29 =
|
85 |
+
* Custom update checker added
|
86 |
+
|
87 |
+
= 1.0.28 =
|
88 |
+
* Links changed
|
89 |
+
|
90 |
= 1.0.27 =
|
91 |
* Changed text in noscript tag
|
92 |
|