Transposh WordPress Translation - Version 0.3.0

Version Description

Download this release

Release Info

Developer oferwald
Plugin Icon 128x128 Transposh WordPress Translation
Version 0.3.0
Comparing to
See all releases

Code changes from version 0.2.9 to 0.3.0

core/constants.php CHANGED
@@ -91,9 +91,15 @@ define("VIEWABLE_LANGS", "transposh_viewable_languages");
91
  //Option defining the list of currentlly editable languages
92
  define("EDITABLE_LANGS", "transposh_editable_languages");
93
 
94
- //Option to enable/disable rewrite of permalinks
95
  define("ENABLE_AUTO_TRANSLATE", "transposh_enable_autotranslate");
96
 
 
 
 
 
 
 
97
  //Option to enable/disable rewrite of permalinks
98
  define("ENABLE_PERMALINKS_REWRITE", "transposh_enable_permalinks");
99
 
91
  //Option defining the list of currentlly editable languages
92
  define("EDITABLE_LANGS", "transposh_editable_languages");
93
 
94
+ //Option to enable/disable auto translation
95
  define("ENABLE_AUTO_TRANSLATE", "transposh_enable_autotranslate");
96
 
97
+ //Option to enable/disable msn translation
98
+ define("ENABLE_MSN_TRANSLATE", "transposh_enable_msntranslate");
99
+
100
+ //Option to store the msn API key
101
+ define("MSN_TRANSLATE_KEY", "transposh_msn_key");
102
+
103
  //Option to enable/disable rewrite of permalinks
104
  define("ENABLE_PERMALINKS_REWRITE", "transposh_enable_permalinks");
105
 
