<commit_before>var CLIP_TEXT,YANDEX_TRANSLATOR_KEY,URL_YANDEX_TRANSLATOR_KEY,PRIMARY_LOCALE,CURRENT_LOCALE,CURRENT_GROUP,TRANSLATING_LOCALE,URL_TRANSLATOR_GROUP,URL_TRANSLATOR_ALL,URL_TRANSLATOR_FILTERS,xtranslateText,xtranslateService,TRANS_FILTERS,USER_LOCALES;jQuery(document).ready(function($){function e(e,t){e.find("tr").each(function(){if(!$(this).hasClass("hidden")){var e=$(this).find("td.key").first();if(e.length>0){var a=e[0].innerText;t.exec(a)||$(this).addClass("hidden")}}})}function t(e){e.find("tr").removeClass("hidden")}function a(t){var a=$("#translations").find("tbody").first(),n=$("#show-matching-text"),i,s,l,d,c,h="",u;if(t=$(t),t.length>0&&(o=t.prop("id")),s=a.find("tr").length,r(a),d=l=s-a.find("tr.hidden").length,t.length>0){var f=t.parent().parent();$(".translation-filter").removeClass("has-success has-error has-feedback has-highlight"),"show-all"!=o&&(l>0?l==s?f.addClass("has-feedback"):f.addClass("has-highlight"):f.addClass("has-error"))}if(n.length>0){h=n[0].value.trim(),i=new RegExp(h,"i"),e(a,i),d=s-a.find("tr.hidden").length;var v=n.parent("div");v.removeClass("has-error has-success has-feedback has-highlight"),n.removeClass("bg-danger bg-success bg-highlight"),h.length>0&&l>0&&(0==d?(v.addClass("has-error"),n.addClass("bg-danger")):l>d&&(v.addClass("has-highlight"),n.addClass("bg-highlight")))}var m=$.ajax({type:"GET",url:URL_TRANSLATOR_FILTERS,data:{filter:o,regex:h},success:function(e){"ok"===e.status},encode:!0});if(c=$("#key-filter").first(),c.length>0){var p="";d!==l&&(p+=d+"/"),l!==s&&(p+=l+"/"),p+=s,c.removeClass("have-filtered"),d!==s&&c.addClass("have-filtered"),c[0].innerHTML=p}}function n(e,t,a){if(e.length){var n,i,s=t.text(),l=t.data("disable-with");n=e.length,i=0;var r,o=function(e){a(e.srcText,function(a,n){if(""!==a){var i=$.ajax({type:"POST",url:e.dataUrl,data:{name:e.dataName,value:a},success:function(n){"ok"===n.status?(e.dstElem.removeClass("editable-empty status-0"),e.dstElem.addClass("status-1"),e.dstElem.text(a),e.dstElem.editable("setValue",a,!1),e.dstElem.closest("tr").addClass("has-changed-translation")):(t.removeAttr("disabled"),t.text(s))},encode:!0});i.done(function(){r()}),i.fail(function(){t.removeAttr("disabled"),t.text(s)})}else t.removeAttr("disabled"),t.text(s)})};r=function(){e.length?(i++,o(e.pop()),t.attr("disabled","disabled"),t.text(l+" "+i+" / "+n)):(t.removeAttr("disabled"),t.text(s))};for(var d=0;5>d;d++)r()}}function i(e,t,a){return function(){var n={id:null},i={id:null},s=function(e,t,a){return function(){"both"===t.css("resize")?(t.outerWidth(e.outerWidth()),t.outerHeight(e.outerHeight())):"horizontal"===t.css("resize")?t.outerWidth(e.outerWidth()):"vertical"===t.css("resize")&&t.outerHeight(e.outerHeight()),a.id&&(clearTimeout(a.id),a.id=null)}};a&&$(window).on("mousemove",function(a){a.target===e[0]?(n.id&&(clearTimeout(n.id),n.id=null),n.id=setTimeout(s(e,t,n),1e3/30)):a.target===t[0]&&(i.id&&(clearTimeout(i.id),i.id=null),i.id=setTimeout(s(t,e,i),1e3/30))}),$(window).on("mouseup",function(a){null!==n.id&&(clearTimeout(n.id),n.id=null),a.target===e[0]?s(e,t,n)():a.target===t[0]&&s(t,e,i)()})}}$(".group-select").on("change",function(){var e=$(this).val();e?window.location.href=URL_TRANSLATOR_GROUP+$(this).val():window.location.href=URL_TRANSLATOR_ALL}),$("a.delete-key").on("ajax:success",function(e,t){var a=$(this).closest("tr");a.addClass("deleted-translation"),$(this).addClass("hidden"),a.find("a.undelete-key").first().removeClass("hidden")}),$("a.undelete-key").on("ajax:success",function(e,t){var a=$(this).closest("tr");a.removeClass("deleted-translation"),$(this).addClass("hidden"),a.find("a.delete-key").first().removeClass("hidden")});var s=function(e){var t=$("div.success-"+e),a=t.html();$(".form-"+e).on("ajax:success",function(e,n){t.html(a.replace(/:count\b/,n.counter)),t.closest("div.alert").slideDown()})};s("import-group"),s("import-all"),s("find"),$(".form-publish-group").on("ajax:success",function(e,t){if("errors"===t.status){var a=$("div.errors-alert"),n=t.errors;a.html("<p>"+n.join("</p>\n<p>")+"</p>\n"),a.closest("div.alert").slideDown()}else $("div.success-publish").closest("div.alert").slideDown(),$("tr.deleted-translation").remove()}),$(".form-publish-all").on("ajax:success",function(e,t){if("errors"===t.status){var a=$("div.errors-alert"),n=t.errors;a.html("<p>"+n.join("</p>\n<p>")+"</p>\n"),a.closest("div.alert").slideDown()}else $("div.success-publish-all").closest("div.alert").slideDown(),$("tr.deleted-translation").remove()}),$("#form-keyops").on("ajax:success",function(e,t){var a=$("#wildcard-keyops-results").first();a.html(t),a.find(".vsch_editable").vsch_editable()});var l=$("#searchModal").first();l.on("shown.bs.modal",function(e,t,a,n){l.find("#search-form-text").first().focus()}),l.on("ajax:success",function(e,t,a,n){var i=l.find(".results");i.html(t),i.find(".vsch_editable").vsch_editable()}),$("#translate-current-primary").on("click",function(){var e=$("#current-text").first(),t=e[0].value;xtranslateService(TRANSLATING_LOCALE,t,PRIMARY_LOCALE,function(e){var t=$("#primary-text").first();t.length&&t.val(e)})}),$("#translate-primary-current").on("click",function(){var e=$("#primary-text").first(),t=e[0].value;xtranslateService(PRIMARY_LOCALE,t,TRANSLATING_LOCALE,function(e){var t=$("#current-text").first();t.length&&t.val(e)})}),$("#db-connection").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#interface-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#translating-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#primary-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#display-locale-all").on("click",function(e){e.preventDefault(),$(".display-locale").prop("checked",!0)}),$("#display-locale-none").on("click",function(e){e.preventDefault(),$(".display-locale").prop("checked",!1)});var r=t,o="show-all";$("#show-all").on("click",function(e){r=t,a(this)}),$("#show-need-attention").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-empty-translation").removeClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)}),$("#show-unpublished").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)}),$("#show-new").on("click",function(e){r=function(e){e.find("tr").removeClass("hidden"),e.find("tr.has-nonempty-translation").addClass("hidden")},a(this)}),$("#show-empty").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-empty-translation").removeClass("hidden")},a(this)}),$("#show-nonempty").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-nonempty-translation").removeClass("hidden")},a(this)}),$("#show-used").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-used-translation").removeClass("hidden")},a(this)}),$("#show-deleted").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden")},a(this)}),$("#show-changed").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)});var d=null,c=$("#show-matching-text");c.on("keyup change",function(){d&&(window.clearTimeout(d),d=null),d=window.setTimeout(function(){d=null,a()},100)}),$("#show-matching-clear").on("click",function(){c.length&&(c[0].value="",c.focus(),a())}),$("div.alert-dismissible").each(function(){var e=$(this),t=e.find("button.close").first();t.length&&t.on("click",function(){e.slideUp()})});var h=$(".btn.auto-translate");h.each(function(){var e=$(this).data("trans"),t=$(this).data("locale"),a=$(this);a.on("click",function(i){i.preventDefault(),i.stopPropagation();var s=[];$(".auto-translatable-"+t).each(function(){var t=$(this).parent().find(".vsch_editable");if(t.length>1){var a=$(t[0]),n=$(t[e]),i=t.closest("tr");!i.hasClass("hidden")&&n.length&&a.length&&n.hasClass("editable-empty")&&!a.hasClass("editable-empty")&&s.push({srcText:a.text(),dataUrl:n.data("url"),dataName:n.data("name"),dstElem:n})}}),function(e,t,a){n(s,a,function(a,n){xtranslateText(xtranslateService,e,a,t,function(e,t){n(e,t)})})}(PRIMARY_LOCALE,t,a)})});var u=$("#auto-fill");u.on("click",function(e){var t=[];e.preventDefault(),e.stopPropagation(),$(".auto-fillable").each(function(){var e=$(this).find("a.vsch_editable.editable-empty"),a=e.closest("tr");e.length&&!a.hasClass("hidden")&&t.push({srcText:e.data("name").substr(PRIMARY_LOCALE.length+1),dataUrl:e.data("url"),dataName:e.data("name"),dstElem:e})}),function(e){n(t,e,function(e,t){var a=/^.*\.|-|_/g,n=e.replace(a," ").toCapitalCase().trim();t(n,"")})}(u)}),$(".auto-delete-key").on("click",function(){var e=$("#translations").find("tbody").first(),t=e.find(".delete-key");t.each(function(){var e=$(this).closest("tr");e.hasClass("hidden")||$(this).hasClass("hidden")||$(this).trigger("click")})}),$(".auto-undelete-key").on("click",function(){var e=$("#translations").find("tbody").first(),t=e.find(".undelete-key");t.each(function(){var e=$(this).closest("tr");e.hasClass("hidden")||$(this).hasClass("hidden")||$(this).trigger("click")})});var f=$(".btn.auto-prop-case");f.each(function(){var e=$(this).data("trans"),t=$(this).data("locale"),a=$(this);a.on("click",function(i){i.preventDefault(),i.stopPropagation();var s=[],l=XRegExp("^(\\p{Alphabetic}|\\p{Number})+(\\p{Space_Separator}+(\\p{Alphabetic}|\\p{Number})+)+\\.?$");$(".auto-translatable-"+t).each(function(){var t=$(this).closest("tr");if(!t.hasClass("hidden")){var a=$(this).parent().find(".vsch_editable");if(a.length>1){var n=$(a[0]),i=$(a[e]);if(i.length&&!i.hasClass("editable-empty")){var r=i.text(),o=l.test(r);window.console.log(r+" simple "+o),r!==r.toLocaleProperCaseOrLowerCase()&&o&&s.push({srcText:i.text(),dataUrl:i.data("url"),dataName:i.data("name"),dstElem:i})}}}}),s.length>0&&!function(e,t,a){n(s,a,function(e,t){t(e.toLocaleProperCaseOrLowerCase(),"")})}(t,t,a)})});var v=$("#form-addkeys").first();if(i(v.find("textarea[name=keys]"),v.find("textarea[name=suffixes]"),!0)(),i($("#primary-text"),$("#current-text"),!0)(),i($("#srckeys"),$("#dstkeys"),!0)(),TRANS_FILTERS&&""!=CURRENT_GROUP){var m=TRANS_FILTERS.filter,p=TRANS_FILTERS.regex,g=$("#"+m);g.prop("checked","checked"),("show-all"!==m||p)&&($("#show-matching-text")[0].value=p,g.trigger("click"))}$(function(){$(".user-locales").editable({template:'<form class="form-inline editableform"><div class="control-group"><div><div id="x-trans-edit" class="editable-input"></div></div><div class="editable-error-block"></div></div></form>',source:USER_LOCALES,emptytext:"All",showbuttons:!1,display:function(e,t){var a=[],n=$.fn.editableutils.itemsByValue(e,t);n.length?($.each(n,function(e,t){a.push($.fn.editableutils.escape(t.text))}),$(this).html(a.join(" "))):$(this).empty()}})})});<commit_msg>add regex error message to ltm key filter regex<commit_after>var CLIP_TEXT,YANDEX_TRANSLATOR_KEY,URL_YANDEX_TRANSLATOR_KEY,PRIMARY_LOCALE,CURRENT_LOCALE,CURRENT_GROUP,TRANSLATING_LOCALE,URL_TRANSLATOR_GROUP,URL_TRANSLATOR_ALL,URL_TRANSLATOR_FILTERS,xtranslateText,xtranslateService,TRANS_FILTERS,USER_LOCALES;jQuery(document).ready(function($){function e(e,t){e.find("tr").each(function(){if(!$(this).hasClass("hidden")){var e=$(this).find("td.key").first();if(e.length>0){var a=e[0].innerText;t.exec(a)||$(this).addClass("hidden")}}})}function t(e){e.find("tr").removeClass("hidden")}function a(t){var a=$("#translations").find("tbody").first(),n=$("#show-matching-text"),s=$("#show-matching-text-label"),i,l,d,c,h,u="",f;if(t=$(t),t.length>0&&(o=t.prop("id")),l=a.find("tr").length,r(a),c=d=l-a.find("tr.hidden").length,t.length>0){var v=t.parent().parent();$(".translation-filter").removeClass("has-success has-error has-feedback has-highlight"),"show-all"!=o&&(d>0?d==l?v.addClass("has-feedback"):v.addClass("has-highlight"):v.addClass("has-error"))}if(n.length>0){u=n[0].value.trim();var m=!1;try{i=new RegExp(u,"i"),s.html("&nbsp;")}catch(e){i=new RegExp(""),s.text(e.message),m=!0}e(a,i),c=l-a.find("tr.hidden").length;var p=n.parent("div");p.removeClass("has-error has-success has-feedback has-highlight"),n.removeClass("bg-danger bg-success bg-highlight regex-error"),m?(p.addClass("has-error"),n.addClass("regex-error")):u.length>0&&d>0&&(0==c?(p.addClass("has-error"),n.addClass("bg-danger")):d>c&&(p.addClass("has-highlight"),n.addClass("bg-highlight")))}var g=$.ajax({type:"GET",url:URL_TRANSLATOR_FILTERS,data:{filter:o,regex:u},success:function(e){"ok"===e.status},encode:!0});if(h=$("#key-filter").first(),h.length>0){var C="";c!==d&&(C+=c+"/"),d!==l&&(C+=d+"/"),C+=l,h.removeClass("have-filtered"),c!==l&&h.addClass("have-filtered"),h[0].innerHTML=C}}function n(e,t,a){if(e.length){var n,s,i=t.text(),l=t.data("disable-with");n=e.length,s=0;var r,o=function(e){a(e.srcText,function(a,n){if(""!==a){var s=$.ajax({type:"POST",url:e.dataUrl,data:{name:e.dataName,value:a},success:function(n){"ok"===n.status?(e.dstElem.removeClass("editable-empty status-0"),e.dstElem.addClass("status-1"),e.dstElem.text(a),e.dstElem.editable("setValue",a,!1),e.dstElem.closest("tr").addClass("has-changed-translation")):(t.removeAttr("disabled"),t.text(i))},encode:!0});s.done(function(){r()}),s.fail(function(){t.removeAttr("disabled"),t.text(i)})}else t.removeAttr("disabled"),t.text(i)})};r=function(){e.length?(s++,o(e.pop()),t.attr("disabled","disabled"),t.text(l+" "+s+" / "+n)):(t.removeAttr("disabled"),t.text(i))};for(var d=0;5>d;d++)r()}}function s(e,t,a){return function(){var n={id:null},s={id:null},i=function(e,t,a){return function(){"both"===t.css("resize")?(t.outerWidth(e.outerWidth()),t.outerHeight(e.outerHeight())):"horizontal"===t.css("resize")?t.outerWidth(e.outerWidth()):"vertical"===t.css("resize")&&t.outerHeight(e.outerHeight()),a.id&&(clearTimeout(a.id),a.id=null)}};a&&$(window).on("mousemove",function(a){a.target===e[0]?(n.id&&(clearTimeout(n.id),n.id=null),n.id=setTimeout(i(e,t,n),1e3/30)):a.target===t[0]&&(s.id&&(clearTimeout(s.id),s.id=null),s.id=setTimeout(i(t,e,s),1e3/30))}),$(window).on("mouseup",function(a){null!==n.id&&(clearTimeout(n.id),n.id=null),a.target===e[0]?i(e,t,n)():a.target===t[0]&&i(t,e,s)()})}}$(".group-select").on("change",function(){var e=$(this).val();e?window.location.href=URL_TRANSLATOR_GROUP+$(this).val():window.location.href=URL_TRANSLATOR_ALL}),$("a.delete-key").on("ajax:success",function(e,t){var a=$(this).closest("tr");a.addClass("deleted-translation"),$(this).addClass("hidden"),a.find("a.undelete-key").first().removeClass("hidden")}),$("a.undelete-key").on("ajax:success",function(e,t){var a=$(this).closest("tr");a.removeClass("deleted-translation"),$(this).addClass("hidden"),a.find("a.delete-key").first().removeClass("hidden")});var i=function(e){var t=$("div.success-"+e),a=t.html();$(".form-"+e).on("ajax:success",function(e,n){t.html(a.replace(/:count\b/,n.counter)),t.closest("div.alert").slideDown()})};i("import-group"),i("import-all"),i("find"),$(".form-publish-group").on("ajax:success",function(e,t){if("errors"===t.status){var a=$("div.errors-alert"),n=t.errors;a.html("<p>"+n.join("</p>\n<p>")+"</p>\n"),a.closest("div.alert").slideDown()}else $("div.success-publish").closest("div.alert").slideDown(),$("tr.deleted-translation").remove()}),$(".form-publish-all").on("ajax:success",function(e,t){if("errors"===t.status){var a=$("div.errors-alert"),n=t.errors;a.html("<p>"+n.join("</p>\n<p>")+"</p>\n"),a.closest("div.alert").slideDown()}else $("div.success-publish-all").closest("div.alert").slideDown(),$("tr.deleted-translation").remove()}),$("#form-keyops").on("ajax:success",function(e,t){var a=$("#wildcard-keyops-results").first();a.html(t),a.find(".vsch_editable").vsch_editable()});var l=$("#searchModal").first();l.on("shown.bs.modal",function(e,t,a,n){l.find("#search-form-text").first().focus()}),l.on("ajax:success",function(e,t,a,n){var s=l.find(".results");s.html(t),s.find(".vsch_editable").vsch_editable()}),$("#translate-current-primary").on("click",function(){var e=$("#current-text").first(),t=e[0].value;xtranslateService(TRANSLATING_LOCALE,t,PRIMARY_LOCALE,function(e){var t=$("#primary-text").first();t.length&&t.val(e)})}),$("#translate-primary-current").on("click",function(){var e=$("#primary-text").first(),t=e[0].value;xtranslateService(PRIMARY_LOCALE,t,TRANSLATING_LOCALE,function(e){var t=$("#current-text").first();t.length&&t.val(e)})}),$("#db-connection").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#interface-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#translating-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#primary-locale").on("change",function(){$("#form-interface-locale")[0].submit()}),$("#display-locale-all").on("click",function(e){e.preventDefault(),$(".display-locale").prop("checked",!0)}),$("#display-locale-none").on("click",function(e){e.preventDefault(),$(".display-locale").prop("checked",!1)});var r=t,o="show-all";$("#show-all").on("click",function(e){r=t,a(this)}),$("#show-need-attention").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-empty-translation").removeClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)}),$("#show-unpublished").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)}),$("#show-new").on("click",function(e){r=function(e){e.find("tr").removeClass("hidden"),e.find("tr.has-nonempty-translation").addClass("hidden")},a(this)}),$("#show-empty").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-empty-translation").removeClass("hidden")},a(this)}),$("#show-nonempty").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-nonempty-translation").removeClass("hidden")},a(this)}),$("#show-used").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-used-translation").removeClass("hidden")},a(this)}),$("#show-deleted").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.deleted-translation").removeClass("hidden")},a(this)}),$("#show-changed").on("click",function(e){r=function(e){e.find("tr").addClass("hidden"),e.find("tr.has-changed-translation").removeClass("hidden")},a(this)});var d=null,c=$("#show-matching-text");c.on("keyup change",function(){d&&(window.clearTimeout(d),d=null),d=window.setTimeout(function(){d=null,a()},100)}),$("#show-matching-clear").on("click",function(){c.length&&(c[0].value="",c.focus(),a())}),$("div.alert-dismissible").each(function(){var e=$(this),t=e.find("button.close").first();t.length&&t.on("click",function(){e.slideUp()})});var h=$(".btn.auto-translate");h.each(function(){var e=$(this).data("trans"),t=$(this).data("locale"),a=$(this);a.on("click",function(s){s.preventDefault(),s.stopPropagation();var i=[];$(".auto-translatable-"+t).each(function(){var t=$(this).parent().find(".vsch_editable");if(t.length>1){var a=$(t[0]),n=$(t[e]),s=t.closest("tr");!s.hasClass("hidden")&&n.length&&a.length&&n.hasClass("editable-empty")&&!a.hasClass("editable-empty")&&i.push({srcText:a.text(),dataUrl:n.data("url"),dataName:n.data("name"),dstElem:n})}}),function(e,t,a){n(i,a,function(a,n){xtranslateText(xtranslateService,e,a,t,function(e,t){n(e,t)})})}(PRIMARY_LOCALE,t,a)})});var u=$("#auto-fill");u.on("click",function(e){var t=[];e.preventDefault(),e.stopPropagation(),$(".auto-fillable").each(function(){var e=$(this).find("a.vsch_editable.editable-empty"),a=e.closest("tr");e.length&&!a.hasClass("hidden")&&t.push({srcText:e.data("name").substr(PRIMARY_LOCALE.length+1),dataUrl:e.data("url"),dataName:e.data("name"),dstElem:e})}),function(e){n(t,e,function(e,t){var a=/^.*\.|-|_/g,n=e.replace(a," ").toCapitalCase().trim();t(n,"")})}(u)}),$(".auto-delete-key").on("click",function(){var e=$("#translations").find("tbody").first(),t=e.find(".delete-key");t.each(function(){var e=$(this).closest("tr");e.hasClass("hidden")||$(this).hasClass("hidden")||$(this).trigger("click")})}),$(".auto-undelete-key").on("click",function(){var e=$("#translations").find("tbody").first(),t=e.find(".undelete-key");t.each(function(){var e=$(this).closest("tr");e.hasClass("hidden")||$(this).hasClass("hidden")||$(this).trigger("click")})});var f=$(".btn.auto-prop-case");f.each(function(){var e=$(this).data("trans"),t=$(this).data("locale"),a=$(this);a.on("click",function(s){s.preventDefault(),s.stopPropagation();var i=[],l=XRegExp("^(\\p{Alphabetic}|\\p{Number})+(\\p{Space_Separator}+(\\p{Alphabetic}|\\p{Number})+)+\\.?$");$(".auto-translatable-"+t).each(function(){var t=$(this).closest("tr");if(!t.hasClass("hidden")){var a=$(this).parent().find(".vsch_editable");if(a.length>1){var n=$(a[0]),s=$(a[e]);if(s.length&&!s.hasClass("editable-empty")){var r=s.text(),o=l.test(r);window.console.log(r+" simple "+o),r!==r.toLocaleProperCaseOrLowerCase()&&o&&i.push({srcText:s.text(),dataUrl:s.data("url"),dataName:s.data("name"),dstElem:s})}}}}),i.length>0&&!function(e,t,a){n(i,a,function(e,t){t(e.toLocaleProperCaseOrLowerCase(),"")})}(t,t,a)})});var v=$("#form-addkeys").first();if(s(v.find("textarea[name=keys]"),v.find("textarea[name=suffixes]"),!0)(),s($("#primary-text"),$("#current-text"),!0)(),s($("#srckeys"),$("#dstkeys"),!0)(),TRANS_FILTERS&&""!=CURRENT_GROUP){var m=TRANS_FILTERS.filter,p=TRANS_FILTERS.regex,g=$("#"+m);g.prop("checked","checked"),("show-all"!==m||p)&&($("#show-matching-text")[0].value=p,g.trigger("click"))}$(function(){$(".user-locales").editable({template:'<form class="form-inline editableform"><div class="control-group"><div><div id="x-trans-edit" class="editable-input"></div></div><div class="editable-error-block"></div></div></form>',source:USER_LOCALES,emptytext:"All",showbuttons:!1,display:function(e,t){var a=[],n=$.fn.editableutils.itemsByValue(e,t);n.length?($.each(n,function(e,t){a.push($.fn.editableutils.escape(t.text))}),$(this).html(a.join(" "))):$(this).empty()}})})});
{'fraction_non_alphanumeric': 0.3221854600733256, 'fraction_numerical': 0.005007600822677278, 'mean_word_length': 14.630328441649196, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 65, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5376426', 'n_tokens_mistral': 8423, 'n_tokens_neox': 8460, 'n_words': 184}