PageRenderTime 55ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/wp_gtranslate/gtranslate.php

http://joomla-gtranslate.googlecode.com/
PHP | 668 lines | 579 code | 54 blank | 35 comment | 136 complexity | d95d33f4e125f2a30bd6fd866cc74c62 MD5 | raw file
Possible License(s): GPL-3.0, AGPL-1.0

Large files files are truncated, but you can click here to view the full file

  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. /* Copyright 2010 - 2013 Edvard Ananyan (email : edo888@gmail.com)
  11. This program is free software; you can redistribute it and/or modify
  12. it under the terms of the GNU General Public License as published by
  13. the Free Software Foundation; either version 2 of the License, or
  14. (at your option) any later version.
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. GNU General Public License for more details.
  19. You should have received a copy of the GNU General Public License
  20. along with this program; if not, write to the Free Software
  21. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. require_once 'plugin-updates/plugin-update-checker.php';
  24. $MyUpdateChecker = new PluginUpdateChecker('http://joomla-gtranslate.googlecode.com/svn/trunk/wp_metadata.json', __FILE__, 'gtranslate');
  25. add_action('widgets_init', array('GTranslate', 'register'));
  26. register_activation_hook(__FILE__, array('GTranslate', 'activate'));
  27. register_deactivation_hook(__FILE__, array('GTranslate', 'deactivate'));
  28. add_action('admin_menu', array('GTranslate', 'admin_menu'));
  29. add_action('init', array('GTranslate', 'enqueue_scripts'));
  30. add_shortcode('GTranslate', array('GTranslate', 'get_widget_code'));
  31. add_shortcode('gtranslate', array('GTranslate', 'get_widget_code'));
  32. class GTranslate extends WP_Widget {
  33. function activate() {
  34. $data = array(
  35. 'gtranslate_title' => 'Website Translator',
  36. );
  37. $data = get_option('GTranslate');
  38. GTranslate::load_defaults($data);
  39. add_option('GTranslate', $data);
  40. }
  41. function deactivate() {
  42. // delete_option('GTranslate');
  43. }
  44. function control() {
  45. $data = get_option('GTranslate');
  46. ?>
  47. <p><label>Title: <input name="gtranslate_title" type="text" class="widefat" value="<?php echo $data['gtranslate_title']; ?>"/></label></p>
  48. <p>Please go to Settings -> GTranslate for configuration.</p>
  49. <?php
  50. if (isset($_POST['gtranslate_title'])){
  51. $data['gtranslate_title'] = attribute_escape($_POST['gtranslate_title']);
  52. update_option('GTranslate', $data);
  53. }
  54. }
  55. function enqueue_scripts() {
  56. $data = get_option('GTranslate');
  57. GTranslate::load_defaults($data);
  58. $wp_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
  59. wp_enqueue_style('gtranslate-style', $wp_plugin_url.'/gtranslate-style'.$data['flag_size'].'.css');
  60. }
  61. function widget($args) {
  62. $data = get_option('GTranslate');
  63. GTranslate::load_defaults($data);
  64. echo $args['before_widget'];
  65. echo $args['before_title'] . '<a href="http://gtranslate.net/" rel="follow" target="_blank">' . $data['gtranslate_title'] . '</a>' . $args['after_title'];
  66. if(empty($data['widget_code']))
  67. echo '<b>Notice:</b> Please configure GTranslate from WP-Admin -> Settings -> GTranslate to see it in action.';
  68. else
  69. echo $data['widget_code'];
  70. echo $args['after_widget'];
  71. if(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') === false))
  72. echo '<script src="http://tdn.gtranslate.net/tdn-bin/queue.js" type="text/javascript"></script>';
  73. echo '<noscript>JavaScript is required to use <a href="http://gtranslate.net/">GTranslate</a> <a href="http://gtranslate.net/">website translator</a>, <a href="http://gtranslate.net/">site translator</a>, <a href="http://gtranslate.net/">automatic translation</a>, <a href="http://gtranslate.net/">translation delivery network</a>.</noscript>';
  74. }
  75. function get_widget_code($atts) {
  76. $data = get_option('GTranslate');
  77. GTranslate::load_defaults($data);
  78. if(empty($data['widget_code']))
  79. return '<b>Notice:</b> Please configure GTranslate from WP-Admin -> Settings -> GTranslate to see it in action.';
  80. else
  81. return $data['widget_code'].'<noscript>Javascript is required to use <a href="http://gtranslate.net/">GTranslate</a> <a href="http://gtranslate.net/">website translator</a>, <a href="http://gtranslate.net/">site translator</a>, <a href="http://gtranslate.net/">automatic translation</a>, <a href="http://gtranslate.net/">free translation</a></noscript>';
  82. }
  83. function register() {
  84. wp_register_sidebar_widget('gtranslate', 'GTranslate', array('GTranslate', 'widget'), array('description' => __('Google Automatic Translations')));
  85. wp_register_widget_control('gtranslate', 'GTranslate', array('GTranslate', 'control'));
  86. }
  87. function admin_menu() {
  88. add_options_page('GTranslate Options', 'GTranslate', 'administrator', 'gtranslate_options', array('GTranslate', 'options'));
  89. }
  90. function options() {
  91. ?>
  92. <div class="wrap">
  93. <div id="icon-options-general" class="icon32"><br/></div>
  94. <h2>GTranslate</h2>
  95. <?php
  96. if($_POST['save'])
  97. GTranslate::control_options();
  98. $data = get_option('GTranslate');
  99. GTranslate::load_defaults($data);
  100. $site_url = site_url();
  101. extract($data);
  102. #unset($data['widget_code']);
  103. #echo '<pre>', print_r($data, true), '</pre>';
  104. $script = <<<EOT
  105. var languages = ['Afrikaans','Albanian','Arabic','Armenian','Azerbaijani','Basque','Belarusian','Bulgarian','Catalan','Chinese (Simplified)','Chinese (Traditional)','Croatian','Czech','Danish','Dutch','English','Estonian','Filipino','Finnish','French','Galician','Georgian','German','Greek','Haitian Creole','Hebrew','Hindi','Hungarian','Icelandic','Indonesian','Irish','Italian','Japanese','Korean','Latvian','Lithuanian','Macedonian','Malay','Maltese','Norwegian','Persian','Polish','Portuguese','Romanian','Russian','Serbian','Slovak','Slovenian','Spanish','Swahili','Swedish','Thai','Turkish','Ukrainian','Urdu','Vietnamese','Welsh','Yiddish'];
  106. var language_codes = ['af','sq','ar','hy','az','eu','be','bg','ca','zh-CN','zh-TW','hr','cs','da','nl','en','et','tl','fi','fr','gl','ka','de','el','ht','iw','hi','hu','is','id','ga','it','ja','ko','lv','lt','mk','ms','mt','no','fa','pl','pt','ro','ru','sr','sk','sl','es','sw','sv','th','tr','uk','ur','vi','cy','yi'];
  107. var languages_map = {en_x: 0, en_y: 0, ar_x: 100, ar_y: 0, bg_x: 200, bg_y: 0, zhCN_x: 300, zhCN_y: 0, zhTW_x: 400, zhTW_y: 0, hr_x: 500, hr_y: 0, cs_x: 600, cs_y: 0, da_x: 700, da_y: 0, nl_x: 0, nl_y: 100, fi_x: 100, fi_y: 100, fr_x: 200, fr_y: 100, de_x: 300, de_y: 100, el_x: 400, el_y: 100, hi_x: 500, hi_y: 100, it_x: 600, it_y: 100, ja_x: 700, ja_y: 100, ko_x: 0, ko_y: 200, no_x: 100, no_y: 200, pl_x: 200, pl_y: 200, pt_x: 300, pt_y: 200, ro_x: 400, ro_y: 200, ru_x: 500, ru_y: 200, es_x: 600, es_y: 200, sv_x: 700, sv_y: 200, ca_x: 0, ca_y: 300, tl_x: 100, tl_y: 300, iw_x: 200, iw_y: 300, id_x: 300, id_y: 300, lv_x: 400, lv_y: 300, lt_x: 500, lt_y: 300, sr_x: 600, sr_y: 300, sk_x: 700, sk_y: 300, sl_x: 0, sl_y: 400, uk_x: 100, uk_y: 400, vi_x: 200, vi_y: 400, sq_x: 300, sq_y: 400, et_x: 400, et_y: 400, gl_x: 500, gl_y: 400, hu_x: 600, hu_y: 400, mt_x: 700, mt_y: 400, th_x: 0, th_y: 500, tr_x: 100, tr_y: 500, fa_x: 200, fa_y: 500, af_x: 300, af_y: 500, ms_x: 400, ms_y: 500, sw_x: 500, sw_y: 500, ga_x: 600, ga_y: 500, cy_x: 700, cy_y: 500, be_x: 0, be_y: 600, is_x: 100, is_y: 600, mk_x: 200, mk_y: 600, yi_x: 300, yi_y: 600, hy_x: 400, hy_y: 600, az_x: 500, az_y: 600, eu_x: 600, eu_y: 600, ka_x: 700, ka_y: 600, ht_x: 0, ht_y: 700, ur_x: 100, ur_y: 700};
  108. function RefreshDoWidgetCode() {
  109. var new_line = "\\n";
  110. var widget_preview = '<!-- GTranslate: http://gtranslate.net/ -->'+new_line;
  111. var widget_code = '';
  112. var translation_method = jQuery('#translation_method').val();
  113. var default_language = jQuery('#default_language').val();
  114. var flag_size = jQuery('#flag_size').val();
  115. var pro_version = jQuery('#pro_version:checked').length > 0 ? true : false;
  116. var enterprise_version = jQuery('#enterprise_version:checked').length > 0 ? true : false;
  117. var new_window = jQuery('#new_window:checked').length > 0 ? true : false;
  118. var analytics = jQuery('#analytics:checked').length > 0 ? true : false;
  119. if(pro_version || enterprise_version)
  120. translation_method = 'redirect';
  121. if(pro_version && enterprise_version)
  122. pro_version = false;
  123. if(translation_method == 'google_default') {
  124. included_languages = '';
  125. jQuery.each(languages, function(i, val) {
  126. lang = language_codes[i];
  127. if(jQuery('#incl_langs'+lang+':checked').length) {
  128. lang_name = val;
  129. included_languages += ','+lang;
  130. }
  131. });
  132. widget_preview += '<div id="google_translate_element"></div>'+new_line;
  133. widget_preview += '<script type="text/javascript">'+new_line;
  134. widget_preview += 'function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: \'';
  135. widget_preview += default_language;
  136. widget_preview += '\', layout: google.translate.TranslateElement.InlineLayout.SIMPLE';
  137. widget_preview += ', autoDisplay: false';
  138. widget_preview += ', includedLanguages: \'';
  139. widget_preview += included_languages;
  140. widget_preview += "'}, 'google_translate_element');}"+new_line;
  141. widget_preview += '<\/script>';
  142. widget_preview += '<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"><\/script>'+new_line;
  143. } else if(translation_method == 'on_fly' || translation_method == 'redirect' || translation_method == 'onfly') {
  144. // Adding flags
  145. if(jQuery('#show_flags:checked').length) {
  146. jQuery.each(languages, function(i, val) {
  147. lang = language_codes[i];
  148. if(jQuery('#fincl_langs'+lang+':checked').length) {
  149. lang_name = val;
  150. flag_x = languages_map[lang.replace('-', '')+'_x'];
  151. flag_y = languages_map[lang.replace('-', '')+'_y'];
  152. var href = '#';
  153. if(pro_version)
  154. href = (lang == default_language) ? '$site_url' : '$site_url'.replace('$site_url'.split('/').slice(0, 3).join('/'), '$site_url'.split('/').slice(0, 3).join('/')+'/'+lang);
  155. else if(enterprise_version)
  156. 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.', '://');
  157. 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>';
  158. }
  159. });
  160. }
  161. // Adding dropdown
  162. if(jQuery('#show_dropdown:checked').length) {
  163. if(jQuery('#show_flags:checked').length && jQuery('#add_new_line:checked').length)
  164. widget_preview += '<br />';
  165. else
  166. widget_preview += ' ';
  167. widget_preview += '<select onchange="doGTranslate(this);">';
  168. widget_preview += '<option value="">Select Language</option>';
  169. jQuery.each(languages, function(i, val) {
  170. lang = language_codes[i];
  171. if(jQuery('#incl_langs'+lang+':checked').length) {
  172. lang_name = val;
  173. widget_preview += '<option value="'+default_language+'|'+lang+'">'+lang_name+'</option>';
  174. }
  175. });
  176. widget_preview += '</select>';
  177. }
  178. // Adding onfly html and css
  179. if(translation_method == 'onfly') {
  180. widget_code += '<style type="text/css">'+new_line;
  181. widget_code += '<!--'+new_line;
  182. widget_code += "#goog-gt-tt {display:none !important;}"+new_line;
  183. widget_code += ".goog-te-banner-frame {display:none !important;}"+new_line;
  184. widget_code += ".goog-te-menu-value:hover {text-decoration:none !important;}"+new_line;
  185. widget_code += "body {top:0 !important;}"+new_line;
  186. widget_code += "#google_translate_element2 {display:none!important;}"+new_line;
  187. widget_code += '-->'+new_line;
  188. widget_code += '</style>'+new_line+new_line;
  189. widget_code += '<div id="google_translate_element2"></div>'+new_line;
  190. widget_code += '<script type="text/javascript">'+new_line;
  191. widget_code += 'function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: \'';
  192. widget_code += default_language;
  193. widget_code += '\',autoDisplay: false';
  194. widget_code += "}, 'google_translate_element2');}"+new_line;
  195. widget_code += '<\/script>';
  196. widget_code += '<script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"><\/script>'+new_line;
  197. }
  198. // Adding javascript
  199. widget_code += new_line+new_line;
  200. widget_code += '<script type="text/javascript">'+new_line;
  201. widget_code += '/* <![CDATA[ */'+new_line;
  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];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;
  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];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;
  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(enterprise_version && translation_method == 'redirect' && new_window) {
  214. 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;
  215. if(analytics)
  216. 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;
  217. else
  218. 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;
  219. } else if(enterprise_version && translation_method == 'redirect') {
  220. if(analytics)
  221. 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;
  222. else
  223. 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;
  224. } else if(translation_method == 'redirect' && new_window) {
  225. widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
  226. widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
  227. if(analytics)
  228. 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;
  229. else
  230. 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;
  231. 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;
  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. } else if(translation_method == 'redirect') {
  234. widget_code += 'if(top.location!=self.location)top.location=self.location;'+new_line;
  235. widget_code += "window['_tipoff']=function(){};window['_tipon']=function(a){};"+new_line;
  236. if(analytics)
  237. 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;
  238. else
  239. 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;
  240. 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;
  241. } else if(translation_method == 'onfly') {
  242. widget_code += unescape("eval%28function%28p%2Ca%2Cc%2Ck%2Ce%2Cr%29%7Be%3Dfunction%28c%29%7Breturn%28c%3Ca%3F%27%27%3Ae%28parseInt%28c/a%29%29%29+%28%28c%3Dc%25a%29%3E35%3FString.fromCharCode%28c+29%29%3Ac.toString%2836%29%29%7D%3Bif%28%21%27%27.replace%28/%5E/%2CString%29%29%7Bwhile%28c--%29r%5Be%28c%29%5D%3Dk%5Bc%5D%7C%7Ce%28c%29%3Bk%3D%5Bfunction%28e%29%7Breturn%20r%5Be%5D%7D%5D%3Be%3Dfunction%28%29%7Breturn%27%5C%5Cw+%27%7D%3Bc%3D1%7D%3Bwhile%28c--%29if%28k%5Bc%5D%29p%3Dp.replace%28new%20RegExp%28%27%5C%5Cb%27+e%28c%29+%27%5C%5Cb%27%2C%27g%27%29%2Ck%5Bc%5D%29%3Breturn%20p%7D%28%276%207%28a%2Cb%29%7Bn%7B4%282.9%29%7B3%20c%3D2.9%28%22o%22%29%3Bc.p%28b%2Cf%2Cf%29%3Ba.q%28c%29%7Dg%7B3%20c%3D2.r%28%29%3Ba.s%28%5C%27t%5C%27+b%2Cc%29%7D%7Du%28e%29%7B%7D%7D6%20h%28a%29%7B4%28a.8%29a%3Da.8%3B4%28a%3D%3D%5C%27%5C%27%29v%3B3%20b%3Da.w%28%5C%27%7C%5C%27%29%5B1%5D%3B3%20c%3B3%20d%3D2.x%28%5C%27y%5C%27%29%3Bz%283%20i%3D0%3Bi%3Cd.5%3Bi++%294%28d%5Bi%5D.A%3D%3D%5C%27B-C-D%5C%27%29c%3Dd%5Bi%5D%3B4%282.j%28%5C%27k%5C%27%29%3D%3DE%7C%7C2.j%28%5C%27k%5C%27%29.l.5%3D%3D0%7C%7Cc.5%3D%3D0%7C%7Cc.l.5%3D%3D0%29%7BF%286%28%29%7Bh%28a%29%7D%2CG%29%7Dg%7Bc.8%3Db%3B7%28c%2C%5C%27m%5C%27%29%3B7%28c%2C%5C%27m%5C%27%29%7D%7D%27%2C43%2C43%2C%27%7C%7Cdocument%7Cvar%7Cif%7Clength%7Cfunction%7CGTranslateFireEvent%7Cvalue%7CcreateEvent%7C%7C%7C%7C%7C%7Ctrue%7Celse%7CdoGTranslate%7C%7CgetElementById%7Cgoogle_translate_element2%7CinnerHTML%7Cchange%7Ctry%7CHTMLEvents%7CinitEvent%7CdispatchEvent%7CcreateEventObject%7CfireEvent%7Con%7Ccatch%7Creturn%7Csplit%7CgetElementsByTagName%7Cselect%7Cfor%7CclassName%7Cgoog%7Cte%7Ccombo%7Cnull%7CsetTimeout%7C500%27.split%28%27%7C%27%29%2C0%2C%7B%7D%29%29")+new_line;
  243. }
  244. widget_code += '/* ]]> */'+new_line;
  245. widget_code += '<\/script>'+new_line;
  246. }
  247. widget_code = widget_preview + widget_code;
  248. jQuery('#widget_code').val(widget_code);
  249. ShowWidgetPreview(widget_preview);
  250. }
  251. function ShowWidgetPreview(widget_preview) {
  252. widget_preview = widget_preview.replace(/javascript:doGTranslate/g, 'javascript:void')
  253. widget_preview = widget_preview.replace('onchange="doGTranslate(this);"', '');
  254. widget_preview = widget_preview.replace('if(jQuery.cookie', 'if(false && jQuery.cookie');
  255. jQuery('#widget_preview').html(widget_preview);
  256. }
  257. jQuery('#pro_version').attr('checked', '$pro_version'.length > 0);
  258. jQuery('#enterprise_version').attr('checked', '$enterprise_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);
  262. jQuery('#add_new_line').attr('checked', '$add_new_line'.length > 0);
  263. jQuery('#show_dropdown').attr('checked', '$show_dropdown'.length > 0);
  264. jQuery('#show_flags').attr('checked', '$show_flags'.length > 0);
  265. jQuery('#default_language').val('$default_language');
  266. jQuery('#translation_method').val('$translation_method');
  267. jQuery('#flag_size').val('$flag_size');
  268. if(jQuery('#widget_code').val() == '')
  269. RefreshDoWidgetCode();
  270. else
  271. ShowWidgetPreview(jQuery('#widget_code').val());
  272. EOT;
  273. // selected languages
  274. if(count($incl_langs) > 0)
  275. $script .= "jQuery.each(languages, function(i, val) {jQuery('#incl_langs'+language_codes[i]).attr('checked', false);});\n";
  276. if(count($fincl_langs) > 0)
  277. $script .= "jQuery.each(languages, function(i, val) {jQuery('#fincl_langs'+language_codes[i]).attr('checked', false);});\n";
  278. foreach($incl_langs as $lang)
  279. $script .= "jQuery('#incl_langs$lang').attr('checked', true);\n";
  280. foreach($fincl_langs as $lang)
  281. $script .= "jQuery('#fincl_langs$lang').attr('checked', true);\n";
  282. ?>
  283. <form id="gtranslate" name="form1" method="post" action="<?php echo admin_url() . '/options-general.php?page=gtranslate_options' ?>">
  284. <p>Use the configuration form below to customize the GTranslate widget.</p>
  285. <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>
  286. <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>
  287. <div style="float:left;width:270px;">
  288. <h4>Widget options</h4>
  289. <table style="font-size:11px;">
  290. <tr>
  291. <td class="option_name">Translation method:</td>
  292. <td>
  293. <select id="translation_method" name="translation_method" onChange="RefreshDoWidgetCode()">
  294. <option value="google_default">Google Default</option>
  295. <option value="redirect">Redirect</option>
  296. <option value="onfly">On Fly (Beta)</option>
  297. </select>
  298. </td>
  299. </tr>
  300. <tr>
  301. <td class="option_name">Default language:</td>
  302. <td>
  303. <select id="default_language" name="default_language" onChange="RefreshDoWidgetCode()">
  304. <option value="af">Afrikaans</option>
  305. <option value="sq">Albanian</option>
  306. <option value="ar">Arabic</option>
  307. <option value="hy">Armenian</option>
  308. <option value="az">Azerbaijani</option>
  309. <option value="eu">Basque</option>
  310. <option value="be">Belarusian</option>
  311. <option value="bg">Bulgarian</option>
  312. <option value="ca">Catalan</option>
  313. <option value="zh-CN">Chinese (Simplified)</option>
  314. <option value="zh-TW">Chinese (Traditional)</option>
  315. <option value="hr">Croatian</option>
  316. <option value="cs">Czech</option>
  317. <option value="da">Danish</option>
  318. <option value="nl">Dutch</option>
  319. <option value="en" selected>English</option>
  320. <option value="et">Estonian</option>
  321. <option value="tl">Filipino</option>
  322. <option value="fi">Finnish</option>
  323. <option value="fr">French</option>
  324. <option value="gl">Galician</option>
  325. <option value="ka">Georgian</option>
  326. <option value="de">German</option>
  327. <option value="el">Greek</option>
  328. <option value="ht">Haitian Creole</option>
  329. <option value="iw">Hebrew</option>
  330. <option value="hi">Hindi</option>
  331. <option value="hu">Hungarian</option>
  332. <option value="is">Icelandic</option>
  333. <option value="id">Indonesian</option>
  334. <option value="ga">Irish</option>
  335. <option value="it">Italian</option>
  336. <option value="ja">Japanese</option>
  337. <option value="ko">Korean</option>
  338. <option value="lv">Latvian</option>
  339. <option value="lt">Lithuanian</option>
  340. <option value="mk">Macedonian</option>
  341. <option value="ms">Malay</option>
  342. <option value="mt">Maltese</option>
  343. <option value="no">Norwegian</option>
  344. <option value="fa">Persian</option>
  345. <option value="pl">Polish</option>
  346. <option value="pt">Portuguese</option>
  347. <option value="ro">Romanian</option>
  348. <option value="ru">Russian</option>
  349. <option value="sr">Serbian</option>
  350. <option value="sk">Slovak</option>
  351. <option value="sl">Slovenian</option>
  352. <option value="es">Spanish</option>
  353. <option value="sw">Swahili</option>
  354. <option value="sv">Swedish</option>
  355. <option value="th">Thai</option>
  356. <option value="tr">Turkish</option>
  357. <option value="uk">Ukrainian</option>
  358. <option value="ur">Urdu</option>
  359. <option value="vi">Vietnamese</option>
  360. <option value="cy">Welsh</option>
  361. <option value="yi">Yiddish</option>
  362. </select>
  363. </td>
  364. </tr>
  365. <tr>
  366. <td class="option_name">Open in new window:</td>
  367. <td><input id="new_window" name="new_window" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  368. </tr>
  369. <tr>
  370. <td class="option_name">Analytics:</td>
  371. <td><input id="analytics" name="analytics" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  372. </tr>
  373. <tr>
  374. <td class="option_name">Operate with Pro version:</td>
  375. <td><input id="pro_version" name="pro_version" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  376. </tr>
  377. <tr>
  378. <td class="option_name">Operate with Enterprise version:</td>
  379. <td><input id="enterprise_version" name="enterprise_version" value="1" type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  380. </tr>
  381. <tr>
  382. <td class="option_name">Show flags:</td>
  383. <td><input id="show_flags" name="show_flags" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  384. </tr>
  385. <tr>
  386. <td class="option_name">Flag size:</td>
  387. <td>
  388. <select id="flag_size" name="flag_size" onchange="RefreshDoWidgetCode()">
  389. <option value="16" selected>16px</option>
  390. <option value="24">24px</option>
  391. <option value="32">32px</option>
  392. </select>
  393. </td>
  394. </tr>
  395. <tr>
  396. <td class="option_name">Flag languages:</td>
  397. <td>
  398. <div style="height:55px;overflow-y:scroll;">
  399. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsaf" name="fincl_langs[]" value="af"><label for="fincl_langsaf">Afrikaans</label><br />
  400. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssq" name="fincl_langs[]" value="sq"><label for="fincl_langssq">Albanian</label><br />
  401. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsar" name="fincl_langs[]" value="ar"><label for="fincl_langsar">Arabic</label><br />
  402. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langshy" name="fincl_langs[]" value="hy"><label for="fincl_langshy">Armenian</label><br />
  403. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsaz" name="fincl_langs[]" value="az"><label for="fincl_langsaz">Azerbaijani</label><br />
  404. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langseu" name="fincl_langs[]" value="eu"><label for="fincl_langseu">Basque</label><br />
  405. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsbe" name="fincl_langs[]" value="be"><label for="fincl_langsbe">Belarusian</label><br />
  406. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsbg" name="fincl_langs[]" value="bg"><label for="fincl_langsbg">Bulgarian</label><br />
  407. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsca" name="fincl_langs[]" value="ca"><label for="fincl_langsca">Catalan</label><br />
  408. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langszh-CN" name="fincl_langs[]" value="zh-CN"><label for="fincl_langszh-CN">Chinese (Simplified)</label><br />
  409. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langszh-TW" name="fincl_langs[]" value="zh-TW"><label for="fincl_langszh-TW">Chinese (Traditional)</label><br />
  410. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langshr" name="fincl_langs[]" value="hr"><label for="fincl_langshr">Croatian</label><br />
  411. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langscs" name="fincl_langs[]" value="cs"><label for="fincl_langscs">Czech</label><br />
  412. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsda" name="fincl_langs[]" value="da"><label for="fincl_langsda">Danish</label><br />
  413. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsnl" name="fincl_langs[]" value="nl"><label for="fincl_langsnl">Dutch</label><br />
  414. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsen" name="fincl_langs[]" value="en" checked><label for="fincl_langsen">English</label><br />
  415. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langset" name="fincl_langs[]" value="et"><label for="fincl_langset">Estonian</label><br />
  416. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langstl" name="fincl_langs[]" value="tl"><label for="fincl_langstl">Filipino</label><br />
  417. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsfi" name="fincl_langs[]" value="fi"><label for="fincl_langsfi">Finnish</label><br />
  418. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsfr" name="fincl_langs[]" value="fr" checked><label for="fincl_langsfr">French</label><br />
  419. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsgl" name="fincl_langs[]" value="gl"><label for="fincl_langsgl">Galician</label><br />
  420. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langska" name="fincl_langs[]" value="ka"><label for="fincl_langska">Georgian</label><br />
  421. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsde" name="fincl_langs[]" value="de" checked><label for="fincl_langsde">German</label><br />
  422. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsel" name="fincl_langs[]" value="el"><label for="fincl_langsel">Greek</label><br />
  423. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsht" name="fincl_langs[]" value="ht"><label for="fincl_langsht">Haitian Creole</label><br />
  424. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsiw" name="fincl_langs[]" value="iw"><label for="fincl_langsiw">Hebrew</label><br />
  425. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langshi" name="fincl_langs[]" value="hi"><label for="fincl_langshi">Hindi</label><br />
  426. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langshu" name="fincl_langs[]" value="hu"><label for="fincl_langshu">Hungarian</label><br />
  427. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsis" name="fincl_langs[]" value="is"><label for="fincl_langsis">Icelandic</label><br />
  428. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsid" name="fincl_langs[]" value="id"><label for="fincl_langsid">Indonesian</label><br />
  429. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsga" name="fincl_langs[]" value="ga"><label for="fincl_langsga">Irish</label><br />
  430. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsit" name="fincl_langs[]" value="it" checked><label for="fincl_langsit">Italian</label><br />
  431. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsja" name="fincl_langs[]" value="ja"><label for="fincl_langsja">Japanese</label><br />
  432. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsko" name="fincl_langs[]" value="ko"><label for="fincl_langsko">Korean</label><br />
  433. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langslv" name="fincl_langs[]" value="lv"><label for="fincl_langslv">Latvian</label><br />
  434. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langslt" name="fincl_langs[]" value="lt"><label for="fincl_langslt">Lithuanian</label><br />
  435. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsmk" name="fincl_langs[]" value="mk"><label for="fincl_langsmk">Macedonian</label><br />
  436. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsms" name="fincl_langs[]" value="ms"><label for="fincl_langsms">Malay</label><br />
  437. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsmt" name="fincl_langs[]" value="mt"><label for="fincl_langsmt">Maltese</label><br />
  438. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsno" name="fincl_langs[]" value="no"><label for="fincl_langsno">Norwegian</label><br />
  439. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsfa" name="fincl_langs[]" value="fa"><label for="fincl_langsfa">Persian</label><br />
  440. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langspl" name="fincl_langs[]" value="pl"><label for="fincl_langspl">Polish</label><br />
  441. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langspt" name="fincl_langs[]" value="pt" checked><label for="fincl_langspt">Portuguese</label><br />
  442. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsro" name="fincl_langs[]" value="ro"><label for="fincl_langsro">Romanian</label><br />
  443. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsru" name="fincl_langs[]" value="ru" checked><label for="fincl_langsru">Russian</label><br />
  444. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssr" name="fincl_langs[]" value="sr"><label for="fincl_langssr">Serbian</label><br />
  445. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssk" name="fincl_langs[]" value="sk"><label for="fincl_langssk">Slovak</label><br />
  446. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssl" name="fincl_langs[]" value="sl"><label for="fincl_langssl">Slovenian</label><br />
  447. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langses" name="fincl_langs[]" value="es" checked><label for="fincl_langses">Spanish</label><br />
  448. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssw" name="fincl_langs[]" value="sw"><label for="fincl_langssw">Swahili</label><br />
  449. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langssv" name="fincl_langs[]" value="sv"><label for="fincl_langssv">Swedish</label><br />
  450. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsth" name="fincl_langs[]" value="th"><label for="fincl_langsth">Thai</label><br />
  451. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langstr" name="fincl_langs[]" value="tr"><label for="fincl_langstr">Turkish</label><br />
  452. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsuk" name="fincl_langs[]" value="uk"><label for="fincl_langsuk">Ukrainian</label><br />
  453. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsur" name="fincl_langs[]" value="ur"><label for="fincl_langsur">Urdu</label><br />
  454. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsvi" name="fincl_langs[]" value="vi"><label for="fincl_langsvi">Vietnamese</label><br />
  455. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langscy" name="fincl_langs[]" value="cy"><label for="fincl_langscy">Welsh</label><br />
  456. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="fincl_langsyi" name="fincl_langs[]" value="yi"><label for="fincl_langsyi">Yiddish</label><br />
  457. </div>
  458. </td>
  459. </tr>
  460. <tr>
  461. <td class="option_name">Add new line:</td>
  462. <td><input id="add_new_line" name="add_new_line" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  463. </tr>
  464. <tr>
  465. <td class="option_name">Show dropdown:</td>
  466. <td><input id="show_dropdown" name="show_dropdown" value="1" type="checkbox" checked="checked" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()"/></td>
  467. </tr>
  468. <tr>
  469. <td class="option_name">Dropdown languages:</td>
  470. <td>
  471. <div style="height:55px;overflow-y:scroll;">
  472. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="incl_langsaf" name="incl_langs[]" value="af" checked><label for="incl_langsaf">Afrikaans</label><br />
  473. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="incl_langssq" name="incl_langs[]" value="sq" checked><label for="incl_langssq">Albanian</label><br />
  474. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="incl_langsar" name="incl_langs[]" value="ar" checked><label for="incl_langsar">Arabic</label><br />
  475. <input type="checkbox" onclick="RefreshDoWidgetCode()" onchange="RefreshDoWidgetCode()" id="incl_langshy" name="incl_langs[]" value="hy" checked><label for="incl_langshy">Armenian</label><br />
  476. <inp

Large files files are truncated, but you can click here to view the full file