js/transposh.js CHANGED
@@ -1 +1 @@
1
- function getgt(){jQuery(":button:contains('Suggest - Google')").attr("disabled","disabled").addClass("ui-state-disabled");google.language.translate(jQuery("#"+transposh_params.prefix+"original").val(),"",transposh_params.lang,function(a){if(!a.error){jQuery("#"+transposh_params.prefix+"translation").val(jQuery("<div>"+a.translation+"</div>").text()).keyup()}})}var done_p=0;var togo=0;function ajax_translate(c,b,a){jQuery.ajax({type:"POST",url:transposh_params.post_url,data:{token:jQuery("#"+transposh_params.prefix+a).attr("token"),translation:c,lang:transposh_params.lang,source:b,translation_posted:"1"},success:function(e){fix_page(c,b,a);if(transposh_params.progress){var d=jQuery("#"+transposh_params.prefix+a).attr("token");done_p+=jQuery("*[token='"+d+"']").size();if(togo>4){jQuery("#progress_bar2").progressbar("value",done_p/togo*100)}}},error:function(d){if(b==0){alert("Error !!! failed to translate.\n\nServer's message: "+d.statusText)}}})}function fix_page(e,d,c){var b=jQuery("#"+transposh_params.prefix+c).attr("token");var a=e;if(jQuery.trim(e).length===0){a=jQuery("#"+transposh_params.prefix+c).attr("orig")}jQuery("*[token='"+b+"'][hidden!='y']").html(a).each(function(g){var h=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery("#"+transposh_params.prefix+h).attr("source",d);var f=jQuery("#"+transposh_params.prefix+"img_"+h);f.removeClass("tr-icon-yellow").removeClass("tr-icon-green");if(jQuery.trim(e).length!==0){if(d==1){f.addClass("tr-icon-yellow")}else{f.addClass("tr-icon-green")}}});jQuery("*[token='"+b+"'][hidden='y']").attr("trans",a).each(function(g){var h=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery("#"+transposh_params.prefix+h).attr("source",d);var f=jQuery("#"+transposh_params.prefix+"img_"+h);f.removeClass("tr-icon-yellow").removeClass("tr-icon-green");if(jQuery.trim(e).length!==0){if(d==1){f.addClass("tr-icon-yellow")}else{f.addClass("tr-icon-green")}}})}function do_auto_translate(){if(transposh_params.progress){togo=jQuery("."+transposh_params.prefix+'[source=""]').size();if(togo>4){jQuery("#"+transposh_params.prefix+"credit").append('<div style="float: left;width: 90%;height: 10px" id="progress_bar"/><div style="margin-bottom:10px;float:left;width: 90%;height: 10px" id="progress_bar2"/>');jQuery("#progress_bar").progressbar({value:0});jQuery("#progress_bar2").progressbar({value:0});jQuery("#progress_bar2 > div").css({background:"#28F828",border:"#08A908 1px solid"})}var a=0}var b=new Array();jQuery("."+transposh_params.prefix+'[source=""]').each(function(d){var c=jQuery(this).attr("id");var e=jQuery(this).attr("orig");if(e==undefined){e=jQuery(this).html()}if(!(b[e]==1)){b[e]=1;google.language.translate(e,"",transposh_params.lang,function(f){if(!f.error){var g=c.substr(c.lastIndexOf("_")+1);fix_page(jQuery("<div>"+f.translation+"</div>").text(),1,g);ajax_translate(jQuery("<div>"+f.translation+"</div>").text(),1,g);if(transposh_params.progress){a=togo-jQuery("."+transposh_params.prefix+'[source=""]').size();if(togo>4){jQuery("#progress_bar").progressbar("value",a/togo*100)}}}})}})}function confirm_close(){jQuery('<div id="dial" title="Close without saving?"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>You have made a change to the translation. Are you sure you want to discard it?</p></div>').appendTo("body").dialog({bgiframe:true,resizable:false,height:140,modal:true,overlay:{backgroundColor:"#000",opacity:0.5},buttons:{Discard:function(){jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false});jQuery(this).dialog("close");jQuery("#"+transposh_params.prefix+"d-tabs").dialog("close")},Cancel:function(){jQuery(this).dialog("close")}}})}function translate_dialog(b){jQuery("#"+transposh_params.prefix+"d-tabs").remove();jQuery('<div id="'+transposh_params.prefix+'d-tabs" title="Edit Translation"/>').appendTo("body");jQuery("#"+transposh_params.prefix+"d-tabs").append("<ul/>").tabs({cache:true}).tabs("add","#"+transposh_params.prefix+"d-tabs-1","Translate").tabs("add",transposh_params.post_url+"?tr_token_hist="+jQuery("#"+transposh_params.prefix+b).attr("token")+"&lang="+transposh_params.lang,"History").css("text-align","left").css("padding",0).bind("tabsload",function(d,e){jQuery("table",e.panel).addClass("ui-widget ui-widget-content").css({width:"95%",padding:"0"});jQuery("table thead tr",e.panel).addClass("ui-widget-header");jQuery("table tbody td[source='1']",e.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>');jQuery("table tbody td[source='0']",e.panel).append('<span title="human" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-person"></span>')}).bind("tabsselect",function(d,e){if(jQuery(e.tab).text()=="Translate"){jQuery("#"+transposh_params.prefix+"d-tabs").dialog("option","buttons",a)}else{jQuery("#"+transposh_params.prefix+"d-tabs").dialog("option","buttons",c)}}).bind("dialogbeforeclose",function(d,e){if(jQuery("#"+transposh_params.prefix+"translation").data("edit").changed){confirm_close();return false}return true});jQuery("#"+transposh_params.prefix+"d-tabs li").css("list-style-type","none").css("list-style-position","outside");jQuery("#"+transposh_params.prefix+"d-tabs-1").css("padding","1px").append('<form id="'+transposh_params.prefix+'form"><fieldset><label for="original">Original Text</label><textarea cols="80" row="3" name="original" id="'+transposh_params.prefix+'original" class="text ui-widget-content ui-corner-all" readonly="y"/><label for="translation">Translate To</label><textarea cols="80" row="3" name="translation" id="'+transposh_params.prefix+'translation" value="" class="text ui-widget-content ui-corner-all"/></fieldset></form>');jQuery("#"+transposh_params.prefix+"d-tabs-1 label").css("display","block");jQuery("#"+transposh_params.prefix+"d-tabs-1 textarea.text").css({"margin-bottom":"12px",width:"95%",padding:".4em"});jQuery("#"+transposh_params.prefix+"original").val(jQuery("#"+transposh_params.prefix+b).attr("orig"));jQuery("#"+transposh_params.prefix+"translation").val(jQuery("#"+transposh_params.prefix+b).html());if(jQuery("#"+transposh_params.prefix+b).attr("trans")){jQuery("#"+transposh_params.prefix+"translation").val(jQuery("#"+transposh_params.prefix+b).attr("trans"))}jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false});jQuery("#"+transposh_params.prefix+"translation").keyup(function(d){if(jQuery("#"+transposh_params.prefix+b).text()!=jQuery(this).val()){jQuery(this).css("background","yellow");jQuery(this).data("edit",{changed:true})}else{jQuery(this).css("background","");jQuery(this).data("edit",{changed:false})}});var a;if(google.language.isTranslatable(transposh_params.lang)||"he|zh-tw|pt|fa".indexOf(transposh_params.lang)>-1){a={"Suggest - Google":function(){getgt()},Ok:function(){var d=jQuery("#"+transposh_params.prefix+"translation").val();if(jQuery("#"+transposh_params.prefix+"translation").data("edit").changed){ajax_translate(d,0,b);jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false})}jQuery(this).dialog("close")}}}else{a={Ok:function(){var d=jQuery("#"+transposh_params.prefix+"translation").val();if(jQuery("#"+transposh_params.prefix+"translation").data("edit").changed){ajax_translate(d,0,b);jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false})}jQuery(this).dialog("close")}}}var c={Close:function(){jQuery(this).dialog("close")}};jQuery("#"+transposh_params.prefix+"d-tabs").dialog({bgiframe:true,modal:true,width:500,buttons:a})}jQuery.noConflict();var transposh_params=new Array();jQuery("script[src*='transposh.js']").each(function(a){var e=unescape(this.src.substring(this.src.indexOf("?")+1));var d=e.split("&");for(var c=0;c<d.length;c++){var g=d[c].indexOf("=");if(g>0){var b=d[c].substring(0,g);var f=d[c].substring(g+1);transposh_params[b]=f}}});google.load("language","1");jQuery(document).ready(function(){if(typeof(jQuery().progressbar)!="undefined"){transposh_params.progress=true}if(google.language.isTranslatable(transposh_params.lang)||"he|zh-tw|pt|fa".indexOf(transposh_params.lang)>-1){do_auto_translate()}if(transposh_params.edit){jQuery("."+transposh_params.prefix).each(function(c){var a=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery(this).after('<span id="'+transposh_params.prefix+"img_"+a+'" class="tr-icon" title="'+jQuery(this).attr("orig")+'"></span>');var b=jQuery("#"+transposh_params.prefix+"img_"+a);b.click(function(){translate_dialog(a);return false}).css({border:"0px",margin:"1px",padding:"0px"});if(jQuery(this).attr("source")=="1"){b.addClass("tr-icon-yellow")}else{if(jQuery(this).attr("source")=="0"){b.addClass("tr-icon-green")}}if(jQuery(this).attr("hidden")=="y"){b.css({opacity:"0.6"})}})}});
1
+ function getgt(){jQuery(":button:contains('Suggest - Google')").attr("disabled","disabled").addClass("ui-state-disabled");google.language.translate(jQuery("#"+transposh_params.prefix+"original").val(),"",transposh_params.lang,function(a){if(!a.error){jQuery("#"+transposh_params.prefix+"translation").val(jQuery("<div>"+a.translation+"</div>").text()).keyup()}})}function getbt(){jQuery(":button:contains('Suggest - Bing')").attr("disabled","disabled").addClass("ui-state-disabled");var a=transposh_params.lang;if(a=="zh"){a="zh-chs"}if(a=="zh-tw"){a="zh-cht"}Microsoft.Translator.translate(jQuery("#"+transposh_params.prefix+"original").val(),"",a,function(b){jQuery("#"+transposh_params.prefix+"translation").val(jQuery("<div>"+b+"</div>").text()).keyup()})}var done_p=0;var togo=0;function ajax_translate(c,b,a){jQuery.ajax({type:"POST",url:transposh_params.post_url,data:{token:jQuery("#"+transposh_params.prefix+a).attr("token"),translation:c,lang:transposh_params.lang,source:b,translation_posted:"1"},success:function(e){fix_page(c,b,a);if(transposh_params.progress){var d=jQuery("#"+transposh_params.prefix+a).attr("token");done_p+=jQuery("*[token='"+d+"']").size();if(togo>4){jQuery("#progress_bar2").progressbar("value",done_p/togo*100)}}},error:function(d){if(b==0){alert("Error !!! failed to translate.\n\nServer's message: "+d.statusText)}}})}function fix_page(e,d,c){var b=jQuery("#"+transposh_params.prefix+c).attr("token");var a=e;if(jQuery.trim(e).length===0){a=jQuery("#"+transposh_params.prefix+c).attr("orig")}jQuery("*[token='"+b+"'][hidden!='y']").html(a).each(function(g){var h=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery("#"+transposh_params.prefix+h).attr("source",d);var f=jQuery("#"+transposh_params.prefix+"img_"+h);f.removeClass("tr-icon-yellow").removeClass("tr-icon-green");if(jQuery.trim(e).length!==0){if(d==1){f.addClass("tr-icon-yellow")}else{f.addClass("tr-icon-green")}}});jQuery("*[token='"+b+"'][hidden='y']").attr("trans",a).each(function(g){var h=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery("#"+transposh_params.prefix+h).attr("source",d);var f=jQuery("#"+transposh_params.prefix+"img_"+h);f.removeClass("tr-icon-yellow").removeClass("tr-icon-green");if(jQuery.trim(e).length!==0){if(d==1){f.addClass("tr-icon-yellow")}else{f.addClass("tr-icon-green")}}})}function do_auto_translate(){if(transposh_params.progress){togo=jQuery("."+transposh_params.prefix+'[source=""]').size();if(togo>4){jQuery("#"+transposh_params.prefix+"credit").append('<div style="float: left;width: 90%;height: 10px" id="progress_bar"/><div style="margin-bottom:10px;float:left;width: 90%;height: 10px" id="progress_bar2"/>');jQuery("#progress_bar").progressbar({value:0});jQuery("#progress_bar2").progressbar({value:0});jQuery("#progress_bar2 > div").css({background:"#28F828",border:"#08A908 1px solid"})}var a=0}var b=new Array();jQuery("."+transposh_params.prefix+'[source=""]').each(function(d){var c=jQuery(this).attr("id");var e=jQuery(this).attr("orig");if(e==undefined){e=jQuery(this).html()}if(!(b[e]==1)){b[e]=1;google.language.translate(e,"",transposh_params.lang,function(f){if(!f.error){var g=c.substr(c.lastIndexOf("_")+1);fix_page(jQuery("<div>"+f.translation+"</div>").text(),1,g);ajax_translate(jQuery("<div>"+f.translation+"</div>").text(),1,g);if(transposh_params.progress){a=togo-jQuery("."+transposh_params.prefix+'[source=""]').size();if(togo>4){jQuery("#progress_bar").progressbar("value",a/togo*100)}}}})}})}function confirm_close(){jQuery('<div id="dial" title="Close without saving?"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>You have made a change to the translation. Are you sure you want to discard it?</p></div>').appendTo("body").dialog({bgiframe:true,resizable:false,height:140,modal:true,overlay:{backgroundColor:"#000",opacity:0.5},buttons:{Discard:function(){jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false});jQuery(this).dialog("close");jQuery("#"+transposh_params.prefix+"d-tabs").dialog("close")},Cancel:function(){jQuery(this).dialog("close")}}})}function translate_dialog(b){jQuery("#"+transposh_params.prefix+"d-tabs").remove();jQuery('<div id="'+transposh_params.prefix+'d-tabs" title="Edit Translation"/>').appendTo("body");jQuery("#"+transposh_params.prefix+"d-tabs").append("<ul/>").tabs({cache:true}).tabs("add","#"+transposh_params.prefix+"d-tabs-1","Translate").tabs("add",transposh_params.post_url+"?tr_token_hist="+jQuery("#"+transposh_params.prefix+b).attr("token")+"&lang="+transposh_params.lang,"History").css("text-align","left").css("padding",0).bind("tabsload",function(d,e){jQuery("table",e.panel).addClass("ui-widget ui-widget-content").css({width:"95%",padding:"0"});jQuery("table thead tr",e.panel).addClass("ui-widget-header");jQuery("table tbody td[source='1']",e.panel).append('<span title="computer" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-gear"></span>');jQuery("table tbody td[source='0']",e.panel).append('<span title="human" style="display: inline-block; margin-right: 0.3em;" class="ui-icon ui-icon-person"></span>')}).bind("tabsselect",function(d,e){if(jQuery(e.tab).text()=="Translate"){jQuery("#"+transposh_params.prefix+"d-tabs").dialog("option","buttons",a)}else{jQuery("#"+transposh_params.prefix+"d-tabs").dialog("option","buttons",c)}}).bind("dialogbeforeclose",function(d,e){if(jQuery("#"+transposh_params.prefix+"translation").data("edit").changed){confirm_close();return false}return true});jQuery("#"+transposh_params.prefix+"d-tabs li").css("list-style-type","none").css("list-style-position","outside");jQuery("#"+transposh_params.prefix+"d-tabs-1").css("padding","1px").append('<form id="'+transposh_params.prefix+'form"><fieldset><label for="original">Original Text</label><textarea cols="80" row="3" name="original" id="'+transposh_params.prefix+'original" class="text ui-widget-content ui-corner-all" readonly="y"/><label for="translation">Translate To</label><textarea cols="80" row="3" name="translation" id="'+transposh_params.prefix+'translation" value="" class="text ui-widget-content ui-corner-all"/></fieldset></form>');jQuery("#"+transposh_params.prefix+"d-tabs-1 label").css("display","block");jQuery("#"+transposh_params.prefix+"d-tabs-1 textarea.text").css({"margin-bottom":"12px",width:"95%",padding:".4em"});jQuery("#"+transposh_params.prefix+"original").val(jQuery("#"+transposh_params.prefix+b).attr("orig"));jQuery("#"+transposh_params.prefix+"translation").val(jQuery("#"+transposh_params.prefix+b).html());if(jQuery("#"+transposh_params.prefix+b).attr("trans")){jQuery("#"+transposh_params.prefix+"translation").val(jQuery("#"+transposh_params.prefix+b).attr("trans"))}jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false});jQuery("#"+transposh_params.prefix+"translation").keyup(function(d){if(jQuery("#"+transposh_params.prefix+b).text()!=jQuery(this).val()){jQuery(this).css("background","yellow");jQuery(this).data("edit",{changed:true})}else{jQuery(this).css("background","");jQuery(this).data("edit",{changed:false})}});var a={};if(binglangs.indexOf(transposh_params.lang+",",0)>-1){a["Suggest - Bing"]=function(){getbt()}}if(google.language.isTranslatable(transposh_params.lang)||"he|zh-tw|pt|fa".indexOf(transposh_params.lang)>-1){a["Suggest - Google"]=function(){getgt()}}a.Ok=function(){var d=jQuery("#"+transposh_params.prefix+"translation").val();if(jQuery("#"+transposh_params.prefix+"translation").data("edit").changed){ajax_translate(d,0,b);jQuery("#"+transposh_params.prefix+"translation").data("edit",{changed:false})}jQuery(this).dialog("close")};var c={Close:function(){jQuery(this).dialog("close")}};jQuery("#"+transposh_params.prefix+"d-tabs").dialog({bgiframe:true,modal:true,width:500,buttons:a})}jQuery.noConflict();var transposh_params=new Array();jQuery("script[src*='transposh.js']").each(function(a){var e=unescape(this.src.substring(this.src.indexOf("?")+1));var d=e.split("&");for(var c=0;c<d.length;c++){var g=d[c].indexOf("=");if(g>0){var b=d[c].substring(0,g);var f=d[c].substring(g+1);transposh_params[b]=f}}});google.load("language","1");var binglangs="";if(typeof(Microsoft)!="undefined"){try{binglangs=String(Microsoft.Translator.GetLanguages())+",zh,zh-tw,"}catch(err){alert("There was an error using Microsoft.Translator - probably a bad key or URL used in key. ("+err+")")}}jQuery(document).ready(function(){if(typeof(jQuery().progressbar)!="undefined"){transposh_params.progress=true}if(google.language.isTranslatable(transposh_params.lang)||"he|zh-tw|pt|fa".indexOf(transposh_params.lang)>-1){do_auto_translate()}if(transposh_params.edit){jQuery("."+transposh_params.prefix).each(function(c){var a=jQuery(this).attr("id").substr(jQuery(this).attr("id").lastIndexOf("_")+1);jQuery(this).after('<span id="'+transposh_params.prefix+"img_"+a+'" class="tr-icon" title="'+jQuery(this).attr("orig")+'"></span>');var b=jQuery("#"+transposh_params.prefix+"img_"+a);b.click(function(){translate_dialog(a);return false}).css({border:"0px",margin:"1px",padding:"0px"});if(jQuery(this).attr("source")=="1"){b.addClass("tr-icon-yellow")}else{if(jQuery(this).attr("source")=="0"){b.addClass("tr-icon-green")}}if(jQuery(this).attr("hidden")=="y"){b.css({opacity:"0.6"})}})}});
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Transposh - translation filter for wordpress ===
2
  Contributors: oferwald, amirperlman
