(function(){Registry.require(["helper"],function(){var n={},p={},c=null,e=[],g=Registry.get("helper"),r=function(a){var b=a,d=Array.prototype.slice.call(arguments,1);1==d.length&&"Array"===g.toType(d[0])&&(d=d[0]);for(var f=/(^|_)0[a-zA-Z]+0(_|$)/,l=0;l<d.length;l++){var c=b.match(f);if(!c){console.log("getMessage(): wrong argument count!!!");break}b=b.replace(f,(c[1]?" ":"")+d[l]+(c[2]?" ":""))}return b.replace(/_/g," ")},x=function(a,b){var d=a.message;1==b.length&&"Array"===g.toType(b[0])&&(b=
b[0]);a.placeholders&&Object.keys(a.placeholders).forEach(function(f){try{var c=Number(a.placeholders[f].content.replace(/^\$/,""))-1,q;c<b.length?(q=b[c],d=d.replace("$"+f+"$",q)):console.log("i18n: invalid argument count on processing '"+d+"' with args "+JSON.stringify(b))}catch(e){console.log("i18n: error processing '"+d+"' with args "+JSON.stringify(b))}});return d},t=function(a){var b=[arguments[0]],d=[],c=function(a){for(var b=0;b<a.length;b++)"Array"===g.toType(a[b])?c(a[b]):d.push(String(a[b]))};
c(Array.prototype.slice.call(arguments,1));d.length&&b.push(d);return rea.i18n.getMessage.apply(this,b)},u=function(a){try{var b=Registry.getRaw("_locales/"+a+"/messages.json");if(b)return JSON.parse(b)}catch(d){console.log("i18n: parsing locale "+a+" failed!")}},m=function(a){a=a.concat("en");for(var b=0;b<a.length;b++){var d=a[b];if(d){var c;if(!(c=d.replace("_","-"))||-1!==v.indexOf(c)||!(c=d.replace("-","_"))||-1!==v.indexOf(c))if(n=u(c))return h||(p=u("en")||{}),d}}return null},w=[{name:"Arabic - \u200e\u202b\u0627\u0644\u0639\u0631\u0628\u064a\u0629\u202c\u200e",
value:"ar"},{name:"Chinese (Simplified) - \u4e2d\u6587\uff08\u7b80\u4f53\u4e2d\u6587\uff09",value:"zh_CN"},{name:"Chinese (Traditional) - \u4e2d\u6587\uff08\u7e41\u9ad4\uff09",value:"zh_TW"},{name:"Czech - \u010de\u0161tina",value:"cs"},{name:"English",value:"en"},{name:"French - fran\u00e7ais",value:"fr"},{name:"German - Deutsch",value:"de"},{name:"Hungarian - magyar",value:"hu"},{name:"Indonesian - Indonesia",value:"id"},{name:"Italian - italiano",value:"it"},{name:"Japanese - \u65e5\u672c\u8a9e",
value:"ja"},{name:"Polish - polski",value:"pl"},{name:"Korean - \ud55c\uad6d\uc5b4",value:"ko"},{name:"Portuguese (Brazil) - portugu\u00eas (Brasil)",value:"pt_BR"},{name:"Portuguese (Portugal) - portugu\u00eas (Portugal)",value:"pt_PT"},{name:"Russian - \u0440\u0443\u0441\u0441\u043a\u0438\u0439",value:"ru"},{name:"Slovak - sloven\u010dina",value:"sk"},{name:"Spanish - espa\u00f1ol",value:"es"},{name:"Ukrainian - \u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430",value:"uk"}],v=w.map(function(a){return a.value}),
k="undefined"!==typeof rea,h=k?rea.i18n.native_support:!1;(function(){var a=k?rea.i18n.getUILanguage():navigator.language;if(a){var b=[a],d=a.split(/[-_]/);d[0]!==a&&b.push(d[0]);b.forEach(function(a){e.unshift(a)})}c||h||(c=m(e));k&&rea.i18n.getAcceptLanguages(function(a){a.forEach(function(a){e.push(a)});c||h||(c=m(e))})})();Registry.register("i18n","5454",{getMessage:function(a){var b;return c&&(b=n[a]||p[a])?x(b,Array.prototype.slice.call(arguments,1)):(b=t.apply(this,arguments))?
b:Registry.isDevVersion("helper")?(b="#"+r.apply(this,arguments).replace(/ /g,"#")+"#",console.warn("i18n:"+b),b):r.apply(this,arguments)},getOriginalMessage:t,parseLocale:function(a){return a?g.map(a.replace(/-/g,"_").split("_"),function(a,c){return c?a.toUpperCase():a.toLowerCase()}).join("_"):a},getTranslation:function(a,b){var d=null;if(a){var f=c?[c].concat(e):e;g.each(f,function(c,e){var f=b+"_i18n";if(void 0!==a[f])return d=a[f][c],!1})}return d||a[b]},setLocale:function(a){"null"===a&&(a=
null);!a&&h?c=a:a!==c&&(c=m([a].concat(e).concat([c])),c!=a&&console.log("i18n: retrieving locale "+a+" failed!"))},getLocale:function(){return c},getUiLocale:function(){return(c||k?rea.i18n.getUILanguage():e[0]||navigator.language||"en").split(/[-_]+/)[0]},supported:w})})})();
