Loco Translate - Version 2.0.7

Version Description

  • Fixed prototype.js conflict
  • More Windows file path fixes
  • Added loco_current_translator filter
  • Fixed false positive in extra files test
Download this release

Release Info

Developer timwhitlock
Plugin Icon 128x128 Loco Translate
Version 2.0.7
Comparing to
See all releases

Code changes from version 2.0.6 to 2.0.7

languages/README.md CHANGED
@@ -1,7 +1,7 @@
1
  # Loco Translate translations
2
 
3
- This the first release of version 2.0, so please don't submit any translations yet.
4
 
5
- All English strings are likely to change regularly.
6
 
7
- Once strings are finalized the POT file will be updated.
1
  # Loco Translate translations
2
 
3
+ This is an early release of version 2, so please don't submit any translations yet.
4
 
5
+ English source strings are likely to change regularly in the short term.
6
 
7
+ The POT file will be updated as soon as strings are finalized.
loco.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Loco Translate
4
  Plugin URI: https://wordpress.org/plugins/loco-translate/
5
  Description: Translate themes and plugins directly in WordPress
6
  Author: Tim Whitlock
7
- Version: 2.0.6
8
  Author URI: https://localise.biz/wordpress/plugin
9
  Text Domain: loco
10
  Domain Path: /languages/
@@ -45,7 +45,7 @@ function loco_plugin_file(){
45
  * @return string
46
  */
47
  function loco_plugin_version(){
48
- return '2.0.6';
49
  }
50
 
51
 
@@ -137,8 +137,7 @@ function loco_check_extension( $name ){
137
  $cache[$name] = true;
138
  }
139
  else {
140
- $warn = sprintf( __('Loco requires the "%s" PHP extension. Ask your hosting provider to install it','loco'), $name );
141
- Loco_error_AdminNotices::add( new Loco_error_Warning($warn) );
142
  $class = 'Loco_compat_'.ucfirst($name).'Extension.php';
143
  $cache[$name] = class_exists( $class );
144
  }
4
  Plugin URI: https://wordpress.org/plugins/loco-translate/
5
  Description: Translate themes and plugins directly in WordPress
6
  Author: Tim Whitlock
7
+ Version: 2.0.7
8
  Author URI: https://localise.biz/wordpress/plugin
9
  Text Domain: loco
10
  Domain Path: /languages/
45
  * @return string
46
  */
47
  function loco_plugin_version(){
48
+ return '2.0.7';
49
  }
50
 
51
 
137
  $cache[$name] = true;
138
  }
139
  else {
140
+ Loco_error_AdminNotices::warn( sprintf( __('Loco requires the "%s" PHP extension. Ask your hosting provider to install it','loco'), $name ) );
 
141
  $class = 'Loco_compat_'.ucfirst($name).'Extension.php';
142
  $cache[$name] = class_exists( $class );
143
  }
