(function(){Registry.require(["helper"],function(){var l={},e=null,f=[],h=Registry.get("helper"),k=function(a){var b=a,c=Array.prototype.slice.call(arguments,1);1==c.length&&"Array"===h.toType(c[0])&&(c=c[0]);for(var d=/_0[a-zA-Z]+0/,g=0;g<c.length;g++){if(-1==b.search(d)){console.log("getMessage(): wrong argument count!!!");break}b=b.replace(d," "+c[g])}return b.replace(/_/g," ")},m=function(a){var b=[arguments[0]],c=[],d=function(a){for(var b=0;b<a.length;b++)"Array"===h.toType(a[b])?d(a[b]):c.push(String(a[b]))};
d(Array.prototype.slice.call(arguments,1));c.length&&b.push(c);return(b=rea.i18n.getMessage.apply(this,b))?b:Registry.isDevVersion("helper")?(console.warn("i18n:#"+k.apply(this,arguments).replace(/ /g,"#")+"#"),"#"+k.apply(this,arguments).replace(/ /g,"#")+"#"):k.apply(this,arguments)},p=function(a){if(e){var b=l[a];if(b){var c=Array.prototype.slice.call(arguments,1),d=b.message;1==c.length&&"Array"===h.toType(c[0])&&(c=c[0]);for(var g in b.placeholders)try{var f=Number(b.placeholders[g].content.replace(/^\$/,
""))-1,n;f<c.length?(n=c[f],d=d.replace("$"+g+"$",n)):console.log("i18n: invalid argument count on processing '"+d+"' with args "+JSON.stringify(c))}catch(p){console.log("i18n: error processing '"+d+"' with args "+JSON.stringify(c))}return d}return k.apply(this,arguments)}return m.apply(this,arguments)};(function(){if("undefined"===typeof rea)e="en";else{var a=rea.i18n.getUILanguage();a&&(f.unshift(a),e||rea.i18n.native_support||(e=f[0]||void 0));rea.i18n.getAcceptLanguages(function(a){a.forEach(function(a){f.push(a)});
e||rea.i18n.native_support||(e=f[0]||"en")})}})();Registry.register("i18n","58",{getMessage:function(a){return p.apply(this,arguments)},getOriginalMessage:m,parseLocale:function(a){return a?h.map(a.replace(/-/g,"_").split("_"),function(a,c){return c?a.toUpperCase():a.toLowerCase()}).join("_"):a},getTranslation:function(a,b){var c=null;if(a){var d=e?[e].concat(f):f;h.each(d,function(d,e){var f=b+"_i18n";if(void 0!==a[f])return c=a[f][d],!1})}return c||a[b]},setLocale:function(a){"null"===
a&&(a=null);if(e==a)return!0;if(a){var b=Registry.getRaw("_locales/"+a+"/messages.json");if(b)try{return l=JSON.parse(b),e=a,!0}catch(c){console.log("i18n: parsing locale "+a+" failed!")}else console.log("i18n: retrieving locale "+a+" failed!");return!1}l={};e=null;return!0},getLocale:function(){return e}})})})();
