text: (function(n){"use strict";var i,t,r=Array.prototype.slice;t=function(i){this.options=n.extend({},t.defaults,i);this.parser=this.options.parser;this.locale=this.options.locale;this.messageStore=this.options.messageStore;this.languages={};this.init()};t.prototype={init:function(){var t=this;String.locale=t.locale;String.prototype.toLocaleString=function(){var u,r,o,i,f,s,e;for(o=this.valueOf(),i=t.locale,f=0;i;){u=i.split("-");r=u.length;do{if(s=u.slice(0,r).join("-"),e=t.messageStore.get(s,o),e)return e;r--}while(r);if(i==="en")break;i=n.i18n.fallbacks[t.locale]&&n.i18n.fallbacks[t.locale][f]||t.options.fallbackLocale;n.i18n.log("Trying fallback locale for "+t.locale+": "+i);f++}return""}},destroy:function(){n.removeData(document,"i18n")},load:function(t,i){var r,e,u,f={};if(t||i||(t="i18n/"+n.i18n().locale+".json",i=n.i18n().locale),typeof t=="string"&&t.split(".").pop()!=="json"){f[i]=t+"/"+i+".json";r=(n.i18n.fallbacks[i]||[]).concat(this.options.fallbackLocale);for(e in r)u=r[e],f[u]=t+"/"+u+".json";return this.load(f)}return this.messageStore.load(t,i)},parse:function(t,i){var r=t.toLocaleString();return this.parser.language=n.i18n.languages[n.i18n().locale]||n.i18n.languages["default"],r===""&&(r=t),this.parser.parse(r,i)}};n.i18n=function(i,u){var o,f=n.data(document,"i18n"),e=typeof i=="object"&&i;return e&&e.locale&&f&&f.locale!==e.locale&&(String.locale=f.locale=e.locale),f||(f=new t(e),n.data(document,"i18n",f)),typeof i=="string"?(o=u!==undefined?r.call(arguments,1):[],f.parse(i,o)):f};n.fn.i18n=function(){var i=n.data(document,"i18n");return i||(i=new t,n.data(document,"i18n",i)),String.locale=i.locale,this.each(function(){var t=n(this),r=t.data("i18n");r?t.text(i.parse(r)):t.find("[data-i18n]").i18n()})};String.locale=String.locale||n("html").attr("lang");String.locale||(typeof navigator!==undefined?(i=window.navigator,String.locale=i.language||i.userLanguage||""):String.locale="");n.i18n.languages={};n.i18n.messageStore=n.i18n.messageStore||{};n.i18n.parser={parse:function(n,t){return n.replace(/\$(\d+)/g,function(n,i){var r=parseInt(i,10)-1;return t[r]!==undefined?t[r]:"$"+i})},emitter:{}};n.i18n.fallbacks={};n.i18n.debug=!1;n.i18n.log=function(){window.console&&n.i18n.debug&&window.console.log.apply(window.console,arguments)};t.defaults={locale:String.locale,fallbackLocale:"en",parser:n.i18n.parser,messageStore:n.i18n.messageStore};n.i18n.constructor=t})(jQuery);