pub/js/min/admin.js CHANGED
@@ -85,15 +85,15 @@ b=i=null)};return d}({},s,y));m.register("$31",function(d,f,h){d.trim=function(d
85
  d||b:b||""}}d.create=function(b){b||(b=k());var d=m.require("$31","string.js").sprintf;return{s:d,_:b,_s:function(a){arguments[0]=b(a);return d.apply(null,arguments)},_n:b}};return d}({},s,y));m.register("$4",function(d,f,h){d.create=function(){return m.require("$17","t.js").create(f.locoScope.t)};return d}({},s,y));m.register("$2",function(d,f,s){function k(a,c,b){function e(){d();g=setTimeout(c,b)}function d(){g&&clearTimeout(g);g=null}var g;e();h(a).mouseenter(d).mouseleave(e);return{die:function(){d();
86
  h(a).off("mouseenter mouseleave")}}}function b(a,c){a.fadeTo(c,0,function(){a.slideUp(c,function(){a.remove();h(f).triggerHandler("resize")})})}function g(a,c){function e(c){u[g]=null;b(h(a),250);d&&d.die();var f;if(f=c)c.stopPropagation(),c.preventDefault(),f=!1;return f}var d,g;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(f).triggerHandler("resize");n();g=u.length;u.push(e);c&&(d=k(a,e,c))}function a(a,c,b){var e=m.require("$15","html.js");a=h('<div class="notice notice-'+
87
  a+'" loco-notice inline></div>').prependTo(h("#loco-notices"));var d=h(e.el("p"));b=h(e.el("span")).text(b);c=h(e.el("strong","has-icon")).text(c+": ");d.append(c).append(b).appendTo(a);return a}function e(c,b,e,p){c=a(e,b,c).hide().fadeIn(500);h(f).triggerHandler("resize");g(c,p);return d}function c(){h("#loco-notices").find("div.notice").each(function(a,c){g(c,!1)})}var l,u=[],n=Date.now||function(){return(new Date).getTime()};d.error=function(a){return e(a,l("Error"),"error")};d.warning=function(a){return e(a,
88
- l("Warning"),"warning")};d.info=function(a){return e(a,l("Notice"),"info")};d.success=function(a){return e(a,l("OK"),"success",5E3)};d.log=function(){f.console&&console.log&&console.log.apply(console,arguments)};d.debug=function(a,c){f.console&&console.error&&(console.error("Loco Error: "+a),c&&console.debug&&console.debug(c))};d.clear=function(){var a,c,b=u;for(a in b)(c=b[a])&&c();u=[];return d};d.create=a;d.raise=function(a){var c=d;(c[a.type]||c.error).call(c,a.message)};d.init=function(){l=m.require("$4",
89
- "l10n.js").create()._;setTimeout(c,1E3);return d};return d}({},s,y));m.register("$3",function(d,f,s){function k(a,c,b,d){function f(c,d,p){var g=m.require("$4","l10n.js").create()._,w=c.responseText,n=h("<pre>"+w+"</pre>").text();n&&(n=n.replace(/(^\s+|\s+$)/g,""));n||(n=w);q.debug("Ajax failure for "+a,{status:c.status,error:d,message:p,output:w});q.log("Provide this text when reporting a problem:\n--8<--\n",n,"\n------");"parsererror"===d?(n=n.split(/[\r\n]/)[0])?(n=n.replace(/ +in +\S+ on line \d+/,
90
- ""),n=n.replace(/^[()! ]+Fatal error:\s*/,""),q.error(n+".\nCheck console output for debug info")):q.error("Server returned invalid data, check console output for debug info"):q.error(p||g("Unknown error"));b&&b(c,d,p)}d.url=g;d.dataType="json";d.error=f;d.success=function(a,b,e){var d=a&&a.data,g=a&&a.notices,l=g&&g.length;for(!d||a.error?f(e,b,a&&a.error&&a.error.message):c&&c(d,b,e);l--;)q.raise(g[l])};var q=m.require("$2","notices.js").clear();return h.ajax(d)}var b={},g=f.ajaxurl||"/wp-admin/admin-ajax.php",
91
- a=f.encodeURIComponent;d.init=function(a){b=a.nonces||b;return d};d.submit=function(a,c,b){function d(){g.removeClass("loading");m.require("$16","forms.js").enable(g)}var g=h(a),f=g.serialize();g.addClass("loading");m.require("$16","forms.js").disable(g);return k(a.route.value,function(a,b,e){d();c&&c(a,b,e)},function(a,c,e){d();b&&b(a,c,e)},{type:a.method,data:f})};d.post=function(e,c,d,g){var n;(n=b[e])||(f.console&&console.debug&&console.debug('No nonce for "'+e+'"'),n="");n="action=loco_json&route="+
92
- a(e)+"&loco-nonce="+a(n);(c=c?h.param(c):"")&&(n+="&"+c);return k(e,d,g,{type:"post",data:n})};d.setNonce=function(a,c){b[a]=c;return d};return d}({},s,y));m.register("$18",{arab:1,aran:1,hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});m.register("$5",function(d,f,h){function k(){}var b,g,a=m.require("$18","rtl.json");d.init=
93
- function(){return new k};d.cast=function(a){return a instanceof k?a:"string"===typeof a?d.parse(a):d.clone(a)};d.clone=function(a){var c,b=new k;for(c in a)b[c]=a[c];return b};d.parse=function(a){b||(g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var c=new k;c.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)c.script=a.charAt(0).toUpperCase()+a.substr(1).toLowerCase();
94
- if(a=RegExp.$3)c.region=a.toUpperCase();if(a=RegExp.$4)c.variant=a.toLowerCase();if(a=RegExp.$5)c.extension=a;return c};f=k.prototype;f.isValid=function(){return!!this.lang};f.toString=function(a){a=a||"-";var c,b=this.lang||"zxx";if(c=this.script)b+=a+c;if(c=this.region)b+=a+c;if(c=this.variant)b+=a+c;if(c=this.extension)b+=a+c;return b};f.getIcon=function(){for(var a=4,c,b,d=["variant","region","script","lang"],g=[];0!==a--;)if(c=d[a],b=this[c])1===a&&3===b.length?g.push("region-m49"):g=g.concat([c,
95
- c+"-"+b.toLowerCase()]);return g.join(" ")};f.isRTL=function(){return!!a[String(this.script||this.lang).toLowerCase()]};f=null;return d}({},s,y));m.register("$33",function(d,f,h){function k(a){f.console&&console.error&&console.error(a)}function b(){k("Method not implemented")}function g(){}function a(a){}g.prototype.toString=function(){return"[Undefined]"};a.prototype._validate=function(a){var c,d,f=!0;for(c in this)d=this[c],d===b?(k(a+"."+c+"() must be implemented"),f=!1):d instanceof g&&(k(a+"."+
96
- c+" must be defined"),f=!1);return f};d.init=function(e,c){var d,f=new a;if(e)for(d=e.length;0!==d--;)f[e[d]]=b;if(c)for(d=c.length;0!==d--;)f[c[d]]=new g;return f};d.validate=function(a){var c=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(c||"Object")};return d}({},s,y));m.register("$41",function(d,f,h){var k=f.requestAnimationFrame,b=f.cancelAnimationFrame,g=0;if(!k||!b)for(var a in{ms:1,moz:1,webkit:1,o:1})if(k=f[a+"RequestAnimationFrame"])if(b=f[a+"CancelAnimationFrame"]||
97
  f[a+"CancelRequestAnimationFrame"])break;k&&b||(k=function(a){var b=e();timeToCall=Math.max(0,16-(b-g));nextTime=b+timeToCall;timerId=f.setTimeout(function(){a(nextTime)},timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var e=Date.now||function(){return(new Date).getTime()};d.loop=function(a,e){function d(){f=k(d,e);a(g++)}var g=0,f;d();return{stop:function(){f&&b(f);f=null}}};return d}({},s,y));m.register("$38",function(d,f,h){function k(c,b,e,d){if(a){var g=e;e=function(a){if((a.MSPOINTER_TYPE_TOUCH||
98
  "touch")===a.pointerType)return g(a)}}c.addEventListener(b,e,d);return{unbind:function(){c.removeEventListener(b,e,d)}}}function b(a){a.preventDefault();a.stopPropagation();return!1}var g,a=!!f.navigator.msPointerEnabled,e=a?"MSPointerDown":"touchstart",c=a?"MSPointerMove":"touchmove",l=a?"MSPointerUp":"touchend";d.ok=function(a){null==g&&(g="function"===typeof h.body.addEventListener);g&&a&&a(d);return g};d.ms=function(){return a};d.dragger=function(a,d){function g(c){a.addEventListener(c,f[c],!1)}
99
  function p(c){a.removeEventListener(c,f[c],!1)}var f={};f[e]=function(a){u(a,function(c,b){b.type=e;d(a,b,h)});g(c);g(l);return!0};f[l]=function(a){p(c);p(l);u(a,function(c,b){b.type=l;d(a,b,h)});return!0};f[c]=function(a){u(a,function(b,e){e.type=c;d(a,e,h)});return b(a)};g(e);var h={kill:function(){p(e);p(c);p(l);a=h=d=null}};return h};d.swiper=function(d,g,f){function p(a){d.addEventListener(a,z[a],!1)}function h(a){d.removeEventListener(a,z[a],!1)}function w(){E&&E.stop();E=null}var E,k,v,z={},
85
  d||b:b||""}}d.create=function(b){b||(b=k());var d=m.require("$31","string.js").sprintf;return{s:d,_:b,_s:function(a){arguments[0]=b(a);return d.apply(null,arguments)},_n:b}};return d}({},s,y));m.register("$4",function(d,f,h){d.create=function(){return m.require("$17","t.js").create(f.locoScope.t)};return d}({},s,y));m.register("$2",function(d,f,s){function k(a,c,b){function e(){d();g=setTimeout(c,b)}function d(){g&&clearTimeout(g);g=null}var g;e();h(a).mouseenter(d).mouseleave(e);return{die:function(){d();
86
  h(a).off("mouseenter mouseleave")}}}function b(a,c){a.fadeTo(c,0,function(){a.slideUp(c,function(){a.remove();h(f).triggerHandler("resize")})})}function g(a,c){function e(c){u[g]=null;b(h(a),250);d&&d.die();var f;if(f=c)c.stopPropagation(),c.preventDefault(),f=!1;return f}var d,g;h('<button type="button" class="notice-dismiss" href="#"> </a>').prependTo(a).click(e);h(f).triggerHandler("resize");n();g=u.length;u.push(e);c&&(d=k(a,e,c))}function a(a,c,b){var e=m.require("$15","html.js");a=h('<div class="notice notice-'+
87
  a+'" loco-notice inline></div>').prependTo(h("#loco-notices"));var d=h(e.el("p"));b=h(e.el("span")).text(b);c=h(e.el("strong","has-icon")).text(c+": ");d.append(c).append(b).appendTo(a);return a}function e(c,b,e,p){c=a(e,b,c).hide().fadeIn(500);h(f).triggerHandler("resize");g(c,p);return d}function c(){h("#loco-notices").find("div.notice").each(function(a,c){g(c,!1)})}var l,u=[],n=Date.now||function(){return(new Date).getTime()};d.error=function(a){return e(a,l("Error"),"error")};d.warning=function(a){return e(a,
88
+ l("Warning"),"warning")};d.info=function(a){return e(a,l("Notice"),"info")};d.success=function(a){return e(a,l("OK"),"success",5E3)};d.log=function(){f.console&&console.log&&console.log.apply(console,arguments)};d.debug=function(a,c){f.console&&console.error&&(console.error("Loco Error: "+a),c&&console.debug&&console.debug(c))};d.clear=function(){for(var a=-1,c,b=u,e=b.length;++a<e;)(c=b[a])&&c();u=[];return d};d.create=a;d.raise=function(a){var c=d;(c[a.type]||c.error).call(c,a.message)};d.init=
89
+ function(){l=m.require("$4","l10n.js").create()._;setTimeout(c,1E3);return d};return d}({},s,y));m.register("$3",function(d,f,s){function k(a,c,b,d){function f(c,d,p){var g=m.require("$4","l10n.js").create()._,w=c.responseText,n=h("<pre>"+w+"</pre>").text();n&&(n=n.replace(/(^\s+|\s+$)/g,""));n||(n=w);q.debug("Ajax failure for "+a,{status:c.status,error:d,message:p,output:w});q.log("Provide this text when reporting a problem:\n--8<--\n",n,"\n------");"parsererror"===d?(n=n.split(/[\r\n]/)[0])?(n=
90
+ n.replace(/ +in +\S+ on line \d+/,""),n=n.replace(/^[()! ]+Fatal error:\s*/,""),q.error(n+".\nCheck console output for debug info")):q.error("Server returned invalid data, check console output for debug info"):q.error(p||g("Unknown error"));b&&b(c,d,p)}d.url=g;d.dataType="json";d.error=f;d.success=function(a,b,e){var d=a&&a.data,g=a&&a.notices,l=g&&g.length;for(!d||a.error?f(e,b,a&&a.error&&a.error.message):c&&c(d,b,e);l--;)q.raise(g[l])};var q=m.require("$2","notices.js").clear();return h.ajax(d)}
91
+ var b={},g=f.ajaxurl||"/wp-admin/admin-ajax.php",a=f.encodeURIComponent;d.init=function(a){b=a.nonces||b;return d};d.submit=function(a,c,b){function d(){g.removeClass("loading");m.require("$16","forms.js").enable(g)}var g=h(a),f=g.serialize();g.addClass("loading");m.require("$16","forms.js").disable(g);return k(a.route.value,function(a,b,e){d();c&&c(a,b,e)},function(a,c,e){d();b&&b(a,c,e)},{type:a.method,data:f})};d.post=function(e,c,d,g){var n;(n=b[e])||(f.console&&console.debug&&console.debug('No nonce for "'+
92
+ e+'"'),n="");n="action=loco_json&route="+a(e)+"&loco-nonce="+a(n);(c=c?h.param(c):"")&&(n+="&"+c);return k(e,d,g,{type:"post",data:n})};d.setNonce=function(a,c){b[a]=c;return d};return d}({},s,y));m.register("$18",{arab:1,aran:1,hebr:1,nkoo:1,syrc:1,syrn:1,syrj:1,syre:1,samr:1,mand:1,mend:1,thaa:1,adlm:1,cprt:1,phnx:1,armi:1,prti:1,phli:1,phlp:1,phlv:1,avst:1,mani:1,khar:1,orkh:1,ital:1,lydi:1,ar:1,ary:1,ckb:1,dv:1,fa:1,he:1,nqo:1,ps:1,ur:1,yi:1});m.register("$5",function(d,f,h){function k(){}var b,
93
+ g,a=m.require("$18","rtl.json");d.init=function(){return new k};d.cast=function(a){return a instanceof k?a:"string"===typeof a?d.parse(a):d.clone(a)};d.clone=function(a){var c,b=new k;for(c in a)b[c]=a[c];return b};d.parse=function(a){b||(g=/[-_+]/,b=/^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}|[0-9]{3}))?(?:-([0-9][a-z0-9]{3,8}|[a-z0-9]{5,8}))?(?:-([a-z]-[-a-z]+))?$/i);a=String(a).split(g).join("-");if(!b.exec(a))return null;var c=new k;c.lang=RegExp.$1.toLowerCase();if(a=RegExp.$2)c.script=a.charAt(0).toUpperCase()+
94
+ a.substr(1).toLowerCase();if(a=RegExp.$3)c.region=a.toUpperCase();if(a=RegExp.$4)c.variant=a.toLowerCase();if(a=RegExp.$5)c.extension=a;return c};f=k.prototype;f.isValid=function(){return!!this.lang};f.toString=function(a){a=a||"-";var c,b=this.lang||"zxx";if(c=this.script)b+=a+c;if(c=this.region)b+=a+c;if(c=this.variant)b+=a+c;if(c=this.extension)b+=a+c;return b};f.getIcon=function(){for(var a=4,c,b,d=["variant","region","script","lang"],g=[];0!==a--;)if(c=d[a],b=this[c])1===a&&3===b.length?g.push("region-m49"):
95
+ g=g.concat([c,c+"-"+b.toLowerCase()]);return g.join(" ")};f.isRTL=function(){return!!a[String(this.script||this.lang).toLowerCase()]};f=null;return d}({},s,y));m.register("$33",function(d,f,h){function k(a){f.console&&console.error&&console.error(a)}function b(){k("Method not implemented")}function g(){}function a(a){}g.prototype.toString=function(){return"[Undefined]"};a.prototype._validate=function(a){var c,d,f=!0;for(c in this)d=this[c],d===b?(k(a+"."+c+"() must be implemented"),f=!1):d instanceof
96
+ g&&(k(a+"."+c+" must be defined"),f=!1);return f};d.init=function(e,c){var d,f=new a;if(e)for(d=e.length;0!==d--;)f[e[d]]=b;if(c)for(d=c.length;0!==d--;)f[c[d]]=new g;return f};d.validate=function(a){var c=/function (\w+)\(/.exec(a.toString())?RegExp.$1:"";a.prototype._validate(c||"Object")};return d}({},s,y));m.register("$41",function(d,f,h){var k=f.requestAnimationFrame,b=f.cancelAnimationFrame,g=0;if(!k||!b)for(var a in{ms:1,moz:1,webkit:1,o:1})if(k=f[a+"RequestAnimationFrame"])if(b=f[a+"CancelAnimationFrame"]||
97
  f[a+"CancelRequestAnimationFrame"])break;k&&b||(k=function(a){var b=e();timeToCall=Math.max(0,16-(b-g));nextTime=b+timeToCall;timerId=f.setTimeout(function(){a(nextTime)},timeToCall);g=nextTime;return timerId},b=function(a){clearTimeout(a)});var e=Date.now||function(){return(new Date).getTime()};d.loop=function(a,e){function d(){f=k(d,e);a(g++)}var g=0,f;d();return{stop:function(){f&&b(f);f=null}}};return d}({},s,y));m.register("$38",function(d,f,h){function k(c,b,e,d){if(a){var g=e;e=function(a){if((a.MSPOINTER_TYPE_TOUCH||
98
  "touch")===a.pointerType)return g(a)}}c.addEventListener(b,e,d);return{unbind:function(){c.removeEventListener(b,e,d)}}}function b(a){a.preventDefault();a.stopPropagation();return!1}var g,a=!!f.navigator.msPointerEnabled,e=a?"MSPointerDown":"touchstart",c=a?"MSPointerMove":"touchmove",l=a?"MSPointerUp":"touchend";d.ok=function(a){null==g&&(g="function"===typeof h.body.addEventListener);g&&a&&a(d);return g};d.ms=function(){return a};d.dragger=function(a,d){function g(c){a.addEventListener(c,f[c],!1)}
99
  function p(c){a.removeEventListener(c,f[c],!1)}var f={};f[e]=function(a){u(a,function(c,b){b.type=e;d(a,b,h)});g(c);g(l);return!0};f[l]=function(a){p(c);p(l);u(a,function(c,b){b.type=l;d(a,b,h)});return!0};f[c]=function(a){u(a,function(b,e){e.type=c;d(a,e,h)});return b(a)};g(e);var h={kill:function(){p(e);p(c);p(l);a=h=d=null}};return h};d.swiper=function(d,g,f){function p(a){d.addEventListener(a,z[a],!1)}function h(a){d.removeEventListener(a,z[a],!1)}function w(){E&&E.stop();E=null}var E,k,v,z={},
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: timwhitlock
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
4
  Requires at least: 4.0
5
  Tested up to: 4.6.1
6
- Stable tag: 2.0.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -85,6 +85,12 @@ Help is provided via the [plugin support forum](https://wordpress.org/support/pl
85
 
86
  == Changelog ==
87
 
 
 
 
 
 
 
88
  = 2.0.6 =
89
  * PO wrapping bugfix
90
  * Downgraded source code bugfix
@@ -124,7 +130,7 @@ Help is provided via the [plugin support forum](https://wordpress.org/support/pl
124
 
125
  == Upgrade Notice ==
126
 
127
- = 2.0.5 =
128
  * Various bug fixes and improvements
129
 
130
 
3
  Tags: translation, translators, localization, localisation, l10n, i18n, Gettext, PO, MO, productivity
4
  Requires at least: 4.0
5
  Tested up to: 4.6.1
6
+ Stable tag: 2.0.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
85
 
86
  == Changelog ==
87
 
88
+ = 2.0.7 =
89
+ * Fixed prototype.js conflict
90
+ * More Windows file path fixes
91
+ * Added loco_current_translator filter
92
+ * Fixed false positive in extra files test
93
+
94
  = 2.0.6 =
95
  * PO wrapping bugfix
96
  * Downgraded source code bugfix
130
 
131
  == Upgrade Notice ==
132
 
133
+ = 2.0.7 =
134
  * Various bug fixes and improvements
135
 
136
 
src/admin/bundle/SetupController.php CHANGED
@@ -105,8 +105,13 @@ class Loco_admin_bundle_SetupController extends Loco_admin_bundle_BaseController
105
  }
106
  // if extra files found consider incomplete
107
  if( $bundle->isTheme() || ( $bundle->isPlugin() && ! $bundle->isSingleFile() ) ){
108
- if( Loco_package_Inverter::export($bundle) ){
109
- $notices[] = "Translation files found that can't be matched to a known set of strings";
 
 
 
 
 
110
  }
111
  }
112
 
105
  }
106
  // if extra files found consider incomplete
107
  if( $bundle->isTheme() || ( $bundle->isPlugin() && ! $bundle->isSingleFile() ) ){
108
+ $unknown = Loco_package_Inverter::export($bundle);
109
+ $n = 0;
110
+ foreach( $unknown as $ext => $files ){
111
+ $n += count($files);
112
+ }
113
+ if( $n ){
114
+ $notices[] = sprintf( _n("One file can't be matched to a known set of strings","%s files can't be matched to a known set of strings",$n,'loco'), number_format($n) );
115
  }
116
  }
117
 
src/fs/Locations.php CHANGED
@@ -88,6 +88,11 @@ class Loco_fs_Locations extends ArrayObject {
88
  public function __construct( array $paths ){
89
  $cache = array();
90
  foreach( $paths as $i => $path ){
 
 
 
 
 
91
  // path must have trailing slash, otherwise "/plugins/foobar" would match "/plugins/foo/"
92
  $path = trailingslashit($path);
93
  $cache[$path] = strlen($path);
@@ -98,9 +103,11 @@ class Loco_fs_Locations extends ArrayObject {
98
 
99
  /**
100
  * Check if a given path begins with any of the registered ones
 
101
  * @return bool whether path matched
102
  */
103
  public function check( $path ){
 
104
  foreach( $this as $prefix => $length ){
105
  if( substr($path,0,$length) === $prefix ){
106
  return true;
88
  public function __construct( array $paths ){
89
  $cache = array();
90
  foreach( $paths as $i => $path ){
91
+ // path should be normalized absolute path and be compared only with others of the same
92
+ $path = Loco_fs_File::abs($path);
93
+ if( ! $path ){
94
+ throw new InvalidArgumentException('Location must be absolute path');
95
+ }
96
  // path must have trailing slash, otherwise "/plugins/foobar" would match "/plugins/foo/"
97
  $path = trailingslashit($path);
98
  $cache[$path] = strlen($path);
103
 
104
  /**
105
  * Check if a given path begins with any of the registered ones
106
+ * @param string absolute path
107
  * @return bool whether path matched
108
  */
109
  public function check( $path ){
110
+ $path = Loco_fs_File::abs($path);
111
  foreach( $this as $prefix => $length ){
112
  if( substr($path,0,$length) === $prefix ){
113
  return true;
src/gettext/Data.php CHANGED
@@ -151,7 +151,7 @@ class Loco_gettext_Data extends LocoPoIterator implements JsonSerializable {
151
  if( function_exists('wp_get_current_user') && ( $user = wp_get_current_user() ) ){
152
  $name = $user->get('display_name') or $name = 'nobody';
153
  $email = $user->get('user_email') or $email = 'nobody@localhost';
154
- $required['Last-Translator'] = sprintf('%s <%s>',$name,$email);
155
  }
156
  // only set absent or empty headers from default list
157
  foreach( $defaults as $key => $value ){
151
  if( function_exists('wp_get_current_user') && ( $user = wp_get_current_user() ) ){
152
  $name = $user->get('display_name') or $name = 'nobody';
153
  $email = $user->get('user_email') or $email = 'nobody@localhost';
154
+ $required['Last-Translator'] = apply_filters( 'loco_current_translator', sprintf('%s <%s>',$name,$email), $name, $email );
155
  }
156
  // only set absent or empty headers from default list
157
  foreach( $defaults as $key => $value ){