3
- Donate link: http://transposh.org/
4
  Tags: translation, widget, filter, bilingual, multilingual, transposh, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
5
  Requires at least: 2.7
6
  Tested up to: 2.8.2
7
- Stable tag: 0.2.9
8
 
9
  Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
10
 
@@ -109,28 +109,30 @@ change the .css from transparent background to your page background color. And l
109
  4. Management of languages in the settings page
110
  5. Widget style selection
111
 
112
- == Release notes ==
113
- * 2009/07/21 - 0.2.9
 
 
114
  * Supress warning on parse_url (thanks [Mike](http://www.nostate.com/))
115
  * Fix the urls generated for the widget with subdir blogs (thanks [Peter](http://www.algarve-abc.de/ferienhaus-westalgarve))
116
  * Fix issue when object->tostring didn't work correctly (thanks [Anthony](http://gratiswork.com))
117
- * 2009/07/19 - 0.2.8
118
  * Don't touch XML RPC
119
  * Allow usage of CSS sprites when available
120
  * Removed use of local blank image (thanks [Marek](http://marenkuv.blogspot.com/))
121
  * Fixed unicode in Transposh RSS feed (Admin panel)
122
  * Smarter inclusion of .css files (only when needed)
123
  * Fixed bug with url_cleanup which prevented return to original language when blog was installed in a subdir
124
- * 2009/06/20 - 0.2.7
125
  * Added Persian (Farsi) support to auto translation (thanks to google and Iranian "elections")
126
- * 2009/06/17 - 0.2.6
127
  * Fixed regressions in urls reported by ([Mike](http://www.nostate.com/)) and ([Julian](http://julianmegson.com/blog/about/))
128
  * Will not push jQuery to the bottom, as it might conflict with other plugins
129
- * 2009/06/16 - 0.2.5
130
  * Fixed url rewrite bug reported by ([Mike](http://www.nostate.com/))
131
  * Allow translation of even more hidden elements such as keywords, descriptions and stuff inside select tags
132
  * Updated to jQueryUI 1.7.2
133
- * 2009/06/09 - 0.2.4
134
  * Fixed bugs with database prefixes (thanks again [Mike](http://www.nostate.com/))
135
  * Translation of keywords and description meta tags (thanks again [Mike](http://www.nostate.com/))
136
  * Fix for RSS feeds provided in other languages
@@ -139,63 +141,63 @@ change the .css from transparent background to your page background color. And l
139
  * Fixed issues of html entities breaking when they should not (thanks [Karl](http://www.wp-plugin-archive.de/))
140
  * Lang is now set in the headers for real
141
  * Fixed compatability with themes using annoying query_posts with no consideration (thanks [Karl](http://www.wp-plugin-archive.de/))
142
- * 2009/06/03 - 0.2.3
143
  * Revamped plugin setting page to a more useful one (code adapted from [code-styling.de](http://www.code-styling.de/))
144
  * Widget settings may be changed from settings page (thanks [Db0](http://dbzer0.com/))
145
  * Allow default language to be translated (for multilingual blogs) (thanks [Db0](http://dbzer0.com/))
146
  * Setting page shows database statistics
147
  * Fixed IE8 hover quirk in flags widget
148
  * Avoid translating admin pages (even if we can)
149
- * 2009/05/25 - 0.2.2
150
  * Fixed wrong handling of multy-byte chars as terminators (middle dots) which caused a regression bug
151
- * 2009/05/21 - 0.2.1
152
  * Fixed unique breaking case in parser (style used within script and not properly terminated) (thanks again Fernanda)
153
  * Added language list mode to widget
154
  * Prevent translation of url that is self wrapped
155
  * Added &lt;code&gt; tag to list of ignored tags (thanks again [Mike](http://www.nostate.com/))
156
  * Middle dot is now a seperator
157
- * 2009/05/18 - 0.2.0
158
  * Faster parser - 50% faster parsing than previous engine (thanks [Simple Html DOM](http://simplehtmldom.sourceforge.net/))
159
  * Hidden elements translation (mainly tooltips specified by title attribute)
160
  * Make sure viewable languages are translateable
161
  * Simplify setting page
162
  * Fixed various bugs (thanks [Mike](http://www.nostate.com/))
163
- * 2009/05/07 - 0.1.7
164
  * Fix issues with IIS/Windows/Non standard installations (thanks [Fabrizio](http://www.sulmare.it/))
165
  * Fixed namespace conflict with more plugins (For example - Lazyest Gallery)
166
- * 2009/05/05 - 0.1.6
167
  * Fix a problem with translating Traditional Chinese and Portuguese (thanks Fernanda)
168
  * Fixed several issues with html comment tags (thanks [ekerem](http://www.top100freesoftware.com/))
169
- * 2009/05/03 - 0.1.5
170
  * Improved end-user experience by switching order of posts and page changes
171
- * 2009/04/30 - 0.1.4
172
  * Moved to jQuery UI instead of overlibmws
173
  * Reduced code generated for faster page loading
174
  * History is now visible for translated phrases
175
  * An optional progress bar shows advancing auto-translation
176
  * Script is now minified by default
177
  * Better support for not-auto-translatable languages, added islandic
178
- * 2009/04/02 - 0.1.3
179
  * Fix for mysql 4.1 (thanks [Amit](http://landscaping-blog.com/))
180
- * 2009/03/31 - 0.1.2
181
  * Made sure our code passes w3c validation
182
  * Added missing flags for two languages
183
  * Auto translation should always work if set (even to non translators)
184
- * 2009/03/24 - 0.1.1
185
  * Fixed compatibility issues with other scripts (thanks [Eike](http://spotterblog.de/))
186
  * Fixed minor issues with encoding some strings
187
  * Verify UTF charset and collation upon database creation
188
  * Some CSS improvements
189
- * 2009/03/22 - 0.1.0
190
  * Enabled automatic translation for site readers
191
  * Added many languages to the default list
192
  * Upgrade database for supporting translation "sources"
193
  * Fixed installation bug
194
- * 2009/03/07 - 0.0.3
195
  * Added ability to get suggestions from Google Translate
196
  * Improved support for RSS feeds translation
197
- * 2009/03/01 - 0.0.2
198
  * Fixed bug with hard coded plugin path (thanks [Atomboy](http://politicalnewsblogs.com/))
199
  * Support for AJAX replacement of content using jQuery
200
- * 2009/02/28 - 0.0.1
201
  * Initial release
1
  === Transposh - translation filter for wordpress ===
2
  Contributors: oferwald, amirperlman
3
+ Donate link: http://transposh.org/donate/
4
  Tags: translation, widget, filter, bilingual, multilingual, transposh, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
5
  Requires at least: 2.7
6
  Tested up to: 2.8.2
7
+ Stable tag: 0.3.0
8
 
9
  Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
10
 
109
  4. Management of languages in the settings page
110
  5. Widget style selection
111
 
112
+ == Changelog ==
113
+ = 2009/07/23 - 0.3.0 =
114
+ * Support Bing (MSN) translator as a hinting facilitator
115
+ = 2009/07/21 - 0.2.9 =
116
  * Supress warning on parse_url (thanks [Mike](http://www.nostate.com/))
117
  * Fix the urls generated for the widget with subdir blogs (thanks [Peter](http://www.algarve-abc.de/ferienhaus-westalgarve))
118
  * Fix issue when object->tostring didn't work correctly (thanks [Anthony](http://gratiswork.com))
119
+ = 2009/07/19 - 0.2.8 =
120
  * Don't touch XML RPC
121
  * Allow usage of CSS sprites when available
122
  * Removed use of local blank image (thanks [Marek](http://marenkuv.blogspot.com/))
123
  * Fixed unicode in Transposh RSS feed (Admin panel)
124
  * Smarter inclusion of .css files (only when needed)
125
  * Fixed bug with url_cleanup which prevented return to original language when blog was installed in a subdir
126
+ = 2009/06/20 - 0.2.7 =
127
  * Added Persian (Farsi) support to auto translation (thanks to google and Iranian "elections")
128
+ = 2009/06/17 - 0.2.6 =
129
  * Fixed regressions in urls reported by ([Mike](http://www.nostate.com/)) and ([Julian](http://julianmegson.com/blog/about/))
130
  * Will not push jQuery to the bottom, as it might conflict with other plugins
131
+ = 2009/06/16 - 0.2.5 =
132
  * Fixed url rewrite bug reported by ([Mike](http://www.nostate.com/))
133
  * Allow translation of even more hidden elements such as keywords, descriptions and stuff inside select tags
134
  * Updated to jQueryUI 1.7.2
135
+ = 2009/06/09 - 0.2.4 =
136
  * Fixed bugs with database prefixes (thanks again [Mike](http://www.nostate.com/))
137
  * Translation of keywords and description meta tags (thanks again [Mike](http://www.nostate.com/))
138
  * Fix for RSS feeds provided in other languages
141
  * Fixed issues of html entities breaking when they should not (thanks [Karl](http://www.wp-plugin-archive.de/))
142
  * Lang is now set in the headers for real
143
  * Fixed compatability with themes using annoying query_posts with no consideration (thanks [Karl](http://www.wp-plugin-archive.de/))
144
+ = 2009/06/03 - 0.2.3 =
145
  * Revamped plugin setting page to a more useful one (code adapted from [code-styling.de](http://www.code-styling.de/))
146
  * Widget settings may be changed from settings page (thanks [Db0](http://dbzer0.com/))
147
  * Allow default language to be translated (for multilingual blogs) (thanks [Db0](http://dbzer0.com/))
148
  * Setting page shows database statistics
149
  * Fixed IE8 hover quirk in flags widget
150
  * Avoid translating admin pages (even if we can)
151
+ = 2009/05/25 - 0.2.2 =
152
  * Fixed wrong handling of multy-byte chars as terminators (middle dots) which caused a regression bug
153
+ = 2009/05/21 - 0.2.1 =
154
  * Fixed unique breaking case in parser (style used within script and not properly terminated) (thanks again Fernanda)
155
  * Added language list mode to widget
156
  * Prevent translation of url that is self wrapped
157
  * Added &lt;code&gt; tag to list of ignored tags (thanks again [Mike](http://www.nostate.com/))
158
  * Middle dot is now a seperator
159
+ = 2009/05/18 - 0.2.0 =
160
  * Faster parser - 50% faster parsing than previous engine (thanks [Simple Html DOM](http://simplehtmldom.sourceforge.net/))
161
  * Hidden elements translation (mainly tooltips specified by title attribute)
162
  * Make sure viewable languages are translateable
163
  * Simplify setting page
164
  * Fixed various bugs (thanks [Mike](http://www.nostate.com/))
165
+ = 2009/05/07 - 0.1.7 =
166
  * Fix issues with IIS/Windows/Non standard installations (thanks [Fabrizio](http://www.sulmare.it/))
167
  * Fixed namespace conflict with more plugins (For example - Lazyest Gallery)
168
+ = 2009/05/05 - 0.1.6 =
169
  * Fix a problem with translating Traditional Chinese and Portuguese (thanks Fernanda)
170
  * Fixed several issues with html comment tags (thanks [ekerem](http://www.top100freesoftware.com/))
171
+ = 2009/05/03 - 0.1.5 =
172
  * Improved end-user experience by switching order of posts and page changes
173
+ = 2009/04/30 - 0.1.4 =
174
  * Moved to jQuery UI instead of overlibmws
175
  * Reduced code generated for faster page loading
176
  * History is now visible for translated phrases
177
  * An optional progress bar shows advancing auto-translation
178
  * Script is now minified by default
179
  * Better support for not-auto-translatable languages, added islandic
180
+ = 2009/04/02 - 0.1.3 =
181
  * Fix for mysql 4.1 (thanks [Amit](http://landscaping-blog.com/))
182
+ = 2009/03/31 - 0.1.2 =
183
  * Made sure our code passes w3c validation
184
  * Added missing flags for two languages
185
  * Auto translation should always work if set (even to non translators)
186
+ = 2009/03/24 - 0.1.1 =
187
  * Fixed compatibility issues with other scripts (thanks [Eike](http://spotterblog.de/))
188
  * Fixed minor issues with encoding some strings
189
  * Verify UTF charset and collation upon database creation
190
  * Some CSS improvements
191
+ = 2009/03/22 - 0.1.0 =
192
  * Enabled automatic translation for site readers
193
  * Added many languages to the default list
194
  * Upgrade database for supporting translation "sources"
195
  * Fixed installation bug
196
+ = 2009/03/07 - 0.0.3 =
197
  * Added ability to get suggestions from Google Translate
198
  * Improved support for RSS feeds translation
199
+ = 2009/03/01 - 0.0.2 =
200
  * Fixed bug with hard coded plugin path (thanks [Atomboy](http://politicalnewsblogs.com/))
201
  * Support for AJAX replacement of content using jQuery
202
+ = 2009/02/28 - 0.0.1 =
203
  * Initial release
transposh.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://transposh.org/
5
  Description: Translation filter for WordPress, After enabling please set languages at the <a href="options-general.php?page=transposh">the options page</a> Want to help? visit our development site at <a href="http://trac.transposh.org/">trac.transposh.org</a>.
6
  Author: Team Transposh
7
- Version: 0.2.9
8
  Author URI: http://transposh.org/
9
  License: GPL (http://www.gnu.org/licenses/gpl.txt)
10
  */
@@ -351,7 +351,7 @@ function add_transposh_css() {
351
  return;
352
  }
353
  //include the transposh.css
354
- wp_enqueue_style("transposh","$tr_plugin_url/css/transposh.css",array(),'0.2.9');
355
  wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/ui-lightness/jquery-ui.css",array(),'1.0');
356
 
357
  }
@@ -392,7 +392,10 @@ function add_transposh_js() {
392
  // jQuery pushing below might cause issues
393
  //wp_enqueue_script("jquery","http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",array(),'1.3.2', get_option(ENABLE_FOOTER_SCRIPTS));
394
  wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1',get_option(ENABLE_FOOTER_SCRIPTS));
395
- wp_enqueue_script("transposh","$tr_plugin_url/js/transposh.js?post_url=$post_url{$edit_mode}&lang={$GLOBALS['lang']}&prefix=".SPAN_PREFIX,array("jquery"),'0.2.9',get_option(ENABLE_FOOTER_SCRIPTS));
 
 
 
396
  }
397
  }
398
 
4
  Plugin URI: http://transposh.org/
5
  Description: Translation filter for WordPress, After enabling please set languages at the <a href="options-general.php?page=transposh">the options page</a> Want to help? visit our development site at <a href="http://trac.transposh.org/">trac.transposh.org</a>.
6
  Author: Team Transposh
7
+ Version: 0.3.0
8
  Author URI: http://transposh.org/
9
  License: GPL (http://www.gnu.org/licenses/gpl.txt)
10
  */
351
  return;
352
  }
353
  //include the transposh.css
354
+ wp_enqueue_style("transposh","$tr_plugin_url/css/transposh.css",array(),'0.3.0');
355
  wp_enqueue_style("jquery","http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/ui-lightness/jquery-ui.css",array(),'1.0');
356
 
357
  }
392
  // jQuery pushing below might cause issues
393
  //wp_enqueue_script("jquery","http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js",array(),'1.3.2', get_option(ENABLE_FOOTER_SCRIPTS));
394
  wp_enqueue_script("google","http://www.google.com/jsapi",array(),'1',get_option(ENABLE_FOOTER_SCRIPTS));
395
+ if (get_option(ENABLE_MSN_TRANSLATE)) {
396
+ wp_enqueue_script("mstranslate","http://api.microsofttranslator.com/V1/Ajax.svc/Embed?appId=".get_option(MSN_TRANSLATE_KEY),array(),'1',get_option(ENABLE_FOOTER_SCRIPTS));
397
+ }
398
+ wp_enqueue_script("transposh","$tr_plugin_url/js/transposh.js?post_url=$post_url{$edit_mode}&lang={$GLOBALS['lang']}&prefix=".SPAN_PREFIX,array("jquery"),'0.3.0',get_option(ENABLE_FOOTER_SCRIPTS));
399
  }
400
  }
401
 
transposh_admin.php CHANGED
@@ -171,6 +171,17 @@ function insert_auto_translate_option() {
171
  'Allow automatic translation of pages (currently using Google Translate)';
172
  }
173
 
 
 
 
 
 
 
 
 
 
 
 
174
  /*
175
  * Insert the option to enable/disable default language translation.
176
  * Disabled by default.
@@ -256,6 +267,12 @@ function update_admin_options() {
256
  if(get_option(ENABLE_DEFAULT_TRANSLATE) != $_POST['enable_defaulttranslate'])
257
  update_option(ENABLE_DEFAULT_TRANSLATE, $_POST['enable_defaulttranslate']);
258
 
 
 
 
 
 
 
259
  }
260
 
261
  //class that reperesent the complete plugin
@@ -264,7 +281,7 @@ class transposh_plugin {
264
  //constructor of class, PHP4 compatible construction for backward compatibility
265
  function transposh_plugin() {
266
  if (get_option(ENABLE_CSS_FLAGS))
267
- wp_enqueue_style("transposh-flags",plugins_url('', __FILE__)."/css/transposh_flags.css",array(),'0.2.9');
268
  //add filter for WordPress 2.8 changed backend box system !
269
  add_filter('screen_layout_columns', array(&$this, 'on_screen_layout_columns'), 10, 2);
270
  //add some help
@@ -451,6 +468,9 @@ class transposh_plugin {
451
  echo '<h4>Enable automatic translation</h4>';
452
  insert_auto_translate_option();
453
 
 
 
 
454
  echo '<h4>Enable default language translation</h4>';
455
  insert_default_translate_option();
456
 
171
  'Allow automatic translation of pages (currently using Google Translate)';
172
  }
173
 
174
+ /*
175
+ * Insert the option to enable/disable msn translations.
176
+ * Disabled by default because an API key is needed.
177
+ */
178
+ function insert_msn_translate_option() {
179
+ $checked = (get_option(ENABLE_MSN_TRANSLATE)) ? 'checked="checked"' : '';
180
+ echo '<input type="checkbox" value="1" name="enable_msntranslate" '.$checked.'/> '.
181
+ 'Allow MSN (Bing) translator hinting (get key from <a href="http://www.microsofttranslator.com/Dev/Ajax/Default.aspx">here</a>)<br/>'.
182
+ 'Key: <input type="text" size="35" class="regular-text" value="'.get_option(MSN_TRANSLATE_KEY).'" id="transposh_msn_key" name="transposh_msn_key"/>';
183
+ }
184
+
185
  /*
186
  * Insert the option to enable/disable default language translation.
187
  * Disabled by default.
267
  if(get_option(ENABLE_DEFAULT_TRANSLATE) != $_POST['enable_defaulttranslate'])
268
  update_option(ENABLE_DEFAULT_TRANSLATE, $_POST['enable_defaulttranslate']);
269
 
270
+ if(get_option(ENABLE_MSN_TRANSLATE) != $_POST['enable_msntranslate'])
271
+ update_option(ENABLE_MSN_TRANSLATE, $_POST['enable_msntranslate']);
272
+
273
+ if(get_option(MSN_TRANSLATE_KEY) != $_POST['transposh_msn_key'])
274
+ update_option(MSN_TRANSLATE_KEY, $_POST['transposh_msn_key']);
275
+
276
  }
277
 
278
  //class that reperesent the complete plugin
281
  //constructor of class, PHP4 compatible construction for backward compatibility
282
  function transposh_plugin() {
283
  if (get_option(ENABLE_CSS_FLAGS))
284
+ wp_enqueue_style("transposh-flags",plugins_url('', __FILE__)."/css/transposh_flags.css",array(),'0.3.0');
285
  //add filter for WordPress 2.8 changed backend box system !
286
  add_filter('screen_layout_columns', array(&$this, 'on_screen_layout_columns'), 10, 2);
287
  //add some help
468
  echo '<h4>Enable automatic translation</h4>';
469
  insert_auto_translate_option();
470
 
471
+ echo '<h4>Support for Bing (MSN) translation hinting (experimental)</h4>';
472
+ insert_msn_translate_option();
473
+
474
  echo '<h4>Enable default language translation</h4>';
475
  insert_default_translate_option();
476
 
transposh_db.php CHANGED
@@ -129,7 +129,7 @@ function update_translation() {
129
  $original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
130
 
131
  //add our own custom header - so we will know that we got here
132
- header("Transposh: ver-0.2.9 db_version-". DB_VERSION);
133
 
134
  list($translated_text, $old_source) = fetch_translation($original, $lang);
135
  if ($translated_text) {
@@ -227,7 +227,7 @@ function get_translation_history($token, $lang) {
227
  $original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
228
 
229
  //add our own custom header - so we will know that we got here
230
- header("Transposh: ver-0.2.9 db_version-". DB_VERSION);
231
 
232
  $query = "SELECT translated, translated_by, timestamp, source, user_login ".
233
  "FROM $table_name ".
129
  $original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
130
 
131
  //add our own custom header - so we will know that we got here
132
+ header("Transposh: ver-0.3.0 db_version-". DB_VERSION);
133
 
134
  list($translated_text, $old_source) = fetch_translation($original, $lang);
135
  if ($translated_text) {
227
  $original = $wpdb->escape(html_entity_decode($original, ENT_NOQUOTES, 'UTF-8'));
228
 
229
  //add our own custom header - so we will know that we got here
230
+ header("Transposh: ver-0.3.0 db_version-". DB_VERSION);
231
 
232
  $query = "SELECT translated, translated_by, timestamp, source, user_login ".
233
  "FROM $table_name ".
transposh_widget.php CHANGED
@@ -85,11 +85,11 @@ function add_transposh_widget_css() {
85
  // TODO: user generated version
86
  $options = get_option(WIDGET_TRANSPOSH);
87
  if ($options['style'] == 1 || $options['style'] == 2) {
88
- wp_enqueue_style("transposh_widget","{$GLOBALS['tr_plugin_url']}/css/transposh_widget.css",array(),'0.2.9');
89
  if (get_option(ENABLE_CSS_FLAGS)) {
90
- wp_enqueue_style("transposh_flags", "{$GLOBALS['tr_plugin_url']}/css/transposh_flags.css",array(),'0.2.9');
91
  if (file_exists("{$GLOBALS['tr_plugin_url']}/css/transposh_flags_u.css"))
92
- wp_enqueue_style("transposh_flags", "{$GLOBALS['tr_plugin_url']}/css/transposh_flags_u.css",array(),'0.2.9');
93
  }
94
  }
95
 
85
  // TODO: user generated version
86
  $options = get_option(WIDGET_TRANSPOSH);
87
  if ($options['style'] == 1 || $options['style'] == 2) {
88
+ wp_enqueue_style("transposh_widget","{$GLOBALS['tr_plugin_url']}/css/transposh_widget.css",array(),'0.3.0');
89
  if (get_option(ENABLE_CSS_FLAGS)) {
90
+ wp_enqueue_style("transposh_flags", "{$GLOBALS['tr_plugin_url']}/css/transposh_flags.css",array(),'0.3.0');
91
  if (file_exists("{$GLOBALS['tr_plugin_url']}/css/transposh_flags_u.css"))
92
+ wp_enqueue_style("transposh_flags", "{$GLOBALS['tr_plugin_url']}/css/transposh_flags_u.css",array(),'0.3.0');
93
  }
94
  }
95