Transposh WordPress Translation - Version 0.6.5

Version Description

= 0.6.3 = Support .po/.mo files = 0.6.0 = Much improved translation interface engine = 0.5.7 = Fix for critical bug in 0.5.6 = 0.5.6 = Support pluggable widgets = 0.5.5 = Support for buddypress URLs = 0.5.3 = Support URL translation = 0.5.2 = Improved lang attribute support, changed default language translation option = 0.5.1 = Improved speed and database structure = 0.5.0 = Ability to translate all content, backup service for human translations = 0.4.3 = Minor bug fixes, more compatability = 0.4.2 = This version provides Haitian support, auto translate with bing support = 0.4.0 = This version provides integration with google-sitemaps-xml and wp-super-cache = 0.3.9 = This version allows sorting of languages within the widget

Download this release

Release Info

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

Code changes from version 0.6.4 to 0.6.5

core/constants.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  //Language indicator in URL. i.e. lang=en
@@ -88,7 +88,7 @@ class transposh_consts {
88
  'ru' => 'Russian,Русский,ru,ru_RU',
89
  'sr' => 'Serbian,српски језик,rs,sr_RS',
90
  'sk' => 'Slovak,slovenčina,sk,sk_SK',
91
- 'sl' => 'Slovene,slovenščina,sl,sl_SI', //slovenian
92
  'es' => 'Spanish,Español,es,es_ES',
93
  'sw' => 'Swahili,Kiswahili,ke,',
94
  'sv' => 'Swedish,svenska,se,sv_SE',
@@ -122,7 +122,7 @@ class transposh_consts {
122
  define('TRANSLATOR', 'translator');
123
 
124
  //Define for transposh plugin version
125
- define('TRANSPOSH_PLUGIN_VER', '0.6.4');
126
 
127
  //Define segment id prefix, will be included in span tag. also used as class identifier
128
  define('SPAN_PREFIX', 'tr_');
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  //Language indicator in URL. i.e. lang=en
88
  'ru' => 'Russian,Русский,ru,ru_RU',
89
  'sr' => 'Serbian,српски језик,rs,sr_RS',
90
  'sk' => 'Slovak,slovenčina,sk,sk_SK',
91
+ 'sl' => 'Slovene,slovenščina,si,sl_SI', //slovenian
92
  'es' => 'Spanish,Español,es,es_ES',
93
  'sw' => 'Swahili,Kiswahili,ke,',
94
  'sv' => 'Swedish,svenska,se,sv_SE',
122
  define('TRANSLATOR', 'translator');
123
 
124
  //Define for transposh plugin version
125
+ define('TRANSPOSH_PLUGIN_VER', '0.6.5');
126
 
127
  //Define segment id prefix, will be included in span tag. also used as class identifier
128
  define('SPAN_PREFIX', 'tr_');
core/parser.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  require_once("shd/simple_html_dom.php");
@@ -108,6 +108,8 @@ class parser {
108
  public $is_edit_mode;
109
  public $is_auto_translate;
110
  public $feed_fix;
 
 
111
  public $allow_ad = false;
112
  //first three are html, later 3 come from feeds xml (link is problematic...)
113
  protected $ignore_tags = array('script' => 1, 'style' => 1, 'code' => 1, 'wfw:commentrss' => 1, 'comments' => 1, 'guid' => 1);
@@ -267,7 +269,7 @@ class parser {
267
  return 3;
268
  //·
269
  if (ord($char) == 194 && ord($nextchar) == 183) return 2;
270
- return (strpos(',?()[]"!:|;'.TP_GTXT_BRK.TP_GTXT_BRK_CLOSER.TP_GTXT_IBRK.TP_GTXT_IBRK_CLOSER, $char) !== false) ? 1 : 0; // TODO: might need to add < and > here
271
  }
272
 
273
  /**
@@ -348,20 +350,20 @@ class parser {
348
  // $closers = ($string[$pos] == TP_GTXT_BRK) ? '': 'closer';
349
  //
350
  $this->tag_phrase($string, $start, $pos);
351
- ($string[$pos] == TP_GTXT_BRK) ? $this->in_get_text += 1: $this->in_get_text -= 1;
352
  $pos++;
353
  $start = $pos;
354
  // reset state based on string start, no need to flip
355
  //$this->in_get_text = ($pos == 1);
356
  //if (!$this->in_get_text) $this->in_get_text_inner = false;
357
- } elseif ($string[$pos] == TP_GTXT_IBRK || $string[$pos] == TP_GTXT_IBRK_CLOSER ) {
358
  // $logstr = str_replace(array(chr(1),chr(2),chr(3),chr(4)), array('[1]','[2]','[3]','[4]'), $string);
359
  // $closers = ($string[$pos] == TP_GTXT_IBRK) ? '': 'closer';
360
  //
361
  //
362
  $this->tag_phrase($string, $start, $pos);
363
  if ($this->in_get_text)
364
- ($string[$pos] == TP_GTXT_IBRK) ? $this->in_get_text_inner += 1 : $this->in_get_text_inner -=1;
365
  $pos++;
366
  $start = $pos;
367
  //$this->in_get_text_inner = !$this->in_get_text_inner;
@@ -393,9 +395,9 @@ class parser {
393
  $num_len = 0; // we have already added this
394
  }
395
  $this->tag_phrase($string, $start, $pos);
396
- $start = $pos + $num_len /*+1*/;
397
  }
398
- $pos += $num_len/* + 1*/;
399
  //
400
  } else {
401
  // smarter marking of start location
@@ -567,6 +569,21 @@ class parser {
567
  function fix_html($string) {
568
  // ready our stats
569
  $this->stats = new parserstats();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
  // create our dom
571
  $this->html = str_get_html($string);
572
  // mark translateable elements
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  require_once("shd/simple_html_dom.php");
108
  public $is_edit_mode;
109
  public $is_auto_translate;
110
  public $feed_fix;
111
+ /** @var boolean should we attempt to handle page as json */
112
+ public $might_json = false;
113
  public $allow_ad = false;
114
  //first three are html, later 3 come from feeds xml (link is problematic...)
115
  protected $ignore_tags = array('script' => 1, 'style' => 1, 'code' => 1, 'wfw:commentrss' => 1, 'comments' => 1, 'guid' => 1);
269
  return 3;
270
  //·
271
  if (ord($char) == 194 && ord($nextchar) == 183) return 2;
272
+ return (strpos(',?()[]{}"!:|;' . TP_GTXT_BRK . TP_GTXT_BRK_CLOSER . TP_GTXT_IBRK . TP_GTXT_IBRK_CLOSER, $char) !== false) ? 1 : 0; // TODO: might need to add < and > here
273
  }
274
 
275
  /**
350
  // $closers = ($string[$pos] == TP_GTXT_BRK) ? '': 'closer';
351
  //
352
  $this->tag_phrase($string, $start, $pos);
353
+ ($string[$pos] == TP_GTXT_BRK) ? $this->in_get_text += 1 : $this->in_get_text -= 1;
354
  $pos++;
355
  $start = $pos;
356
  // reset state based on string start, no need to flip
357
  //$this->in_get_text = ($pos == 1);
358
  //if (!$this->in_get_text) $this->in_get_text_inner = false;
359
+ } elseif ($string[$pos] == TP_GTXT_IBRK || $string[$pos] == TP_GTXT_IBRK_CLOSER) {
360
  // $logstr = str_replace(array(chr(1),chr(2),chr(3),chr(4)), array('[1]','[2]','[3]','[4]'), $string);
361
  // $closers = ($string[$pos] == TP_GTXT_IBRK) ? '': 'closer';
362
  //
363
  //
364
  $this->tag_phrase($string, $start, $pos);
365
  if ($this->in_get_text)
366
+ ($string[$pos] == TP_GTXT_IBRK) ? $this->in_get_text_inner += 1 : $this->in_get_text_inner -=1;
367
  $pos++;
368
  $start = $pos;
369
  //$this->in_get_text_inner = !$this->in_get_text_inner;
395
  $num_len = 0; // we have already added this
396
  }
397
  $this->tag_phrase($string, $start, $pos);
398
+ $start = $pos + $num_len /* +1 */;
399
  }
400
+ $pos += $num_len/* + 1 */;
401
  //
402
  } else {
403
  // smarter marking of start location
569
  function fix_html($string) {
570
  // ready our stats
571
  $this->stats = new parserstats();
572
+ // handler for possible json (buddypress)
573
+ if ($this->might_json) {
574
+ if ($string[0] == '{') {
575
+ $jsoner = json_decode($string);
576
+ if ($jsoner != null) {
577
+
578
+ // currently we only handle contents (which buddypress heavily use)
579
+ if ($jsoner->contents) {
580
+ $jsoner->contents = $this->fix_html($jsoner->contents);
581
+ return json_encode($jsoner);
582
+ }
583
+ }
584
+ }
585
+ }
586
+
587
  // create our dom
588
  $this->html = str_get_html($string);
589
  // mark translateable elements
core/utils.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /**
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /**
img/flags59.png CHANGED
Binary file
js/lazy.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * Transposh v0.6.4
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
10
  */
11
  (function(b){function s(){function h(a,c){t[a](c,function(d){d=="error"?i.push(c):k.push(c)&&g.each(c);o()},"lazy-loaded-"+(g.name?g.name:(new Date).getTime()))}function j(a){g.complete(a,k,i);g[a](a=="error"?i:k);clearTimeout(p);clearTimeout(u)}function o(){if(k.length==l.length)j("success");else k.length+i.length==l.length&&j("error")}function q(){i.push(this.src);o()}var t=this,g,k=[],i=[],p,u,n,l=[];this.init=function(a){if(a){g=b.extend({},b.xLazyLoader.defaults,a);n={js:g.js,css:g.css,img:g.img};
12
  b.each(n,function(c,d){if(typeof d=="string")d=d.split(",");l=l.concat(d)});if(l.length){if(g.timeout)p=setTimeout(function(){var c=k.concat(i);b.each(l,function(d,f){b.inArray(f,c)==-1&&i.push(f)});j("error")},g.timeout);b.each(n,function(c,d){if(b.isArray(d))b.each(d,function(f,e){h(c,e)});else typeof d=="string"&&h(c,d)})}else j("error")}};this.js=function(a,c,d){var f=b('script[src*="'+a+'"]');if(f.length)f.attr("pending")?f.bind("scriptload",c):c();else{var e=document.createElement("script");
1
  /*
2
+ * Transposh v0.6.5
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
10
  */
11
  (function(b){function s(){function h(a,c){t[a](c,function(d){d=="error"?i.push(c):k.push(c)&&g.each(c);o()},"lazy-loaded-"+(g.name?g.name:(new Date).getTime()))}function j(a){g.complete(a,k,i);g[a](a=="error"?i:k);clearTimeout(p);clearTimeout(u)}function o(){if(k.length==l.length)j("success");else k.length+i.length==l.length&&j("error")}function q(){i.push(this.src);o()}var t=this,g,k=[],i=[],p,u,n,l=[];this.init=function(a){if(a){g=b.extend({},b.xLazyLoader.defaults,a);n={js:g.js,css:g.css,img:g.img};
12
  b.each(n,function(c,d){if(typeof d=="string")d=d.split(",");l=l.concat(d)});if(l.length){if(g.timeout)p=setTimeout(function(){var c=k.concat(i);b.each(l,function(d,f){b.inArray(f,c)==-1&&i.push(f)});j("error")},g.timeout);b.each(n,function(c,d){if(b.isArray(d))b.each(d,function(f,e){h(c,e)});else typeof d=="string"&&h(c,d)})}else j("error")}};this.js=function(a,c,d){var f=b('script[src*="'+a+'"]');if(f.length)f.attr("pending")?f.bind("scriptload",c):c();else{var e=document.createElement("script");
js/transposh.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * Transposh v0.6.4
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
10
  */
11
  (function(a){function u(c,d){if(a.trim(d).length!==0){var b=function(){var e=a(this).attr("id").substr(a(this).attr("id").lastIndexOf("_")+1),i=a("#"+f+"img_"+e);a("#"+f+e).attr("data-source",1);i.removeClass("tr-icon-yellow").removeClass("tr-icon-green").addClass("tr-icon-yellow")};a("*[data-token='"+c+"'][data-hidden!='y']").html(d).each(b);a("*[data-token='"+c+"'][data-hidden='y']").attr("data-trans",d).each(b)}}function v(c,d){clearTimeout(o);h.push(c);n.push(d);u(c,d);o=setTimeout(function(){var b=
12
  {ln0:t_jp.lang,sr0:p,translation_posted:"2",items:h.length},e;for(e=0;e<h.length;e+=1){b["tk"+e]=h[e];b["tr"+e]=n[e];q+=a("*[data-token='"+h[e]+"']").size()}a.ajax({type:"POST",url:t_jp.post_url,data:b,success:function(){var i=q/j*100;t_jp.progress&&a("#"+k).progressbar("value",i)}});n=[];h=[]},200)}function l(c,d){v(c,a("<div>"+a.trim(d)+"</div>").text());var b=(j-a("."+f+'[data-source=""]').size())/j*100;t_jp.progress&&a("#"+m).progressbar("value",b)}function w(c,d){var b="";a(c).each(function(e){b+=
1
  /*
2
+ * Transposh v0.6.5
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
10
  */
11
  (function(a){function u(c,d){if(a.trim(d).length!==0){var b=function(){var e=a(this).attr("id").substr(a(this).attr("id").lastIndexOf("_")+1),i=a("#"+f+"img_"+e);a("#"+f+e).attr("data-source",1);i.removeClass("tr-icon-yellow").removeClass("tr-icon-green").addClass("tr-icon-yellow")};a("*[data-token='"+c+"'][data-hidden!='y']").html(d).each(b);a("*[data-token='"+c+"'][data-hidden='y']").attr("data-trans",d).each(b)}}function v(c,d){clearTimeout(o);h.push(c);n.push(d);u(c,d);o=setTimeout(function(){var b=
12
  {ln0:t_jp.lang,sr0:p,translation_posted:"2",items:h.length},e;for(e=0;e<h.length;e+=1){b["tk"+e]=h[e];b["tr"+e]=n[e];q+=a("*[data-token='"+h[e]+"']").size()}a.ajax({type:"POST",url:t_jp.post_url,data:b,success:function(){var i=q/j*100;t_jp.progress&&a("#"+k).progressbar("value",i)}});n=[];h=[]},200)}function l(c,d){v(c,a("<div>"+a.trim(d)+"</div>").text());var b=(j-a("."+f+'[data-source=""]').size())/j*100;t_jp.progress&&a("#"+m).progressbar("value",b)}function w(c,d){var b="";a(c).each(function(e){b+=
js/transposhadmin.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * Transposh v0.6.4
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
10
  */
11
  var timer,items=0,translations=[],tokens=[],langs=[],sources=[],BATCH_SIZE=128,pair_count=0,curr_pair=0;t_jp.MSN_APPID="FACA8E2DF8DCCECE0DC311C6E57DA98EFEFA9BC6";function make_progress(e,b){curr_pair+=1;jQuery("#progress_bar").progressbar("value",curr_pair/pair_count*100);jQuery("#p").text("("+b+") "+e);curr_pair===pair_count&&jQuery("#tr_loading").data("done",true)}
12
  function ajax_translate_me(e,b,c,d){b=jQuery("<div>"+jQuery.trim(b)+"</div>").text();make_progress(b,c);clearTimeout(timer);items+=1;tokens.push(e);translations.push(b);langs.push(c);sources.push(d);timer=setTimeout(function(){var f={translation_posted:"2",items:items},a;for(a=0;a<items;a+=1){if(tokens[a]!==tokens[a-1])f["tk"+a]=tokens[a];if(langs[a]!==langs[a-1])f["ln"+a]=langs[a];if(translations[a]!==translations[a-1])f["tr"+a]=translations[a];if(sources[a]!==sources[a-1])f["sr"+a]=sources[a]}jQuery.ajax({type:"POST",
1
  /*
2
+ * Transposh v0.6.5
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
10
  */
11
  var timer,items=0,translations=[],tokens=[],langs=[],sources=[],BATCH_SIZE=128,pair_count=0,curr_pair=0;t_jp.MSN_APPID="FACA8E2DF8DCCECE0DC311C6E57DA98EFEFA9BC6";function make_progress(e,b){curr_pair+=1;jQuery("#progress_bar").progressbar("value",curr_pair/pair_count*100);jQuery("#p").text("("+b+") "+e);curr_pair===pair_count&&jQuery("#tr_loading").data("done",true)}
12
  function ajax_translate_me(e,b,c,d){b=jQuery("<div>"+jQuery.trim(b)+"</div>").text();make_progress(b,c);clearTimeout(timer);items+=1;tokens.push(e);translations.push(b);langs.push(c);sources.push(d);timer=setTimeout(function(){var f={translation_posted:"2",items:items},a;for(a=0;a<items;a+=1){if(tokens[a]!==tokens[a-1])f["tk"+a]=tokens[a];if(langs[a]!==langs[a-1])f["ln"+a]=langs[a];if(translations[a]!==translations[a-1])f["tr"+a]=translations[a];if(sources[a]!==sources[a-1])f["sr"+a]=sources[a]}jQuery.ajax({type:"POST",
js/transposhcontrol.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * Transposh v0.6.4
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
10
  */
11
  jQuery(function(){jQuery("#tr_anon").click(function(){if(jQuery("#tr_anon").attr("checked")){jQuery(".translateable").addClass("active").removeClass("translateable");jQuery("#sortable .active").each(function(){jQuery("input",this).val(jQuery(this).attr("id")+",v,t")})}jQuery("#yellowcolor").toggleClass("hidden")});jQuery("#sortable").sortable({placeholder:"highlight",update:function(b,a){a.item.unbind("click");a.item.one("click",function(c){c.stopImmediatePropagation();jQuery(this).click(clickfunction)})}});
12
  jQuery("#sortable").disableSelection();jQuery("#changename").click(function(){jQuery(".langname").toggleClass("hidden");return false});jQuery("#selectall").click(function(){jQuery("#sortable .languages").addClass("active").removeClass("translateable");jQuery("#sortable .active").each(function(){jQuery("input",this).val(jQuery(this).attr("id")+",v,t")});return false});clickfunction=function(){if(jQuery(this).attr("id")!=jQuery("#default_list li").attr("id")){if(jQuery("#tr_anon").attr("checked"))jQuery(this).toggleClass("active");
1
  /*
2
+ * Transposh v0.6.5
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
10
  */
11
  jQuery(function(){jQuery("#tr_anon").click(function(){if(jQuery("#tr_anon").attr("checked")){jQuery(".translateable").addClass("active").removeClass("translateable");jQuery("#sortable .active").each(function(){jQuery("input",this).val(jQuery(this).attr("id")+",v,t")})}jQuery("#yellowcolor").toggleClass("hidden")});jQuery("#sortable").sortable({placeholder:"highlight",update:function(b,a){a.item.unbind("click");a.item.one("click",function(c){c.stopImmediatePropagation();jQuery(this).click(clickfunction)})}});
12
  jQuery("#sortable").disableSelection();jQuery("#changename").click(function(){jQuery(".langname").toggleClass("hidden");return false});jQuery("#selectall").click(function(){jQuery("#sortable .languages").addClass("active").removeClass("translateable");jQuery("#sortable .active").each(function(){jQuery("input",this).val(jQuery(this).attr("id")+",v,t")});return false});clickfunction=function(){if(jQuery(this).attr("id")!=jQuery("#default_list li").attr("id")){if(jQuery("#tr_anon").attr("checked"))jQuery(this).toggleClass("active");
js/transposhedit.js CHANGED
@@ -1,12 +1,12 @@
1
  /*
2
- * Transposh v0.6.4
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
10
  */
11
  (function(a){function h(b,c){if(a.trim(c).length===0)c=a("[data-token='"+b+"']").attr("data-orig");var e=function(){var f=a(this).attr("id").substr(a(this).attr("id").lastIndexOf("_")+1),d=a("#"+t_jp.prefix+"img_"+f);a("#"+t_jp.prefix+f).attr("data-source",0);d.removeClass("tr-icon-yellow").removeClass("tr-icon-green").addClass("tr-icon-green")};a("*[data-token='"+b+"'][data-hidden!='y']").html(c).each(e);a("*[data-token='"+b+"'][data-hidden='y']").attr("data-trans",c).each(e)}function i(b,c){h(b,
12
  c);a.ajax({type:"POST",url:t_jp.post_url,data:{ln0:t_jp.lang,sr0:0,translation_posted:"2",items:1,tk0:b,tr0:c},success:function(){},error:function(e){alert("Error !!! failed to translate.\n\nServer's message: "+e.statusText)}})}function j(b,c){a.ajax({url:"http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q="+encodeURIComponent(b)+"&langpair=%7C"+t_jp.lang,dataType:"jsonp",success:c})}function k(){a(":button:contains('Suggest - Google')").attr("disabled","disabled").addClass("ui-state-disabled");
1
  /*
2
+ * Transposh v0.6.5
3
  * http://transposh.org/
4
  *
5
  * Copyright 2010, Team Transposh
6
  * Licensed under the GPL Version 2 or higher.
7
  * http://transposh.org/license
8
  *
9
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
10
  */
11
  (function(a){function h(b,c){if(a.trim(c).length===0)c=a("[data-token='"+b+"']").attr("data-orig");var e=function(){var f=a(this).attr("id").substr(a(this).attr("id").lastIndexOf("_")+1),d=a("#"+t_jp.prefix+"img_"+f);a("#"+t_jp.prefix+f).attr("data-source",0);d.removeClass("tr-icon-yellow").removeClass("tr-icon-green").addClass("tr-icon-green")};a("*[data-token='"+b+"'][data-hidden!='y']").html(c).each(e);a("*[data-token='"+b+"'][data-hidden='y']").attr("data-trans",c).each(e)}function i(b,c){h(b,
12
  c);a.ajax({type:"POST",url:t_jp.post_url,data:{ln0:t_jp.lang,sr0:0,translation_posted:"2",items:1,tk0:b,tr0:c},success:function(){},error:function(e){alert("Error !!! failed to translate.\n\nServer's message: "+e.statusText)}})}function j(b,c){a.ajax({url:"http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q="+encodeURIComponent(b)+"&langpair=%7C"+t_jp.lang,dataType:"jsonp",success:c})}function k(){a(":button:contains('Suggest - Google')").attr("disabled","disabled").addClass("ui-state-disabled");
langs/transposh-he_IL.po CHANGED
@@ -19,13 +19,13 @@ msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
- #: wp/transposh_3rdparty.php:146
23
  #, php-format
24
  #@ buddypress
25
  msgid "%s translated a phrase to %s with transposh:"
26
  msgstr "%s תרגם פסקה ל-%s בעזרת טרנספוש:"
27
 
28
- #: wp/transposh_admin.php:259
29
  #@ transposh
30
  msgid "Problems?"
31
  msgstr "בעיות?"
@@ -35,450 +35,452 @@ msgstr "בעיות?"
35
  msgid "Transposh language selection widget"
36
  msgstr "ישומון בחירת השפה של טרנספוש"
37
 
38
- #: wp/transposh_widget.php:208
39
  #@ transposh
40
  msgid "Translation"
41
  msgstr "תרגום"
42
 
43
- #: wp/transposh_admin.php:189
44
  #@ transposh
45
  msgid "About this plugin"
46
  msgstr "אודות תוסף זה"
47
 
48
- #: wp/transposh_admin.php:190
49
  #@ transposh
50
  msgid "Widget settings"
51
  msgstr "הגדרות ישומון"
52
 
53
- #: wp/transposh_admin.php:191
54
  #@ transposh
55
  msgid "Plugin news"
56
  msgstr "חדשות התוסף"
57
 
58
- #: wp/transposh_admin.php:192
59
  #@ transposh
60
  msgid "Plugin stats"
61
  msgstr "סטטיסטיקות התוסף"
62
 
63
- #: wp/transposh_admin.php:193
64
  #@ transposh
65
  msgid "Translate all"
66
  msgstr "תרגם הכל"
67
 
68
- #: wp/transposh_admin.php:194
69
  #@ transposh
70
  msgid "Supported languages"
71
  msgstr "שפות נתמכות"
72
 
73
- #: wp/transposh_admin.php:195
74
  #@ transposh
75
  msgid "Translation settings"
76
  msgstr "הגדרות תרגום"
77
 
78
- #: wp/transposh_admin.php:196
79
  #@ transposh
80
  msgid "Automatic translation settings"
81
  msgstr "הגדרות תרגום אוטומטי"
82
 
83
- #: wp/transposh_admin.php:197
84
  #@ transposh
85
  msgid "Generic settings"
86
  msgstr "הגדרות כלליות"
87
 
88
- #: wp/transposh_admin.php:198
89
  #@ transposh
90
  msgid "Database maintenance"
91
  msgstr "תחזוקת בסיס הנתונים"
92
 
93
- #: wp/transposh_admin.php:207
94
  #@ transposh
95
  msgid "Transposh community features"
96
  msgstr "תכונות קהילתיות בטרנספוש"
97
 
98
- #: wp/transposh_admin.php:149
99
- #: wp/transposh_admin.php:214
 
 
100
  #: wp/transposh_widget.php:88
101
  #: wp/transposh_widget.php:91
102
- #: wp/transposh_widget.php:253
103
  #@ transposh
104
  msgid "Transposh"
105
  msgstr "טרנספוש"
106
 
107
- #: wp/transposh_admin.php:301
108
  #@ transposh
109
  msgid "Translate by clicking the button below"
110
  msgstr "תרגם על ידי לחיצה על הכפתור למטה"
111
 
112
- #: wp/transposh_admin.php:302
113
  #@ transposh
114
  msgid "Translate All Now"
115
  msgstr "תרגם הכל עכשיו"
116
 
117
- #: transposh.php:601
118
  #@ transposh
119
  msgctxt "Edit Interface"
120
  msgid "Edit Translation"
121
  msgstr "עריכת תרגום"
122
 
123
- #: transposh.php:602
124
  #@ transposh
125
  msgctxt "Edit Interface"
126
  msgid "Translate"
127
  msgstr "תרגם"
128
 
129
- #: transposh.php:603
130
  #@ transposh
131
  msgctxt "Edit Interface"
132
  msgid "History"
133
  msgstr "היסטוריה"
134
 
135
- #: transposh.php:604
136
  #@ transposh
137
  msgctxt "Edit Interface"
138
  msgid "Original Text"
139
  msgstr "טקסט מקורי"
140
 
141
- #: transposh.php:605
142
  #@ transposh
143
  msgctxt "Edit Interface"
144
  msgid "Translate To"
145
  msgstr "תרגם ל"
146
 
147
- #: wp/transposh_admin.php:277
148
  #@ transposh
149
  msgid "Plugin Homepage"
150
  msgstr "עמוד הבית של התוסף"
151
 
152
- #: wp/transposh_admin.php:278
153
  #@ transposh
154
  msgid "Suggest a Feature"
155
  msgstr "הצע תכונה"
156
 
157
- #: wp/transposh_admin.php:280
158
  #@ transposh
159
  msgid "Report a Bug"
160
  msgstr "דווח על באג"
161
 
162
- #: wp/transposh_admin.php:359
163
  #@ transposh
164
  msgid "Default Language (drag another language here to make it default)"
165
  msgstr "שפת ברירת המחדל (גרור שפה אחרת לכאן על מנת להפכה לברירת מחדל)"
166
 
167
- #: wp/transposh_admin.php:366
168
  #@ transposh
169
  msgid "Available Languages (Click to toggle language state - Drag to sort in the widget)"
170
  msgstr "שפות זמינות (הקלק כדי לשנות את סטטוס השפה - גרור כדי למיין בישומון)"
171
 
172
- #: wp/transposh_admin.php:376
173
  #@ transposh
174
  msgid "Language supported by google translate"
175
  msgstr "שפה נתמכת ע\"י המתרגם של גוגל"
176
 
177
- #: wp/transposh_admin.php:378
178
  #@ transposh
179
  msgid "Language supported by bing translate"
180
  msgstr "שפה נתמכת ע\"י המתרגם של בינג"
181
 
182
- #: wp/transposh_admin.php:380
183
  #@ transposh
184
  msgid "Language is written from right to left"
185
  msgstr "שפה הנכתבת מימין לשמאל"
186
 
187
- #: wp/transposh_admin.php:385
188
  #@ transposh
189
  msgid "Display options:"
190
  msgstr "הגדרות תצוגה:"
191
 
192
- #: wp/transposh_admin.php:386
193
  #@ transposh
194
  msgid "Toggle names of languages between English and Original"
195
  msgstr "שנה את הצגת שפות השפות בין אנגלית למקןר"
196
 
197
- #: wp/transposh_admin.php:387
198
  #@ transposh
199
  msgid "Make all languages active"
200
  msgstr "הפוך את כל השפות לפעילות"
201
 
202
- #: wp/transposh_admin.php:388
203
  #@ transposh
204
  msgid "Sort by language name"
205
  msgstr "מיין לפי שם השפה"
206
 
207
- #: wp/transposh_admin.php:389
208
  #@ transposh
209
  msgid "Sort by lSO code"
210
  msgstr "מיין לפי קוד ה-ISO"
211
 
212
- #: wp/transposh_admin.php:390
213
  #@ transposh
214
  msgid "Legend:"
215
  msgstr "מקרא:"
216
 
217
- #: wp/transposh_admin.php:390
218
  #@ transposh
219
  msgid "Green - active"
220
  msgstr "ירוק - פעיל"
221
 
222
- #: wp/transposh_admin.php:390
223
  #@ transposh
224
  msgid "Yellow - translateable (only translators will see this language)"
225
  msgstr "צהוב - ניתן לתרגום (רק מתרגמים יראו את השפה)"
226
 
227
- #: wp/transposh_admin.php:390
228
  #@ transposh
229
  msgid "blank - inactive"
230
  msgstr "ללא צבע - לא פעיל"
231
 
232
- #: wp/transposh_admin.php:407
233
  #@ transposh
234
  msgid "Who can translate ?"
235
  msgstr "מי יכול לתרגם?"
236
 
237
- #: wp/transposh_admin.php:414
238
  #@ transposh
239
  msgid "Anonymous"
240
  msgstr "אנונימי"
241
 
242
- #: wp/transposh_admin.php:420
243
  #@ transposh
244
  msgid "Enable default language translation"
245
  msgstr "אפשר תרגום של שפת ברירת המחדל"
246
 
247
- #: wp/transposh_admin.php:422
248
  #@ transposh
249
  msgid "Allow translation of default language - useful for sites with more than one major language"
250
  msgstr "אפשר תרגום שפת ברירת המחדל - שימושי באתרים עם יותר משפה עיקרית אחת"
251
 
252
- #: wp/transposh_admin.php:429
253
  #@ transposh
254
  msgid "Enable search in translated languages"
255
  msgstr "אפשר חיפוש בשפות המתורגמות"
256
 
257
- #: wp/transposh_admin.php:431
258
  #@ transposh
259
  msgid "Allow search of translated languages, in those languages (and the original language)"
260
  msgstr "אפשר חיפוש בשפות המתורגמות, בשפות אלו (ובשפת המקור)"
261
 
262
- #: wp/transposh_admin.php:440
263
  #@ transposh
264
  msgid "Allow translation of permalinks and urls"
265
  msgstr "אפשר תרגום של קישורים קבועים וכתובות אינטרנט"
266
 
267
- #: wp/transposh_admin.php:460
268
  #@ transposh
269
  msgid "Enable automatic translation"
270
  msgstr "אפשר תרגום אוטומטי"
271
 
272
- #: wp/transposh_admin.php:462
273
  #@ transposh
274
  msgid "Allow automatic translation of pages"
275
  msgstr "אפשר תרגום אוטומטי של דפים"
276
 
277
- #: wp/transposh_admin.php:468
278
  #@ transposh
279
  msgid "Enable automatic translation after posting"
280
  msgstr "אפשר תרגום אוטומטי לאחר יצירת פוסט"
281
 
282
- #: wp/transposh_admin.php:470
283
  #@ transposh
284
  msgid "Do automatic translation immediately after a post has been published"
285
  msgstr "בצע תרגום אוטומטי מייד לאחר שפוסט מפורסם"
286
 
287
- #: wp/transposh_admin.php:475
288
  #@ transposh
289
  msgid "Select preferred auto translation engine"
290
  msgstr "בחר את מנוע התרגום האוטומטי המועדף"
291
 
292
- #: wp/transposh_admin.php:476
293
  #@ transposh
294
  msgid "Translation engine:"
295
  msgstr "מנוע תרגום:"
296
 
297
- #: wp/transposh_admin.php:478
298
  #@ transposh
299
  msgid "Google"
300
  msgstr "גוגל"
301
 
302
- #: wp/transposh_admin.php:479
303
  #@ transposh
304
  msgid "Bing"
305
  msgstr "בינג"
306
 
307
- #: wp/transposh_admin.php:489
308
  #@ transposh
309
  msgid "Rewrite URLs"
310
  msgstr "שיכתוב כתובות אינטרנט"
311
 
312
- #: wp/transposh_admin.php:500
313
  #@ transposh
314
  msgid "Add scripts to footer"
315
  msgstr "הוסף סקריפטים לתחתית הדף"
316
 
317
- #: wp/transposh_admin.php:503
318
  #@ transposh
319
  msgid "Push transposh scripts to footer of page instead of header, makes pages load faster. Requires that your theme should have proper footer support."
320
  msgstr "הכנס את הסקריפטים של טרנספוש לתחתית העמוד במקום לחלקו העליון, העמוד יטען מהר יותר. ערכת העיצוב חייבת להכיל תמיכה בחלק תחתון."
321
 
322
- #: wp/transposh_admin.php:509
323
  #@ transposh
324
  msgid "Auto detect language for users"
325
  msgstr "זהה שפה עבור המשתמשים באופן אוטומטי"
326
 
327
- #: wp/transposh_admin.php:512
328
  #@ transposh
329
  msgid "This enables auto detection of language used by the user as defined in the ACCEPT_LANGUAGES they send. This will redirect the first page accessed in the session to the same page with the detected language."
330
  msgstr "תכונה זו מאפשרת זיהוי אוטומטי של השפה בה משתמשים המשתמשים כפי שמוגדרת ב-ACCEPT_LANGUAGES אותו הם שולחים. תכונה זו תשלח את הדף הראשון אל דף זהה בשפה שזוהתה."
331
 
332
- #: wp/transposh_admin.php:522
333
  #@ transposh
334
  msgid "Delete all automated translations"
335
  msgstr "מחק את כל התרגומים האוטומטיים"
336
 
337
- #: wp/transposh_admin.php:523
338
  #@ transposh
339
  msgid "Delete automated translations older than 14 days"
340
  msgstr "מחק תרגומים אוטומטיים בני יותר מ-14 ימים"
341
 
342
- #: wp/transposh_admin.php:527
343
  #@ transposh
344
  msgid "Backup service for human translation"
345
  msgstr "שרות גיבוי לתרגום אנושי"
346
 
347
- #: wp/transposh_admin.php:528
348
  #@ transposh
349
  msgid "Enable daily backup"
350
  msgstr "אפשר גיבוי יומי"
351
 
352
- #: wp/transposh_admin.php:529
353
  #@ transposh
354
  msgid "Enable live backup"
355
  msgstr "אפשר גיבוי חי"
356
 
357
- #: wp/transposh_admin.php:530
358
  #@ transposh
359
  msgid "Disable backup (Can be run manually by clicking the button below)"
360
  msgstr "בטל גיבוי (ניתן להריץ ידנית על ידי לחיצה על הכפתור למטה)"
361
 
362
- #: wp/transposh_admin.php:531
363
  #@ transposh
364
  msgid "How to restore?"
365
  msgstr "איך לשחזר?"
366
 
367
- #: wp/transposh_admin.php:533
368
  #@ transposh
369
  msgid "Do Backup Now"
370
  msgstr "גבה עכשיו"
371
 
372
- #: wp/transposh_admin.php:139
373
  #@ transposh
374
  msgid "Transposh makes your blog translatable"
375
  msgstr "טרנספוש הופך את הבלוג שלך לניתן לתרגום"
376
 
377
- #: wp/transposh_admin.php:140
378
  #@ transposh
379
  msgid "Plugin homepage"
380
  msgstr "עמוד הבית של התוסף"
381
 
382
- #: wp/transposh_admin.php:141
383
  #@ transposh
384
  msgid "Frequently asked questions"
385
  msgstr "שאלות נפוצות"
386
 
387
- #: wp/transposh_admin.php:149
388
  #@ transposh
389
  msgid "Transposh control center"
390
  msgstr "מרכז השליטה של טרנספוש"
391
 
392
- #: wp/transposh_admin.php:438
393
  #@ transposh
394
  msgid "Enable url translation"
395
  msgstr "אפשר תרגום כתובות אינטרנט"
396
 
397
- #: wp/transposh_admin.php:438
398
  #: wp/transposh_admin.php:448
399
  #@ transposh
400
  msgid "experimental"
401
  msgstr "נסיוני"
402
 
403
- #: wp/transposh_admin.php:493
404
  #@ transposh
405
  msgid "Rewrite URLs to be search engine friendly, e.g. (http://transposh.org/<strong>en</strong>). Requires that permalinks will be enabled."
406
  msgstr "שכתוב כתובות אינטרנט כדי שיהיו ידידותיות למנועי חיפוש, למשל (http://transposh.org/<strong>en</strong>). יש חובה להפעיל קישורים קבועים."
407
 
408
- #: wp/transposh_db.php:525
409
  #@ transposh
410
  msgid "Database stats"
411
  msgstr "סטטיסטיקות בסיס הנתונים"
412
 
413
- #: wp/transposh_db.php:530
414
  #, php-format
415
  #@ transposh
416
  msgid "Total of <strong style=\"color:red\">%s</strong> translated phrases."
417
  msgstr "סך הכל <strong style=\"color:red\">%s</strong> מקטעים מתורגמים."
418
 
419
- #: wp/transposh_db.php:537
420
  #, php-format
421
  #@ transposh
422
  msgid "<strong>%1s</strong> has <strong style=\"color:red\">%2s</strong> human translated phrases."
423
  msgstr "ב-<strong>%1s</strong> ישנם <strong style=\"color:red\">%2s</strong> מקטעים מתורגמים על ידי בן אדם."
424
 
425
- #: wp/transposh_db.php:540
426
  #@ transposh
427
  msgid "Recent activity"
428
  msgstr "פעילות אחרונה"
429
 
430
- #: wp/transposh_db.php:545
431
  #, php-format
432
  #@ transposh
433
  msgid "On <strong>%1s</strong><br/>user <strong>%2s</strong> translated<br/>\"<strong>%3s</strong>\"<br/>to <strong style=\"color:red\">%4s</strong><br/>\"<strong>%5s</strong>\""
434
  msgstr "ב <strong>%1s</strong><br/>המשתמש <strong>%2s</strong> תרגם את<br/>\"<strong>%3s</strong>\"<br/>ל <strong style=\"color:red\">%4s</strong><br/>\"<strong>%5s</strong>\""
435
 
436
- #: wp/transposh_widget.php:332
437
  #@ transposh
438
  msgid "Style:"
439
  msgstr "סגנון:"
440
 
441
- #: wp/transposh_widget.php:341
442
  #@ transposh
443
  msgid "Effects:"
444
  msgstr "אפקטים:"
445
 
446
- #: wp/transposh_widget.php:343
447
  #@ transposh
448
  msgid "Show progress bar when a client triggers automatic translation"
449
  msgstr "הראה בר התקדמות בעת שמשתמש יוזם תרגום אוטומטי"
450
 
451
- #: wp/transposh_widget.php:343
452
  #@ transposh
453
  msgid "Show progress bar"
454
  msgstr "הצג בר התקדמות"
455
 
456
- #: wp/transposh_widget.php:345
457
  #@ transposh
458
  msgid "Widget will allow setting this language as user default"
459
  msgstr "הישומון יאפשר הגדרת שפה זו כברירת מחדל"
460
 
461
- #: wp/transposh_widget.php:345
462
  #@ transposh
463
  msgid "Allow user to set current language as default"
464
  msgstr "אפשר למשתמש לבחור את השפה הנוכחית כברירת מחדל"
465
 
466
- #: wp/transposh_widget.php:347
467
  #@ transposh
468
  msgid "Transposh logo will not appear on widget"
469
  msgstr "הלוגו של טרנספוש לא יופיע בישומון"
470
 
471
- #: wp/transposh_widget.php:347
472
  #@ transposh
473
  msgid "Remove transposh logo (see <a href=\"http://transposh.org/logoterms\">terms</a>)"
474
  msgstr "הסרת הלוגו של טרנספוש (ראה <a href=\"http://transposh.org/logoterms\">תנאים</a>)"
475
 
476
- #: wp/transposh_admin.php:531
477
  #@ transposh
478
  msgid "Service Key:"
479
  msgstr "מפתח שרות:"
480
 
481
- #: wp/transposh_widget.php:221
482
  #@ transposh
483
  msgid "Set as default language"
484
  msgstr "הגדר כשפת ברירת מחדל"
@@ -515,12 +517,12 @@ msgstr "צוות טרנספוש"
515
  msgid "%VERSION%"
516
  msgstr ""
517
 
518
- #: transposh.php:691
519
  #@ default
520
  msgid "Settings"
521
  msgstr ""
522
 
523
- #: wp/transposh_admin.php:235
524
  #@ default
525
  msgid "Save Changes"
526
  msgstr ""
19
  "X-Poedit-SearchPath-0: .\n"
20
  "X-Textdomain-Support: yes"
21
 
22
+ #: wp/transposh_3rdparty.php:147
23
  #, php-format
24
  #@ buddypress
25
  msgid "%s translated a phrase to %s with transposh:"
26
  msgstr "%s תרגם פסקה ל-%s בעזרת טרנספוש:"
27
 
28
+ #: wp/transposh_admin.php:260
29
  #@ transposh
30
  msgid "Problems?"
31
  msgstr "בעיות?"
35
  msgid "Transposh language selection widget"
36
  msgstr "ישומון בחירת השפה של טרנספוש"
37
 
38
+ #: wp/transposh_widget.php:209
39
  #@ transposh
40
  msgid "Translation"
41
  msgstr "תרגום"
42
 
43
+ #: wp/transposh_admin.php:190
44
  #@ transposh
45
  msgid "About this plugin"
46
  msgstr "אודות תוסף זה"
47
 
48
+ #: wp/transposh_admin.php:191
49
  #@ transposh
50
  msgid "Widget settings"
51
  msgstr "הגדרות ישומון"
52
 
53
+ #: wp/transposh_admin.php:192
54
  #@ transposh
55
  msgid "Plugin news"
56
  msgstr "חדשות התוסף"
57
 
58
+ #: wp/transposh_admin.php:193
59
  #@ transposh
60
  msgid "Plugin stats"
61
  msgstr "סטטיסטיקות התוסף"
62
 
63
+ #: wp/transposh_admin.php:194
64
  #@ transposh
65
  msgid "Translate all"
66
  msgstr "תרגם הכל"
67
 
68
+ #: wp/transposh_admin.php:195
69
  #@ transposh
70
  msgid "Supported languages"
71
  msgstr "שפות נתמכות"
72
 
73
+ #: wp/transposh_admin.php:196
74
  #@ transposh
75
  msgid "Translation settings"
76
  msgstr "הגדרות תרגום"
77
 
78
+ #: wp/transposh_admin.php:197
79
  #@ transposh
80
  msgid "Automatic translation settings"
81
  msgstr "הגדרות תרגום אוטומטי"
82
 
83
+ #: wp/transposh_admin.php:198
84
  #@ transposh
85
  msgid "Generic settings"
86
  msgstr "הגדרות כלליות"
87
 
88
+ #: wp/transposh_admin.php:199
89
  #@ transposh
90
  msgid "Database maintenance"
91
  msgstr "תחזוקת בסיס הנתונים"
92
 
93
+ #: wp/transposh_admin.php:208
94
  #@ transposh
95
  msgid "Transposh community features"
96
  msgstr "תכונות קהילתיות בטרנספוש"
97
 
98
+ #: wp/transposh_admin.php:150
99
+ #: wp/transposh_admin.php:215
100
+ #: wp/transposh_postpublish.php:49
101
+ #: wp/transposh_postpublish.php:50
102
  #: wp/transposh_widget.php:88
103
  #: wp/transposh_widget.php:91
104
+ #: wp/transposh_widget.php:254
105
  #@ transposh
106
  msgid "Transposh"
107
  msgstr "טרנספוש"
108
 
109
+ #: wp/transposh_admin.php:302
110
  #@ transposh
111
  msgid "Translate by clicking the button below"
112
  msgstr "תרגם על ידי לחיצה על הכפתור למטה"
113
 
114
+ #: wp/transposh_admin.php:303
115
  #@ transposh
116
  msgid "Translate All Now"
117
  msgstr "תרגם הכל עכשיו"
118
 
119
+ #: transposh.php:650
120
  #@ transposh
121
  msgctxt "Edit Interface"
122
  msgid "Edit Translation"
123
  msgstr "עריכת תרגום"
124
 
125
+ #: transposh.php:651
126
  #@ transposh
127
  msgctxt "Edit Interface"
128
  msgid "Translate"
129
  msgstr "תרגם"
130
 
131
+ #: transposh.php:652
132
  #@ transposh
133
  msgctxt "Edit Interface"
134
  msgid "History"
135
  msgstr "היסטוריה"
136
 
137
+ #: transposh.php:653
138
  #@ transposh
139
  msgctxt "Edit Interface"
140
  msgid "Original Text"
141
  msgstr "טקסט מקורי"
142
 
143
+ #: transposh.php:654
144
  #@ transposh
145
  msgctxt "Edit Interface"
146
  msgid "Translate To"
147
  msgstr "תרגם ל"
148
 
149
+ #: wp/transposh_admin.php:278
150
  #@ transposh
151
  msgid "Plugin Homepage"
152
  msgstr "עמוד הבית של התוסף"
153
 
154
+ #: wp/transposh_admin.php:279
155
  #@ transposh
156
  msgid "Suggest a Feature"
157
  msgstr "הצע תכונה"
158
 
159
+ #: wp/transposh_admin.php:281
160
  #@ transposh
161
  msgid "Report a Bug"
162
  msgstr "דווח על באג"
163
 
164
+ #: wp/transposh_admin.php:360
165
  #@ transposh
166
  msgid "Default Language (drag another language here to make it default)"
167
  msgstr "שפת ברירת המחדל (גרור שפה אחרת לכאן על מנת להפכה לברירת מחדל)"
168
 
169
+ #: wp/transposh_admin.php:367
170
  #@ transposh
171
  msgid "Available Languages (Click to toggle language state - Drag to sort in the widget)"
172
  msgstr "שפות זמינות (הקלק כדי לשנות את סטטוס השפה - גרור כדי למיין בישומון)"
173
 
174
+ #: wp/transposh_admin.php:377
175
  #@ transposh
176
  msgid "Language supported by google translate"
177
  msgstr "שפה נתמכת ע\"י המתרגם של גוגל"
178
 
179
+ #: wp/transposh_admin.php:379
180
  #@ transposh
181
  msgid "Language supported by bing translate"
182
  msgstr "שפה נתמכת ע\"י המתרגם של בינג"
183
 
184
+ #: wp/transposh_admin.php:381
185
  #@ transposh
186
  msgid "Language is written from right to left"
187
  msgstr "שפה הנכתבת מימין לשמאל"
188
 
189
+ #: wp/transposh_admin.php:386
190
  #@ transposh
191
  msgid "Display options:"
192
  msgstr "הגדרות תצוגה:"
193
 
194
+ #: wp/transposh_admin.php:387
195
  #@ transposh
196
  msgid "Toggle names of languages between English and Original"
197
  msgstr "שנה את הצגת שפות השפות בין אנגלית למקןר"
198
 
199
+ #: wp/transposh_admin.php:388
200
  #@ transposh
201
  msgid "Make all languages active"
202
  msgstr "הפוך את כל השפות לפעילות"
203
 
204
+ #: wp/transposh_admin.php:389
205
  #@ transposh
206
  msgid "Sort by language name"
207
  msgstr "מיין לפי שם השפה"
208
 
209
+ #: wp/transposh_admin.php:390
210
  #@ transposh
211
  msgid "Sort by lSO code"
212
  msgstr "מיין לפי קוד ה-ISO"
213
 
214
+ #: wp/transposh_admin.php:391
215
  #@ transposh
216
  msgid "Legend:"
217
  msgstr "מקרא:"
218
 
219
+ #: wp/transposh_admin.php:391
220
  #@ transposh
221
  msgid "Green - active"
222
  msgstr "ירוק - פעיל"
223
 
224
+ #: wp/transposh_admin.php:391
225
  #@ transposh
226
  msgid "Yellow - translateable (only translators will see this language)"
227
  msgstr "צהוב - ניתן לתרגום (רק מתרגמים יראו את השפה)"
228
 
229
+ #: wp/transposh_admin.php:391
230
  #@ transposh
231
  msgid "blank - inactive"
232
  msgstr "ללא צבע - לא פעיל"
233
 
234
+ #: wp/transposh_admin.php:408
235
  #@ transposh
236
  msgid "Who can translate ?"
237
  msgstr "מי יכול לתרגם?"
238
 
239
+ #: wp/transposh_admin.php:415
240
  #@ transposh
241
  msgid "Anonymous"
242
  msgstr "אנונימי"
243
 
244
+ #: wp/transposh_admin.php:421
245
  #@ transposh
246
  msgid "Enable default language translation"
247
  msgstr "אפשר תרגום של שפת ברירת המחדל"
248
 
249
+ #: wp/transposh_admin.php:423
250
  #@ transposh
251
  msgid "Allow translation of default language - useful for sites with more than one major language"
252
  msgstr "אפשר תרגום שפת ברירת המחדל - שימושי באתרים עם יותר משפה עיקרית אחת"
253
 
254
+ #: wp/transposh_admin.php:430
255
  #@ transposh
256
  msgid "Enable search in translated languages"
257
  msgstr "אפשר חיפוש בשפות המתורגמות"
258
 
259
+ #: wp/transposh_admin.php:432
260
  #@ transposh
261
  msgid "Allow search of translated languages, in those languages (and the original language)"
262
  msgstr "אפשר חיפוש בשפות המתורגמות, בשפות אלו (ובשפת המקור)"
263
 
264
+ #: wp/transposh_admin.php:441
265
  #@ transposh
266
  msgid "Allow translation of permalinks and urls"
267
  msgstr "אפשר תרגום של קישורים קבועים וכתובות אינטרנט"
268
 
269
+ #: wp/transposh_admin.php:459
270
  #@ transposh
271
  msgid "Enable automatic translation"
272
  msgstr "אפשר תרגום אוטומטי"
273
 
274
+ #: wp/transposh_admin.php:461
275
  #@ transposh
276
  msgid "Allow automatic translation of pages"
277
  msgstr "אפשר תרגום אוטומטי של דפים"
278
 
279
+ #: wp/transposh_admin.php:467
280
  #@ transposh
281
  msgid "Enable automatic translation after posting"
282
  msgstr "אפשר תרגום אוטומטי לאחר יצירת פוסט"
283
 
284
+ #: wp/transposh_admin.php:469
285
  #@ transposh
286
  msgid "Do automatic translation immediately after a post has been published"
287
  msgstr "בצע תרגום אוטומטי מייד לאחר שפוסט מפורסם"
288
 
289
+ #: wp/transposh_admin.php:474
290
  #@ transposh
291
  msgid "Select preferred auto translation engine"
292
  msgstr "בחר את מנוע התרגום האוטומטי המועדף"
293
 
294
+ #: wp/transposh_admin.php:475
295
  #@ transposh
296
  msgid "Translation engine:"
297
  msgstr "מנוע תרגום:"
298
 
299
+ #: wp/transposh_admin.php:477
300
  #@ transposh
301
  msgid "Google"
302
  msgstr "גוגל"
303
 
304
+ #: wp/transposh_admin.php:478
305
  #@ transposh
306
  msgid "Bing"
307
  msgstr "בינג"
308
 
309
+ #: wp/transposh_admin.php:488
310
  #@ transposh
311
  msgid "Rewrite URLs"
312
  msgstr "שיכתוב כתובות אינטרנט"
313
 
314
+ #: wp/transposh_admin.php:499
315
  #@ transposh
316
  msgid "Add scripts to footer"
317
  msgstr "הוסף סקריפטים לתחתית הדף"
318
 
319
+ #: wp/transposh_admin.php:502
320
  #@ transposh
321
  msgid "Push transposh scripts to footer of page instead of header, makes pages load faster. Requires that your theme should have proper footer support."
322
  msgstr "הכנס את הסקריפטים של טרנספוש לתחתית העמוד במקום לחלקו העליון, העמוד יטען מהר יותר. ערכת העיצוב חייבת להכיל תמיכה בחלק תחתון."
323
 
324
+ #: wp/transposh_admin.php:508
325
  #@ transposh
326
  msgid "Auto detect language for users"
327
  msgstr "זהה שפה עבור המשתמשים באופן אוטומטי"
328
 
329
+ #: wp/transposh_admin.php:511
330
  #@ transposh
331
  msgid "This enables auto detection of language used by the user as defined in the ACCEPT_LANGUAGES they send. This will redirect the first page accessed in the session to the same page with the detected language."
332
  msgstr "תכונה זו מאפשרת זיהוי אוטומטי של השפה בה משתמשים המשתמשים כפי שמוגדרת ב-ACCEPT_LANGUAGES אותו הם שולחים. תכונה זו תשלח את הדף הראשון אל דף זהה בשפה שזוהתה."
333
 
334
+ #: wp/transposh_admin.php:521
335
  #@ transposh
336
  msgid "Delete all automated translations"
337
  msgstr "מחק את כל התרגומים האוטומטיים"
338
 
339
+ #: wp/transposh_admin.php:522
340
  #@ transposh
341
  msgid "Delete automated translations older than 14 days"
342
  msgstr "מחק תרגומים אוטומטיים בני יותר מ-14 ימים"
343
 
344
+ #: wp/transposh_admin.php:526
345
  #@ transposh
346
  msgid "Backup service for human translation"
347
  msgstr "שרות גיבוי לתרגום אנושי"
348
 
349
+ #: wp/transposh_admin.php:527
350
  #@ transposh
351
  msgid "Enable daily backup"
352
  msgstr "אפשר גיבוי יומי"
353
 
354
+ #: wp/transposh_admin.php:528
355
  #@ transposh
356
  msgid "Enable live backup"
357
  msgstr "אפשר גיבוי חי"
358
 
359
+ #: wp/transposh_admin.php:529
360
  #@ transposh
361
  msgid "Disable backup (Can be run manually by clicking the button below)"
362
  msgstr "בטל גיבוי (ניתן להריץ ידנית על ידי לחיצה על הכפתור למטה)"
363
 
364
+ #: wp/transposh_admin.php:530
365
  #@ transposh
366
  msgid "How to restore?"
367
  msgstr "איך לשחזר?"
368
 
369
+ #: wp/transposh_admin.php:532
370
  #@ transposh
371
  msgid "Do Backup Now"
372
  msgstr "גבה עכשיו"
373
 
374
+ #: wp/transposh_admin.php:140
375
  #@ transposh
376
  msgid "Transposh makes your blog translatable"
377
  msgstr "טרנספוש הופך את הבלוג שלך לניתן לתרגום"
378
 
379
+ #: wp/transposh_admin.php:141
380
  #@ transposh
381
  msgid "Plugin homepage"
382
  msgstr "עמוד הבית של התוסף"
383
 
384
+ #: wp/transposh_admin.php:142
385
  #@ transposh
386
  msgid "Frequently asked questions"
387
  msgstr "שאלות נפוצות"
388
 
389
+ #: wp/transposh_admin.php:150
390
  #@ transposh
391
  msgid "Transposh control center"
392
  msgstr "מרכז השליטה של טרנספוש"
393
 
394
+ #: wp/transposh_admin.php:439
395
  #@ transposh
396
  msgid "Enable url translation"
397
  msgstr "אפשר תרגום כתובות אינטרנט"
398
 
399
+ #: wp/transposh_admin.php:439
400
  #: wp/transposh_admin.php:448
401
  #@ transposh
402
  msgid "experimental"
403
  msgstr "נסיוני"
404
 
405
+ #: wp/transposh_admin.php:492
406
  #@ transposh
407
  msgid "Rewrite URLs to be search engine friendly, e.g. (http://transposh.org/<strong>en</strong>). Requires that permalinks will be enabled."
408
  msgstr "שכתוב כתובות אינטרנט כדי שיהיו ידידותיות למנועי חיפוש, למשל (http://transposh.org/<strong>en</strong>). יש חובה להפעיל קישורים קבועים."
409
 
410
+ #: wp/transposh_db.php:531
411
  #@ transposh
412
  msgid "Database stats"
413
  msgstr "סטטיסטיקות בסיס הנתונים"
414
 
415
+ #: wp/transposh_db.php:536
416
  #, php-format
417
  #@ transposh
418
  msgid "Total of <strong style=\"color:red\">%s</strong> translated phrases."
419
  msgstr "סך הכל <strong style=\"color:red\">%s</strong> מקטעים מתורגמים."
420
 
421
+ #: wp/transposh_db.php:543
422
  #, php-format
423
  #@ transposh
424
  msgid "<strong>%1s</strong> has <strong style=\"color:red\">%2s</strong> human translated phrases."
425
  msgstr "ב-<strong>%1s</strong> ישנם <strong style=\"color:red\">%2s</strong> מקטעים מתורגמים על ידי בן אדם."
426
 
427
+ #: wp/transposh_db.php:546
428
  #@ transposh
429
  msgid "Recent activity"
430
  msgstr "פעילות אחרונה"
431
 
432
+ #: wp/transposh_db.php:551
433
  #, php-format
434
  #@ transposh
435
  msgid "On <strong>%1s</strong><br/>user <strong>%2s</strong> translated<br/>\"<strong>%3s</strong>\"<br/>to <strong style=\"color:red\">%4s</strong><br/>\"<strong>%5s</strong>\""
436
  msgstr "ב <strong>%1s</strong><br/>המשתמש <strong>%2s</strong> תרגם את<br/>\"<strong>%3s</strong>\"<br/>ל <strong style=\"color:red\">%4s</strong><br/>\"<strong>%5s</strong>\""
437
 
438
+ #: wp/transposh_widget.php:333
439
  #@ transposh
440
  msgid "Style:"
441
  msgstr "סגנון:"
442
 
443
+ #: wp/transposh_widget.php:342
444
  #@ transposh
445
  msgid "Effects:"
446
  msgstr "אפקטים:"
447
 
448
+ #: wp/transposh_widget.php:344
449
  #@ transposh
450
  msgid "Show progress bar when a client triggers automatic translation"
451
  msgstr "הראה בר התקדמות בעת שמשתמש יוזם תרגום אוטומטי"
452
 
453
+ #: wp/transposh_widget.php:344
454
  #@ transposh
455
  msgid "Show progress bar"
456
  msgstr "הצג בר התקדמות"
457
 
458
+ #: wp/transposh_widget.php:346
459
  #@ transposh
460
  msgid "Widget will allow setting this language as user default"
461
  msgstr "הישומון יאפשר הגדרת שפה זו כברירת מחדל"
462
 
463
+ #: wp/transposh_widget.php:346
464
  #@ transposh
465
  msgid "Allow user to set current language as default"
466
  msgstr "אפשר למשתמש לבחור את השפה הנוכחית כברירת מחדל"
467
 
468
+ #: wp/transposh_widget.php:348
469
  #@ transposh
470
  msgid "Transposh logo will not appear on widget"
471
  msgstr "הלוגו של טרנספוש לא יופיע בישומון"
472
 
473
+ #: wp/transposh_widget.php:348
474
  #@ transposh
475
  msgid "Remove transposh logo (see <a href=\"http://transposh.org/logoterms\">terms</a>)"
476
  msgstr "הסרת הלוגו של טרנספוש (ראה <a href=\"http://transposh.org/logoterms\">תנאים</a>)"
477
 
478
+ #: wp/transposh_admin.php:530
479
  #@ transposh
480
  msgid "Service Key:"
481
  msgstr "מפתח שרות:"
482
 
483
+ #: wp/transposh_widget.php:222
484
  #@ transposh
485
  msgid "Set as default language"
486
  msgstr "הגדר כשפת ברירת מחדל"
517
  msgid "%VERSION%"
518
  msgstr ""
519
 
520
+ #: transposh.php:753
521
  #@ default
522
  msgid "Settings"
523
  msgstr ""
524
 
525
+ #: wp/transposh_admin.php:236
526
  #@ default
527
  msgid "Save Changes"
528
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://transposh.org/donate/
4
  Tags: translation, widget, filter, buddypress, bilingual, multilingual, transposh, translate, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
5
  Requires at least: 2.8
6
  Tested up to: 3.0.1
7
- Stable tag: 0.6.4
8
 
9
  Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
10
 
@@ -193,6 +193,12 @@ This version provides integration with google-sitemaps-xml and wp-super-cache
193
  This version allows sorting of languages within the widget
194
 
195
  == Changelog ==
 
 
 
 
 
 
196
  = 2010/10/13 - 0.6.4 =
197
  * Support for translation of our interface and admin pages
198
  * Hebrew translation for transposh
4
  Tags: translation, widget, filter, buddypress, bilingual, multilingual, transposh, translate, language, crowdsourcing, context, wiki, RTL, Hebrew, Spanish, French, Russian, English, Arabic, Portuguese
5
  Requires at least: 2.8
6
  Tested up to: 3.0.1
7
+ Stable tag: 0.6.5
8
 
9
  Transposh filter allows in context quick translation of websites, it allows you to crowd-source the translation to your users
10
 
193
  This version allows sorting of languages within the widget
194
 
195
  == Changelog ==
196
+ = 2010/10/25 - 0.6.5 =
197
+ * Fixed Slovenian flag bug reported by anphicle
198
+ * Added support for rel alternate in the headers - see http://googlewebmastercentral.blogspot.com/2010/09/unifying-content-under-multilingual.html
199
+ * Fixed bug with canonical redirects and url rewritings as reported by Marco
200
+ * Fixed a bug with translate all and after post translation which hindered their ability to work - (thanks nightsurfer [#122](http://trac.transposh.org/ticket/122))
201
+ * Fixed json translation for buddypress stream issue - (thanks Inocima [#121](http://trac.transposh.org/ticket/121))
202
  = 2010/10/13 - 0.6.4 =
203
  * Support for translation of our interface and admin pages
204
  * Hebrew translation for transposh
transposh.php CHANGED
@@ -5,7 +5,7 @@
5
  Plugin URI: http://transposh.org/
6
  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>.
7
  Author: Team Transposh
8
- Version: 0.6.4
9
  Author URI: http://transposh.org/
10
  License: GPL (http://www.gnu.org/licenses/gpl.txt)
11
  Text Domain: transposh
@@ -13,14 +13,14 @@
13
  */
14
 
15
  /*
16
- * Transposh v0.6.4
17
  * http://transposh.org/
18
  *
19
  * Copyright 2010, Team Transposh
20
  * Licensed under the GPL Version 2 or higher.
21
  * http://transposh.org/license
22
  *
23
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
24
  */
25
 
26
  //avoid direct calls to this file where wp core files not present
@@ -66,6 +66,8 @@ class transposh_plugin {
66
  public $home_url;
67
  /** @var string Where the javascript should post to */
68
  public $post_url;
 
 
69
  /** @var string The url to the plugin directory */
70
  public $transposh_plugin_url;
71
  /** @var string The directory of the plugin */
@@ -84,6 +86,8 @@ class transposh_plugin {
84
  private $search_s;
85
  /** @var variable to make sure we only attempt to fix the url once, could have used remove_filter */
86
  private $got_request = false;
 
 
87
 
88
  /**
89
  * class constructor
@@ -132,6 +136,8 @@ class transposh_plugin {
132
  add_action('shutdown', array(&$this, 'on_shutdown'));
133
  add_action('wp_print_styles', array(&$this, 'add_transposh_css'));
134
  add_action('wp_print_scripts', array(&$this, 'add_transposh_js'));
 
 
135
  // add_action('wp_head', array(&$this,'add_transposh_async'));
136
  add_action('transposh_backup_event', array(&$this, 'run_backup'));
137
  add_action('comment_post', array(&$this, 'add_comment_meta_settings'), 1);
@@ -153,6 +159,9 @@ class transposh_plugin {
153
  add_filter('locale', array(&$this, 'transposh_locale_filter'));
154
  }
155
 
 
 
 
156
  //
157
  // FUTURE add_action('update-custom_transposh', array(&$this, 'update'));
158
  // CHECK TODO!!!!!!!!!!!!
@@ -162,6 +171,42 @@ class transposh_plugin {
162
  register_deactivation_hook(__FILE__, array(&$this, 'plugin_deactivate'));
163
  }
164
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  // function update() {
166
  // echo 'hi';
167
  //
@@ -222,6 +267,7 @@ class transposh_plugin {
222
  $parse->lang = $this->target_language;
223
  $parse->default_lang = $this->options->is_default_language($this->target_language);
224
  $parse->is_edit_mode = $this->edit_mode;
 
225
  $parse->is_auto_translate = $this->is_auto_translate_permitted();
226
  $parse->allow_ad = $this->options->get_widget_remove_logo();
227
  // TODO - check this!
@@ -264,6 +310,7 @@ class transposh_plugin {
264
 
265
  if (substr($_SERVER['SCRIPT_FILENAME'], -11) == 'wp-load.php') {
266
  $this->target_language = transposh_utils::get_language_from_url($_SERVER['HTTP_REFERER'], $this->home_url);
 
267
  }
268
 
269
  // load translation files for transposh
@@ -386,6 +433,7 @@ class transposh_plugin {
386
  if ($_COOKIE['TR_LNG'] != $this->target_language) {
387
  $url = transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->home_url, $this->enable_permalinks_rewrite, $_COOKIE['TR_LNG'], $this->edit_mode);
388
  if ($this->options->is_default_language($_COOKIE['TR_LNG']))
 
389
  $url = transposh_utils::cleanup_url($_SERVER["REQUEST_URI"], $this->home_url);
390
 
391
  wp_redirect($url);
@@ -397,6 +445,7 @@ class transposh_plugin {
397
  if ($bestlang && $bestlang != $this->target_language && $this->options->get_enable_detect_language() && !(preg_match("#(bot|yandex|validator|google|jeeves|spider|crawler|slurp)#si", $_SERVER['HTTP_USER_AGENT']))) {
398
  $url = transposh_utils::rewrite_url_lang_param($_SERVER['REQUEST_URI'], $this->home_url, $this->enable_permalinks_rewrite, $bestlang, $this->edit_mode);
399
  if ($this->options->is_default_language($bestlang))
 
400
  $url = transposh_utils::cleanup_url($_SERVER['REQUEST_URI'], $this->home_url);
401
 
402
  wp_redirect($url);
@@ -609,6 +658,19 @@ class transposh_plugin {
609
 
610
  }
611
 
 
 
 
 
 
 
 
 
 
 
 
 
 
612
  /**
613
  * Determine if the currently selected language (taken from the query parameters) is in the admin's list
614
  * of editable languages and the current user is allowed to translate.
@@ -820,6 +882,7 @@ class transposh_plugin {
820
  * @return string wrapped text
821
  */
822
  function post_content_wrap($text) {
 
823
  $lang = get_post_meta($GLOBALS['id'], 'tp_language', true);
824
  if ($lang) {
825
  $text = "<span lang =\"$lang\">" . $text . "</span>";
5
  Plugin URI: http://transposh.org/
6
  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>.
7
  Author: Team Transposh
8
+ Version: 0.6.5
9
  Author URI: http://transposh.org/
10
  License: GPL (http://www.gnu.org/licenses/gpl.txt)
11
  Text Domain: transposh
13
  */
14
 
15
  /*
16
+ * Transposh v0.6.5
17
  * http://transposh.org/
18
  *
19
  * Copyright 2010, Team Transposh
20
  * Licensed under the GPL Version 2 or higher.
21
  * http://transposh.org/license
22
  *
23
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
24
  */
25
 
26
  //avoid direct calls to this file where wp core files not present
66
  public $home_url;
67
  /** @var string Where the javascript should post to */
68
  public $post_url;
69
+ /** @var a url of the request, assuming there was no language */
70
+ private $clean_url;
71
  /** @var string The url to the plugin directory */
72
  public $transposh_plugin_url;
73
  /** @var string The directory of the plugin */
86
  private $search_s;
87
  /** @var variable to make sure we only attempt to fix the url once, could have used remove_filter */
88
  private $got_request = false;
89
+ /** @var might be that page is json... */
90
+ private $attempt_json = false;
91
 
92
  /**
93
  * class constructor
136
  add_action('shutdown', array(&$this, 'on_shutdown'));
137
  add_action('wp_print_styles', array(&$this, 'add_transposh_css'));
138
  add_action('wp_print_scripts', array(&$this, 'add_transposh_js'));
139
+ //TODO - on config
140
+ add_action('wp_head', array(&$this, 'add_rel_alternate'));
141
  // add_action('wp_head', array(&$this,'add_transposh_async'));
142
  add_action('transposh_backup_event', array(&$this, 'run_backup'));
143
  add_action('comment_post', array(&$this, 'add_comment_meta_settings'), 1);
159
  add_filter('locale', array(&$this, 'transposh_locale_filter'));
160
  }
161
 
162
+ // debug function for bad redirects
163
+ // add_filter('wp_redirect', array(&$this, 'on_wp_redirect'), 10, 2);
164
+ add_filter('redirect_canonical', array(&$this, 'on_redirect_canonical'), 10, 2);
165
  //
166
  // FUTURE add_action('update-custom_transposh', array(&$this, 'update'));
167
  // CHECK TODO!!!!!!!!!!!!
171
  register_deactivation_hook(__FILE__, array(&$this, 'plugin_deactivate'));
172
  }
173
 
174
+ // function on_wp_redirect($location, $status) {
175
+ //
176
+ //
177
+ // $trace = debug_backtrace();
178
+ //
179
+ // return $location;
180
+ // }
181
+
182
+ /**
183
+ * Function to fix canonical redirection for some translated urls (such as tags with params)
184
+ * @param string $red - url wordpress assumes it will redirect to
185
+ * @param string $req - url that was originally requested
186
+ * @return mixed false if redirect unneeded - new url if we think we should
187
+ */
188
+ function on_redirect_canonical($red, $req) {
189
+
190
+ // if the urls are actually the same, don't redirect (same - if it had our proper take care of)
191
+ if ($this->rewrite_url($red) == urldecode($req)) return false;
192
+ // if this is not the default language, we need to make sure it redirects to what we believe is the proper url
193
+ if (!$this->options->is_default_language($this->target_language)) {
194
+ $red = str_replace(array('%2F', '%3A', '%3B', '%3F', '%3D', '%26'), array('/', ':', ';', '?', '=', '&'), urlencode($this->rewrite_url($red)));
195
+ }
196
+ return $red;
197
+ }
198
+
199
+ function get_clean_url() {
200
+ if (isset($this->clean_url)) return $this->clean_url;
201
+ //remove any language identifier and find the "clean" url, used for posting and calculating urls if needed
202
+ $this->clean_url = transposh_utils::cleanup_url($_SERVER['REQUEST_URI'], $this->home_url, true);
203
+ // we need this if we are using url translations
204
+ if ($this->options->get_enable_url_translate()) {
205
+ $this->clean_url = transposh_utils::get_original_url($this->clean_url, '', $this->target_language, array($this->database, 'fetch_original'));
206
+ }
207
+ return $this->clean_url;
208
+ }
209
+
210
  // function update() {
211
  // echo 'hi';
212
  //
267
  $parse->lang = $this->target_language;
268
  $parse->default_lang = $this->options->is_default_language($this->target_language);
269
  $parse->is_edit_mode = $this->edit_mode;
270
+ $parse->might_json = $this->attempt_json;
271
  $parse->is_auto_translate = $this->is_auto_translate_permitted();
272
  $parse->allow_ad = $this->options->get_widget_remove_logo();
273
  // TODO - check this!
310
 
311
  if (substr($_SERVER['SCRIPT_FILENAME'], -11) == 'wp-load.php') {
312
  $this->target_language = transposh_utils::get_language_from_url($_SERVER['HTTP_REFERER'], $this->home_url);
313
+ $this->attempt_json = true;
314
  }
315
 
316
  // load translation files for transposh
433
  if ($_COOKIE['TR_LNG'] != $this->target_language) {
434
  $url = transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->home_url, $this->enable_permalinks_rewrite, $_COOKIE['TR_LNG'], $this->edit_mode);
435
  if ($this->options->is_default_language($_COOKIE['TR_LNG']))
436
+ //TODO - fix wrt translation
437
  $url = transposh_utils::cleanup_url($_SERVER["REQUEST_URI"], $this->home_url);
438
 
439
  wp_redirect($url);
445
  if ($bestlang && $bestlang != $this->target_language && $this->options->get_enable_detect_language() && !(preg_match("#(bot|yandex|validator|google|jeeves|spider|crawler|slurp)#si", $_SERVER['HTTP_USER_AGENT']))) {
446
  $url = transposh_utils::rewrite_url_lang_param($_SERVER['REQUEST_URI'], $this->home_url, $this->enable_permalinks_rewrite, $bestlang, $this->edit_mode);
447
  if ($this->options->is_default_language($bestlang))
448
+ //TODO - fix wrt translation
449
  $url = transposh_utils::cleanup_url($_SERVER['REQUEST_URI'], $this->home_url);
450
 
451
  wp_redirect($url);
658
 
659
  }
660
 
661
+ /**
662
+ * Implements - http://googlewebmastercentral.blogspot.com/2010/09/unifying-content-under-multilingual.html
663
+ */
664
+ function add_rel_alternate() {
665
+ $widget_args = $this->widget->create_widget_args(true, $this->get_clean_url());
666
+
667
+ foreach ($widget_args as $lang) {
668
+ if (!$lang['active']) {
669
+ echo '<link rel="alternate" hreflang="' . $lang['isocode'] . '" href="' . $lang['url'] . '"/>';
670
+ }
671
+ }
672
+ }
673
+
674
  /**
675
  * Determine if the currently selected language (taken from the query parameters) is in the admin's list
676
  * of editable languages and the current user is allowed to translate.
882
  * @return string wrapped text
883
  */
884
  function post_content_wrap($text) {
885
+ if (!isset($GLOBALS['id'])) return $text;
886
  $lang = get_post_meta($GLOBALS['id'], 'tp_language', true);
887
  if ($lang) {
888
  $text = "<span lang =\"$lang\">" . $text . "</span>";
widgets/default/tpw_default.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /*
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /*
widgets/dropdown/tpw_image_dropdown.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /**
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /**
widgets/flags/flags59.png CHANGED
Binary file
widgets/flags/tpw_flags.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /**
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /**
widgets/flags/tpw_flags_css.css CHANGED
@@ -83,7 +83,7 @@
83
  .trf-ru {background-position: -1056px 0}
84
  .trf-rs {background-position: -1080px 0}
85
  .trf-sk {background-position: -1104px 0}
86
- .trf-sl {background-position: -1128px 0}
87
  .trf-es {background-position: -1152px 0}
88
  .trf-ke {background-position: -1176px 0}
89
  .trf-se {background-position: -1200px 0}
83
  .trf-ru {background-position: -1056px 0}
84
  .trf-rs {background-position: -1080px 0}
85
  .trf-sk {background-position: -1104px 0}
86
+ .trf-si {background-position: -1128px 0}
87
  .trf-es {background-position: -1152px 0}
88
  .trf-ke {background-position: -1176px 0}
89
  .trf-se {background-position: -1200px 0}
widgets/flags/tpw_flags_css.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /**
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /**
widgets/flagslist/tpw_list_with_flags.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /**
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /**
widgets/flagslist/tpw_list_with_flags_css.php CHANGED
@@ -11,14 +11,14 @@
11
  */
12
 
13
  /*
14
- * Transposh v0.6.4
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
22
  */
23
 
24
  /**
11
  */
12
 
13
  /*
14
+ * Transposh v0.6.5
15
  * http://transposh.org/
16
  *
17
  * Copyright 2010, Team Transposh
18
  * Licensed under the GPL Version 2 or higher.
19
  * http://transposh.org/license
20
  *
21
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
22
  */
23
 
24
  /**
wp/transposh_3rdparty.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
@@ -87,6 +87,7 @@ class transposh_3rdparty {
87
  */
88
  function bp_uri_filter($uri) {
89
  $lang = transposh_utils::get_language_from_url($uri, $this->transposh->home_url);
 
90
  $uri = transposh_utils::cleanup_url($uri, $this->transposh->home_url);
91
  if ($this->transposh->options->get_enable_url_translate()) {
92
  $uri = transposh_utils::get_original_url($uri, '', $lang, array($this->transposh->database, 'fetch_original'));
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
87
  */
88
  function bp_uri_filter($uri) {
89
  $lang = transposh_utils::get_language_from_url($uri, $this->transposh->home_url);
90
+ //TODO - check using get_clean_url
91
  $uri = transposh_utils::cleanup_url($uri, $this->transposh->home_url);
92
  if ($this->transposh->options->get_enable_url_translate()) {
93
  $uri = transposh_utils::get_original_url($uri, '', $lang, array($this->transposh->database, 'fetch_original'));
wp/transposh_admin.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
wp/transposh_ajax.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
wp/transposh_backup.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
wp/transposh_db.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /**
@@ -92,6 +92,7 @@ class transposh_database {
92
  if (!TP_ENABLE_CACHE) return false;
93
  $key = $lang . '_' . $original;
94
  if ($translated !== null) $translated = implode('_', $translated);
 
95
  if (function_exists('apc_store')) {
96
  $rc = apc_store($key, $translated, $ttl);
97
  } elseif (function_exists('xcache_set')) {
@@ -210,9 +211,9 @@ class transposh_database {
210
  * Fetch original from db or cache.
211
  * Returns the original for a given translation.
212
  * Will return NULL if no translation is available.
213
- * @param string $original
214
  * @param string $lang
215
- * @return array list(translation,source)
216
  */
217
  function fetch_original($translation, $lang) {
218
  $original = null;
@@ -300,6 +301,11 @@ class transposh_database {
300
  $loguser = $user_ID;
301
  }
302
 
 
 
 
 
 
303
  // We are now processing all posted items
304
  for ($i = 0; $i < $items; $i++) {
305
  if (isset($_POST["tk$i"])) {
@@ -324,7 +330,7 @@ class transposh_database {
324
  if ($source == 0) $backup_immidiate_possible = true;
325
 
326
  //Here we check we are not redoing stuff
327
- list($translated_text, $old_source) = $this->fetch_translation($original, $lang);
328
  if ($translated_text) {
329
  if ($source > 0) {
330
 
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /**
92
  if (!TP_ENABLE_CACHE) return false;
93
  $key = $lang . '_' . $original;
94
  if ($translated !== null) $translated = implode('_', $translated);
95
+ $rc = false;
96
  if (function_exists('apc_store')) {
97
  $rc = apc_store($key, $translated, $ttl);
98
  } elseif (function_exists('xcache_set')) {
211
  * Fetch original from db or cache.
212
  * Returns the original for a given translation.
213
  * Will return NULL if no translation is available.
214
+ * @param string $translation
215
  * @param string $lang
216
+ * @return string $original
217
  */
218
  function fetch_original($translation, $lang) {
219
  $original = null;
301
  $loguser = $user_ID;
302
  }
303
 
304
+ // reset values (for good code style)
305
+ $values = '';
306
+ $delvalues = '';
307
+ $logvalues = '';
308
+ $backup_immidiate_possible = false;
309
  // We are now processing all posted items
310
  for ($i = 0; $i < $items; $i++) {
311
  if (isset($_POST["tk$i"])) {
330
  if ($source == 0) $backup_immidiate_possible = true;
331
 
332
  //Here we check we are not redoing stuff
333
+ list($old_source, $translated_text) = $this->fetch_translation($original, $lang);
334
  if ($translated_text) {
335
  if ($source > 0) {
336
 
wp/transposh_options.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  // OLD Options - To be removed
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  // OLD Options - To be removed
wp/transposh_postpublish.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
@@ -46,12 +46,13 @@ class transposh_postpublish {
46
  function on_admin_menu() {
47
  //add our metabox to the post and pubish pages
48
 
49
- add_meta_box('transposh_postpublish', 'Transposh', array(&$this, "transposh_postpublish_box"), 'post', 'side', 'core');
50
- add_meta_box('transposh_postpublish', 'Transposh', array(&$this, "transposh_postpublish_box"), 'page', 'side', 'core');
51
- if ($_GET['justedited']) {
52
- //wp_enqueue_script("google", "http://www.google.com/jsapi", array(), '1', true);
53
- wp_enqueue_script("transposh", $this->transposh->transposh_plugin_url . '/' . TRANSPOSH_DIR_JS . '/transposhadmin.js', array('jquery'), TRANSPOSH_PLUGIN_VER, true);
54
- wp_localize_script("transposh", "t_jp", array(
 
55
  'post_url' => $this->transposh->post_url,
56
  'post' => $_GET['post'],
57
  'preferred' => $this->transposh->options->get_preferred_translator(),
@@ -68,6 +69,7 @@ class transposh_postpublish {
68
  ));
69
  wp_enqueue_style('jqueryui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-lightness/jquery-ui.css', array(), '1.8.2');
70
  wp_enqueue_script('jqueryui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js', array('jquery'), '1.8.2', true);
 
71
  }
72
  }
73
 
@@ -131,9 +133,9 @@ class transposh_postpublish {
131
  // if this isn't the default language or we specifically allow default language translation, we will seek this out...
132
  // as we don't normally want to auto-translate the default language -FIX THIS to include only correct stuff, how?
133
  if (!$this->transposh->options->is_default_language($lang) || $this->transposh->options->get_enable_default_translate()) {
134
- // There is no point in returning phrases, languages pairs that cannot be translated
135
  if (in_array($lang, transposh_consts::$bing_languages) || in_array($lang, transposh_consts::$google_languages)) {
136
- list($translation, $source) = $this->transposh->database->fetch_translation($key, $lang);
137
  if (!$translation) {
138
  // p stands for phrases, l stands for languages, t is token
139
  if (!is_array($json['p'][$key]['l'])) {
@@ -165,7 +167,7 @@ class transposh_postpublish {
165
  */
166
  function transposh_postpublish_box() {
167
  // the nonce will help double translation if time has passed
168
- if ($_GET['justedited'] && wp_verify_nonce($_GET['justedited']))
169
  $this->just_published = true;
170
 
171
  if ($this->just_published) {
@@ -176,21 +178,13 @@ class transposh_postpublish {
176
  }
177
 
178
  /**
179
- * When this happens, the boxes are not created and a redirect happens, we currently use this to inform the next stage we are involved
180
  * @param int $postID
181
  */
182
  function on_edit($postID) {
183
- add_filter('wp_redirect', array(&$this, 'inform_published'));
184
- }
185
-
186
- /**
187
- * We add the justedited param here
188
- * @param string $url Original URL
189
- * @return string redirected URL
190
- */
191
- function inform_published($url) {
192
- return add_query_arg('justedited', wp_create_nonce(), $url);
193
  }
194
 
195
  }
 
196
  ?>
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
46
  function on_admin_menu() {
47
  //add our metabox to the post and pubish pages
48
 
49
+ add_meta_box('transposh_postpublish', __('Transposh', TRANSPOSH_TEXT_DOMAIN), array(&$this, "transposh_postpublish_box"), 'post', 'side', 'core');
50
+ add_meta_box('transposh_postpublish', __('Transposh', TRANSPOSH_TEXT_DOMAIN), array(&$this, "transposh_postpublish_box"), 'page', 'side', 'core');
51
+ if (!isset($_GET['post'])) return;
52
+ if (get_post_meta($_GET['post'], 'transposh_can_translate', true)) { // do isdefined stuff
53
+ $this->just_published = true; // this is later used in the meta boxes
54
+ wp_enqueue_script("transposhadmin", $this->transposh->transposh_plugin_url . '/' . TRANSPOSH_DIR_JS . '/transposhadmin.js', array('jquery'), TRANSPOSH_PLUGIN_VER, true);
55
+ wp_localize_script("transposhadmin", "t_jp", array(
56
  'post_url' => $this->transposh->post_url,
57
  'post' => $_GET['post'],
58
  'preferred' => $this->transposh->options->get_preferred_translator(),
69
  ));
70
  wp_enqueue_style('jqueryui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/ui-lightness/jquery-ui.css', array(), '1.8.2');
71
  wp_enqueue_script('jqueryui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js', array('jquery'), '1.8.2', true);
72
+ delete_post_meta($_GET['post'], 'transposh_can_translate'); // as we have used the meta - it can go now, another option would have been to put this in the getphrases
73
  }
74
  }
75
 
133
  // if this isn't the default language or we specifically allow default language translation, we will seek this out...
134
  // as we don't normally want to auto-translate the default language -FIX THIS to include only correct stuff, how?
135
  if (!$this->transposh->options->is_default_language($lang) || $this->transposh->options->get_enable_default_translate()) {
136
+ // There is no point in returning phrases, languages pairs that cannot be translated
137
  if (in_array($lang, transposh_consts::$bing_languages) || in_array($lang, transposh_consts::$google_languages)) {
138
+ list($source, $translation) = $this->transposh->database->fetch_translation($key, $lang);
139
  if (!$translation) {
140
  // p stands for phrases, l stands for languages, t is token
141
  if (!is_array($json['p'][$key]['l'])) {
167
  */
168
  function transposh_postpublish_box() {
169
  // the nonce will help double translation if time has passed
170
+ if (get_post_meta($_GET['post'], 'transposh_can_translate', true))
171
  $this->just_published = true;
172
 
173
  if ($this->just_published) {
178
  }
179
 
180
  /**
181
+ * When this happens, the boxes are not created we now use a meta to inform the next step (cleaner)
182
  * @param int $postID
183
  */
184
  function on_edit($postID) {
185
+ add_post_meta($postID, 'transposh_can_translate', 'true', true);
 
 
 
 
 
 
 
 
 
186
  }
187
 
188
  }
189
+
190
  ?>
wp/transposh_widget.php CHANGED
@@ -1,14 +1,14 @@
1
  <?php
2
 
3
  /*
4
- * Transposh v0.6.4
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
- * Date: Wed, 13 Oct 2010 12:32:54 +0200
12
  */
13
 
14
  /*
@@ -85,10 +85,10 @@ class transposh_plugin_widget {
85
  }
86
 
87
  // Register widget
88
- wp_register_sidebar_widget('Transposh',__('Transposh',TRANSPOSH_TEXT_DOMAIN), array(&$this, 'transposh_widget'), array( 'description' => __('Transposh language selection widget', TRANSPOSH_TEXT_DOMAIN) ));
89
 
90
  // Register widget control
91
- wp_register_widget_control('Transposh',__('Transposh',TRANSPOSH_TEXT_DOMAIN), array(&$this, 'transposh_widget_control'));
92
 
93
  // Register callback for widget's css and js
94
  add_action('wp_print_styles', array(&$this, 'add_transposh_widget_css'));
@@ -148,29 +148,9 @@ class transposh_plugin_widget {
148
 
149
  }
150
 
151
- /**
152
- * Creates the widget html
153
- * @param array $args Contains such as $before_widget, $after_widget, $before_title, $after_title, etc
154
- */
155
- function transposh_widget($args) {
156
- $this->load_widget();
157
-
158
- // hmmm, this should actually prepare all vars needed, include the correct widget and send the vars to that function,
159
- $calc_url = false; // By default, avoid calculating the urls
160
- if (function_exists('tp_widget_needs_post_url'))
161
- $calc_url = tp_widget_needs_post_url();
162
-
163
  $widget_args = array();
164
- $page_url = $_SERVER['REQUEST_URI'];
165
-
166
- //remove any language identifier and find the "clean" url, used for posting and calculating urls if needed
167
- $clean_page_url = transposh_utils::cleanup_url($page_url, $this->transposh->home_url, true);
168
- // we need this if we are using url translations
169
- if ($this->transposh->options->get_enable_url_translate() && $calc_url) {
170
- $clean_page_url = transposh_utils::get_original_url($clean_page_url, '', $this->transposh->target_language, array($this->transposh->database, 'fetch_original'));
171
- }
172
-
173
-
174
  // loop on the languages
175
  foreach ($this->transposh->options->get_sorted_langs() as $code => $langrecord) {
176
  list ($langname, $language, $flag) = explode(',', $langrecord);
@@ -179,14 +159,15 @@ class transposh_plugin_widget {
179
  if ($this->transposh->options->is_viewable_language($code) ||
180
  ($this->transposh->options->is_editable_language($code) && $this->transposh->is_translator()) ||
181
  ($this->transposh->options->is_default_language($code))) {
182
- if ($this->transposh->options->get_enable_url_translate() && $calc_url) {
183
- $page_url = transposh_utils::translate_url($clean_page_url, '', $code, array(&$this->transposh->database, 'fetch_translation'));
184
- } else {
185
- $page_url = $clean_page_url;
 
 
 
 
186
  }
187
- // clean $code in default lanaguge
188
- if ($calc_url)
189
- $page_url = transposh_utils::rewrite_url_lang_param($page_url, $this->transposh->home_url, $this->transposh->enable_permalinks_rewrite, ($code == $this->transposh->options->get_default_language()) ? '' : $code, $this->transposh->edit_mode);
190
  $widget_args[] = array(
191
  'lang' => $langname,
192
  'langorig' => $language,
@@ -196,6 +177,26 @@ class transposh_plugin_widget {
196
  'active' => ($this->transposh->target_language == $code));
197
  }
198
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  // at this point the widget args are ready
200
 
201
 
@@ -205,10 +206,10 @@ class transposh_plugin_widget {
205
 
206
 
207
  // widget default title
208
- echo $before_widget . $before_title . __('Translation',TRANSPOSH_TEXT_DOMAIN) . $after_title;
209
 
210
  // the widget is inside a form used for posting a language change or edit request
211
- echo '<form id="tp_form" action="' . $clean_page_url . '" method="post">';
212
 
213
  // actually run the external widget code
214
  tp_widget_do($widget_args);
@@ -218,7 +219,7 @@ class transposh_plugin_widget {
218
  // this is the set default language line
219
  if ($this->transposh->options->get_widget_allow_set_default_language()) {
220
  If ((isset($_COOKIE['TR_LNG']) && $_COOKIE['TR_LNG'] != $this->transposh->target_language) || (!isset($_COOKIE['TR_LNG']) && !$this->transposh->options->is_default_language($this->transposh->target_language))) {
221
- echo '<a id="' . SPAN_PREFIX . 'setdeflang" onClick="return false;" href="' . $this->transposh->post_url . '?tr_cookie_bck">'.__('Set as default language',TRANSPOSH_TEXT_DOMAIN).'</a><br/>';
222
  }
223
  }
224
  // add the edit checkbox only for translators for languages marked as editable
@@ -250,7 +251,7 @@ class transposh_plugin_widget {
250
  echo '<div id="' . SPAN_PREFIX . 'credit">';
251
  if (!$this->transposh->options->get_widget_remove_logo()) {
252
  echo 'by <a href="http://tran' . 'sposh.org"><img class="' . NO_TRANSLATE_CLASS . '" height="16" width="16" src="' .
253
- $plugpath . '/img/tplog' . 'o.png" style="padding:1px;border:0px" title="'.esc_attr__('Transposh',TRANSPOSH_TEXT_DOMAIN).'" alt="'.esc_attr__('Transposh',TRANSPOSH_TEXT_DOMAIN).'"/></a>';
254
  }
255
  echo '</div>';
256
  echo $after_widget;
@@ -329,7 +330,7 @@ class transposh_plugin_widget {
329
 
330
  $widgets = $this->get_widgets();
331
 
332
- echo '<p><label for="' . WIDGET_FILE . '">'.__('Style:',TRANSPOSH_TEXT_DOMAIN).'<br/>' .
333
  '<select id="transposh-style" name="' . WIDGET_FILE . '">';
334
  foreach ($widgets as $file => $widget) {
335
 
@@ -338,13 +339,13 @@ class transposh_plugin_widget {
338
  }
339
  echo '</select>' .
340
  '</label></p>' .
341
- '<p><label for="transposh-progress">'.__('Effects:',TRANSPOSH_TEXT_DOMAIN).'</label><br/>' .
342
  '<input type="checkbox" id="' . WIDGET_PROGRESSBAR . '" name="' . WIDGET_PROGRESSBAR . '"' . ($this->transposh->options->get_widget_progressbar() ? ' checked="checked"' : '') . '/>' .
343
- '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="'.esc_attr__('Show progress bar when a client triggers automatic translation',TRANSPOSH_TEXT_DOMAIN).'">'.__('Show progress bar',TRANSPOSH_TEXT_DOMAIN).'</span><br/>' .
344
  '<input type="checkbox" id="' . WIDGET_ALLOW_SET_DEFLANG . '" name="' . WIDGET_ALLOW_SET_DEFLANG . '"' . ($this->transposh->options->get_widget_allow_set_default_language() ? ' checked="checked"' : '') . '/>' .
345
- '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="'.esc_attr__('Widget will allow setting this language as user default',TRANSPOSH_TEXT_DOMAIN).'">'.__('Allow user to set current language as default',TRANSPOSH_TEXT_DOMAIN).'</span><br/>' .
346
  '<input type="checkbox" id="' . WIDGET_REMOVE_LOGO_FOR_AD . '" name="' . WIDGET_REMOVE_LOGO_FOR_AD . '"' . ($this->transposh->options->get_widget_remove_logo() ? ' checked="checked"' : '') . '/>' .
347
- '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="'.esc_attr__('Transposh logo will not appear on widget',TRANSPOSH_TEXT_DOMAIN).'">'.__('Remove transposh logo (see <a href="http://transposh.org/logoterms">terms</a>)',TRANSPOSH_TEXT_DOMAIN).'</span><br/>' .
348
  '</p>' .
349
  '<input type="hidden" name="transposh-submit" id="transposh-submit" value="1"/>';
350
  }
@@ -358,4 +359,5 @@ class transposh_plugin_widget {
358
  function transposh_widget($args = array()) {
359
  $GLOBALS['my_transposh_plugin']->widget->transposh_widget($args);
360
  }
 
361
  ?>
1
  <?php
2
 
3
  /*
4
+ * Transposh v0.6.5
5
  * http://transposh.org/
6
  *
7
  * Copyright 2010, Team Transposh
8
  * Licensed under the GPL Version 2 or higher.
9
  * http://transposh.org/license
10
  *
11
+ * Date: Mon, 25 Oct 2010 13:00:28 +0200
12
  */
13
 
14
  /*
85
  }
86
 
87
  // Register widget
88
+ wp_register_sidebar_widget('Transposh', __('Transposh', TRANSPOSH_TEXT_DOMAIN), array(&$this, 'transposh_widget'), array('description' => __('Transposh language selection widget', TRANSPOSH_TEXT_DOMAIN)));
89
 
90
  // Register widget control
91
+ wp_register_widget_control('Transposh', __('Transposh', TRANSPOSH_TEXT_DOMAIN), array(&$this, 'transposh_widget_control'));
92
 
93
  // Register callback for widget's css and js
94
  add_action('wp_print_styles', array(&$this, 'add_transposh_widget_css'));
148
 
149
  }
150
 
151
+ function create_widget_args($calc_url, $clean_page_url) {
 
 
 
 
 
 
 
 
 
 
 
152
  $widget_args = array();
153
+ $page_url = '';
 
 
 
 
 
 
 
 
 
154
  // loop on the languages
155
  foreach ($this->transposh->options->get_sorted_langs() as $code => $langrecord) {
156
  list ($langname, $language, $flag) = explode(',', $langrecord);
159
  if ($this->transposh->options->is_viewable_language($code) ||
160
  ($this->transposh->options->is_editable_language($code) && $this->transposh->is_translator()) ||
161
  ($this->transposh->options->is_default_language($code))) {
162
+ if ($calc_url) {
163
+ if ($this->transposh->options->get_enable_url_translate() && !$this->transposh->options->is_default_language($code)) {
164
+ $page_url = transposh_utils::translate_url($clean_page_url, '', $code, array(&$this->transposh->database, 'fetch_translation'));
165
+ } else {
166
+ $page_url = $clean_page_url;
167
+ }
168
+ // clean $code in default lanaguge
169
+ $page_url = transposh_utils::rewrite_url_lang_param($page_url, $this->transposh->home_url, $this->transposh->enable_permalinks_rewrite, $this->transposh->options->is_default_language($code) ? '' : $code, $this->transposh->edit_mode);
170
  }
 
 
 
171
  $widget_args[] = array(
172
  'lang' => $langname,
173
  'langorig' => $language,
177
  'active' => ($this->transposh->target_language == $code));
178
  }
179
  }
180
+ return $widget_args;
181
+ }
182
+
183
+ /**
184
+ * Creates the widget html
185
+ * @param array $args Contains such as $before_widget, $after_widget, $before_title, $after_title, etc
186
+ */
187
+ function transposh_widget($args) {
188
+ $this->load_widget();
189
+
190
+ // hmmm, this should actually prepare all vars needed, include the correct widget and send the vars to that function,
191
+ $calc_url = false; // By default, avoid calculating the urls
192
+ if (function_exists('tp_widget_needs_post_url'))
193
+ $calc_url = tp_widget_needs_post_url();
194
+
195
+ $clean_page = $this->transposh->get_clean_url();
196
+
197
+
198
+
199
+ $widget_args = $this->create_widget_args($calc_url, $clean_page);
200
  // at this point the widget args are ready
201
 
202
 
206
 
207
 
208
  // widget default title
209
+ echo $before_widget . $before_title . __('Translation', TRANSPOSH_TEXT_DOMAIN) . $after_title;
210
 
211
  // the widget is inside a form used for posting a language change or edit request
212
+ echo '<form id="tp_form" action="' . $clean_page . '" method="post">';
213
 
214
  // actually run the external widget code
215
  tp_widget_do($widget_args);
219
  // this is the set default language line
220
  if ($this->transposh->options->get_widget_allow_set_default_language()) {
221
  If ((isset($_COOKIE['TR_LNG']) && $_COOKIE['TR_LNG'] != $this->transposh->target_language) || (!isset($_COOKIE['TR_LNG']) && !$this->transposh->options->is_default_language($this->transposh->target_language))) {
222
+ echo '<a id="' . SPAN_PREFIX . 'setdeflang" onClick="return false;" href="' . $this->transposh->post_url . '?tr_cookie_bck">' . __('Set as default language', TRANSPOSH_TEXT_DOMAIN) . '</a><br/>';
223
  }
224
  }
225
  // add the edit checkbox only for translators for languages marked as editable
251
  echo '<div id="' . SPAN_PREFIX . 'credit">';
252
  if (!$this->transposh->options->get_widget_remove_logo()) {
253
  echo 'by <a href="http://tran' . 'sposh.org"><img class="' . NO_TRANSLATE_CLASS . '" height="16" width="16" src="' .
254
+ $plugpath . '/img/tplog' . 'o.png" style="padding:1px;border:0px" title="' . esc_attr__('Transposh', TRANSPOSH_TEXT_DOMAIN) . '" alt="' . esc_attr__('Transposh', TRANSPOSH_TEXT_DOMAIN) . '"/></a>';
255
  }
256
  echo '</div>';
257
  echo $after_widget;
330
 
331
  $widgets = $this->get_widgets();
332
 
333
+ echo '<p><label for="' . WIDGET_FILE . '">' . __('Style:', TRANSPOSH_TEXT_DOMAIN) . '<br/>' .
334
  '<select id="transposh-style" name="' . WIDGET_FILE . '">';
335
  foreach ($widgets as $file => $widget) {
336
 
339
  }
340
  echo '</select>' .
341
  '</label></p>' .
342
+ '<p><label for="transposh-progress">' . __('Effects:', TRANSPOSH_TEXT_DOMAIN) . '</label><br/>' .
343
  '<input type="checkbox" id="' . WIDGET_PROGRESSBAR . '" name="' . WIDGET_PROGRESSBAR . '"' . ($this->transposh->options->get_widget_progressbar() ? ' checked="checked"' : '') . '/>' .
344
+ '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="' . esc_attr__('Show progress bar when a client triggers automatic translation', TRANSPOSH_TEXT_DOMAIN) . '">' . __('Show progress bar', TRANSPOSH_TEXT_DOMAIN) . '</span><br/>' .
345
  '<input type="checkbox" id="' . WIDGET_ALLOW_SET_DEFLANG . '" name="' . WIDGET_ALLOW_SET_DEFLANG . '"' . ($this->transposh->options->get_widget_allow_set_default_language() ? ' checked="checked"' : '') . '/>' .
346
+ '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="' . esc_attr__('Widget will allow setting this language as user default', TRANSPOSH_TEXT_DOMAIN) . '">' . __('Allow user to set current language as default', TRANSPOSH_TEXT_DOMAIN) . '</span><br/>' .
347
  '<input type="checkbox" id="' . WIDGET_REMOVE_LOGO_FOR_AD . '" name="' . WIDGET_REMOVE_LOGO_FOR_AD . '"' . ($this->transposh->options->get_widget_remove_logo() ? ' checked="checked"' : '') . '/>' .
348
+ '<span style="border-bottom: 1px dotted #333; cursor: help; margin-left: 4px" title="' . esc_attr__('Transposh logo will not appear on widget', TRANSPOSH_TEXT_DOMAIN) . '">' . __('Remove transposh logo (see <a href="http://transposh.org/logoterms">terms</a>)', TRANSPOSH_TEXT_DOMAIN) . '</span><br/>' .
349
  '</p>' .
350
  '<input type="hidden" name="transposh-submit" id="transposh-submit" value="1"/>';
351
  }
359
  function transposh_widget($args = array()) {
360
  $GLOBALS['my_transposh_plugin']->widget->transposh_widget($args);
361
  }
362
+
363
  ?>