You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
36 KiB
1 lines
36 KiB
(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):n.i18next=t()})(this,function(){"use strict";function p(n){return n==null?"":""+n}function et(n,t,i){n.forEach(function(n){t[n]&&(i[n]=t[n])})}function l(n,t,i){function f(n){return n&&n.indexOf("###")>-1?n.replace(/###/g,"."):n}for(var u=typeof t!="string"?[].concat(t):t.split("."),r;u.length>1;){if(!n)return{};r=f(u.shift());!n[r]&&i&&(n[r]=new i);n=n[r]}return n?{obj:n,k:f(u.shift())}:{}}function w(n,t,i){var r=l(n,t,Object),u=r.obj,f=r.k;u[f]=i}function ot(n,t,i,r){var e=l(n,t,Object),u=e.obj,f=e.k;u[f]=u[f]||[];r&&(u[f]=u[f].concat(i));r||u[f].push(i)}function u(n,t){var i=l(n,t),r=i.obj,u=i.k;return r?r[u]:undefined}function b(n,t,i){for(var r in t)r in n?typeof n[r]=="string"||n[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?i&&(n[r]=t[r]):b(n[r],t[r],i):n[r]=t[r];return n}function r(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function k(n){return typeof n=="string"?n.replace(/[&<>"'\/]/g,function(n){return st[n]}):n}function a(n){return n.interpolation={unescapeSuffix:"HTML"},n.interpolation.prefix=n.interpolationPrefix||"__",n.interpolation.suffix=n.interpolationSuffix||"__",n.interpolation.escapeValue=n.escapeInterpolation||!1,n.interpolation.nestingPrefix=n.reusePrefix||"$t(",n.interpolation.nestingSuffix=n.reuseSuffix||")",n}function ct(n){return n.resStore&&(n.resources=n.resStore),n.ns&&n.ns.defaultNs?(n.defaultNS=n.ns.defaultNs,n.ns=n.ns.namespaces):n.defaultNS=n.ns||"translation",n.fallbackToDefaultNS&&n.defaultNS&&(n.fallbackNS=n.defaultNS),n.saveMissing=n.sendMissing,n.saveMissingTo=n.sendMissingTo||"current",n.returnNull=n.fallbackOnNull?!1:!0,n.returnEmptyString=n.fallbackOnEmpty?!1:!0,n.returnObjects=n.returnObjectTrees,n.joinArrays="\n",n.returnedObjectHandler=n.objectTreeKeyHandler,n.parseMissingKeyHandler=n.parseMissingKey,n.appendNamespaceToMissingKey=!0,n.nsSeparator=n.nsseparator,n.keySeparator=n.keyseparator,n.shortcutFunction==="sprintf"&&(n.overloadTranslationOptionHandler=function(n){for(var i=[],t=1;t<n.length;t++)i.push(n[t]);return{postProcess:"sprintf",sprintf:i}}),n.whitelist=n.lngWhitelist,n.preload=n.preload,n.load==="current"&&(n.load="currentOnly"),n.load==="unspecific"&&(n.load="languageOnly"),n.backend=n.backend||{},n.backend.loadPath=n.resGetPath||"locales/__lng__/__ns__.json",n.backend.addPath=n.resPostPath||"locales/add/__lng__/__ns__",n.backend.allowMultiLoading=n.dynamicLoad,n.cache=n.cache||{},n.cache.prefix="res_",n.cache.expirationTime=6048e5,n.cache.enabled=n.useLocalStorage?!0:!1,n=a(n),n.defaultVariables&&(n.interpolation.defaultVariables=n.defaultVariables),n}function lt(n){return n=a(n),n.joinArrays="\n",n}function g(n){return(n.interpolationPrefix||n.interpolationSuffix||n.escapeInterpolation)&&(n=a(n)),n.nsSeparator=n.nsseparator,n.keySeparator=n.keyseparator,n.returnObjects=n.returnObjectTrees,n}function at(n){n.lng=function(){return t.deprecate("i18next.lng() can be replaced by i18next.language for detected language or i18next.languages for languages ordered by translation lookup."),n.services.languageUtils.toResolveHierarchy(n.language)[0]};n.preload=function(i,r){t.deprecate("i18next.preload() can be replaced with i18next.loadLanguages()");n.loadLanguages(i,r)};n.setLng=function(i,r,u){if(t.deprecate("i18next.setLng() can be replaced with i18next.changeLanguage() or i18next.getFixedT() to get a translation function with fixed language or namespace."),typeof r=="function"&&(u=r,r={}),r||(r={}),r.fixLng===!0&&u)return u(null,n.getFixedT(i));n.changeLanguage(i,u)};n.addPostProcessor=function(i,r){t.deprecate("i18next.addPostProcessor() can be replaced by i18next.use({ type: 'postProcessor', name: 'name', process: fc })");n.use({type:"postProcessor",name:i,process:r})}}function v(n){return n.charAt(0).toUpperCase()+n.slice(1)}function wt(){var n={};return yt.forEach(function(t){t.lngs.forEach(function(i){return n[i]={numbers:t.nr,plurals:pt[t.fc]}})}),n}function dt(n,t){for(var i=n.indexOf(t);i!==-1;)n.splice(i,1),i=n.indexOf(t)}function y(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",saveMissing:!1,saveMissingTo:"fallback",missingKeyHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,overloadTranslationOptionHandler:function(n){return{defaultValue:n[1]}},interpolation:{escapeValue:!0,format:function(n){return n},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",defaultVariables:undefined}}}function h(n){return typeof n.ns=="string"&&(n.ns=[n.ns]),typeof n.fallbackLng=="string"&&(n.fallbackLng=[n.fallbackLng]),typeof n.fallbackNS=="string"&&(n.fallbackNS=[n.fallbackNS]),n.whitelist&&n.whitelist.indexOf("cimode")<0&&n.whitelist.push("cimode"),n}function tt(){}var c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ii=function(){function t(n){this.value=n}function n(n){function e(n,t){return new Promise(function(f,e){var o={key:n,arg:t,resolve:f,reject:e,next:null};r?r=r.next=o:(i=r=o,u(n,t))})}function u(i,r){try{var e=n[i](r),o=e.value;o instanceof t?Promise.resolve(o.value).then(function(n){u("next",n)},function(n){u("throw",n)}):f(e.done?"return":"normal",e.value)}catch(s){f("throw",s)}}function f(n,t){switch(n){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}i=i.next;i?u(i.key,i.arg):r=null}var i,r;this._invoke=e;typeof n.return!="function"&&(this.return=undefined)}return typeof Symbol=="function"&&Symbol.asyncIterator&&(n.prototype[Symbol.asyncIterator]=function(){return this}),n.prototype.next=function(n){return this._invoke("next",n)},n.prototype.throw=function(n){return this._invoke("throw",n)},n.prototype.return=function(n){return this._invoke("return",n)},{wrap:function(t){return function(){return new n(t.apply(this,arguments))}},await:function(n){return new t(n)}}}(),i=function(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");},n=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},it=function it(n,t,i){var r,u,f;return n===null&&(n=Function.prototype),r=Object.getOwnPropertyDescriptor(n,t),r===undefined?(u=Object.getPrototypeOf(n),u===null?undefined:it(u,t,i)):"value"in r?r.value:(f=r.get,f===undefined)?undefined:f.call(i)},f=function(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}});t&&(Object.setPrototypeOf?Object.setPrototypeOf(n,t):n.__proto__=t)},e=function(n,t){if(!n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:n},rt=function rt(n,t,i,r){var u=Object.getOwnPropertyDescriptor(n,t),f,e;return u===undefined?(f=Object.getPrototypeOf(n),f!==null&&rt(f,t,i,r)):"value"in u&&u.writable?u.value=i:(e=u.set,e!==undefined&&e.call(r,i)),i},s=function(){function n(n,t){var r=[],u=!0,f=!1,e=undefined,i,o;try{for(i=n[Symbol.iterator]();!(u=(o=i.next()).done);u=!0)if(r.push(o.value),t&&r.length===t)break}catch(s){f=!0;e=s}finally{try{!u&&i["return"]&&i["return"]()}finally{if(f)throw e;}}return r}return function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return n(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),ut={type:"logger",log:function(n){this._output("log",n)},warn:function(n){this._output("warn",n)},error:function(n){this._output("error",n)},_output:function(n,t){console&&console[n]&&console[n].apply(console,Array.prototype.slice.call(t))}},ft=function(){function t(n){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};i(this,t);this.init(n,r)}return t.prototype.init=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this.prefix=t.prefix||"i18next:";this.logger=n||ut;this.options=t;this.debug=t.debug===!1?!1:!0},t.prototype.setDebug=function(n){this.debug=n},t.prototype.log=function(){this.forward(arguments,"log","",!0)},t.prototype.warn=function(){this.forward(arguments,"warn","",!0)},t.prototype.error=function(){this.forward(arguments,"error","")},t.prototype.deprecate=function(){this.forward(arguments,"warn","WARNING DEPRECATED: ",!0)},t.prototype.forward=function(n,t,i,r){(!r||this.debug)&&(typeof n[0]=="string"&&(n[0]=i+this.prefix+" "+n[0]),this.logger[t](n))},t.prototype.create=function(i){return new t(this.logger,n({prefix:this.prefix+":"+i+":"},this.options))},t}(),t=new ft,o=function(){function n(){i(this,n);this.observers={}}return n.prototype.on=function(n,t){var i=this;n.split(" ").forEach(function(n){i.observers[n]=i.observers[n]||[];i.observers[n].push(t)})},n.prototype.off=function(n,t){var i=this;this.observers[n]&&this.observers[n].forEach(function(){if(t){var r=i.observers[n].indexOf(t);r>-1&&i.observers[n].splice(r,1)}else delete i.observers[n]})},n.prototype.emit=function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];this.observers[n]&&this.observers[n].forEach(function(n){n.apply(undefined,r)});this.observers["*"]&&this.observers["*"].forEach(function(t){var i;t.apply(t,(i=[n]).concat.apply(i,r))})},n}(),st={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},ht=function(t){function r(){var u=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{ns:["translation"],defaultNS:"translation"},n;return i(this,r),n=e(this,t.call(this)),n.data=u,n.options=f,n}return f(r,t),r.prototype.addNamespaces=function(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)},r.prototype.removeNamespaces=function(n){var t=this.options.ns.indexOf(n);t>-1&&this.options.ns.splice(t,1)},r.prototype.getResource=function(n,t,i){var e=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},f=e.keySeparator||this.options.keySeparator,r;return f===undefined&&(f="."),r=[n,t],i&&typeof i!="string"&&(r=r.concat(i)),i&&typeof i=="string"&&(r=r.concat(f?i.split(f):i)),n.indexOf(".")>-1&&(r=n.split(".")),u(this.data,r)},r.prototype.addResource=function(n,t,i,r){var e=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{silent:!1},f=this.options.keySeparator,u;f===undefined&&(f=".");u=[n,t];i&&(u=u.concat(f?i.split(f):i));n.indexOf(".")>-1&&(u=n.split("."),r=t,t=u[1]);this.addNamespaces(t);w(this.data,u,r);e.silent||this.emit("added",n,t,i,r)},r.prototype.addResources=function(n,t,i){for(var r in i)typeof i[r]=="string"&&this.addResource(n,t,r,i[r],{silent:!0});this.emit("added",n,t,i)},r.prototype.addResourceBundle=function(t,i,r,f,e){var s=[t,i],o;t.indexOf(".")>-1&&(s=t.split("."),f=r,r=i,i=s[1]);this.addNamespaces(i);o=u(this.data,s)||{};f?b(o,r,e):o=n({},o,r);w(this.data,s,o);this.emit("added",t,i,r)},r.prototype.removeResourceBundle=function(n,t){this.hasResourceBundle(n,t)&&delete this.data[n][t];this.removeNamespaces(t);this.emit("removed",n,t)},r.prototype.hasResourceBundle=function(n,t){return this.getResource(n,t)!==undefined},r.prototype.getResourceBundle=function(t,i){return(i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1")?n({},this.getResource(t,i)):this.getResource(t,i)},r.prototype.toJSON=function(){return this.data},r}(o),d={processors:{},addPostProcessor:function(n){this.processors[n.name]=n},handle:function(n,t,i,r,u){var f=this;return n.forEach(function(n){f.processors[n]&&(t=f.processors[n].process(t,i,r,u))}),t}},nt=function(r){function u(n){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},f;return i(this,u),f=e(this,r.call(this)),et(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector"],n,f),f.options=o,f.logger=t.create("translator"),f}return f(u,r),u.prototype.changeLanguage=function(n){n&&(this.language=n)},u.prototype.exists=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{interpolation:{}};return this.options.compatibilityAPI==="v1"&&(t=g(t)),this.resolve(n,t)!==undefined},u.prototype.extractFromKey=function(n,t){var r=t.nsSeparator||this.options.nsSeparator,i,u;return r===undefined&&(r=":"),i=t.ns||this.options.defaultNS,r&&n.indexOf(r)>-1&&(u=n.split(r),i=u[0],n=u[1]),typeof i=="string"&&(i=[i]),{key:n,namespaces:i}},u.prototype.translate=function(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},h,p,w,b,o,f,s,a;if((typeof r=="undefined"?"undefined":c(r))!=="object"?r=this.options.overloadTranslationOptionHandler(arguments):this.options.compatibilityAPI==="v1"&&(r=g(r)),t===undefined||t===null||t==="")return"";if(typeof t=="number"&&(t=String(t)),typeof t=="string"&&(t=[t]),h=r.lng||this.language,h&&h.toLowerCase()==="cimode")return t[t.length-1];var d=r.keySeparator||this.options.keySeparator||".",k=this.extractFromKey(t[t.length-1],r),u=k.key,v=k.namespaces,e=v[v.length-1],i=this.resolve(t,r),l=Object.prototype.toString.apply(i),y=r.joinArrays!==undefined?r.joinArrays:this.options.joinArrays;if(i&&typeof i!="string"&&["[object Number]","[object Function]","[object RegExp]"].indexOf(l)<0&&!(y&&l==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(u,i,r):"key '"+u+" ("+this.language+")' returned an object instead of string.";p=l==="[object Array]"?[]:{};for(w in i)p[w]=this.translate(""+u+d+w,n({joinArrays:!1,ns:v},r));i=p}else if(y&&l==="[object Array]")i=i.join(y),i&&(i=this.extendTranslation(i,u,r));else{if(b=!1,o=!1,this.isValidLookup(i)||r.defaultValue===undefined||(b=!0,i=r.defaultValue),this.isValidLookup(i)||(o=!0,i=u),o||b){if(this.logger.log("missingKey",h,e,u,i),f=[],s=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language),this.options.saveMissingTo==="fallback"&&s&&s[0])for(a=0;a<s.length;a++)f.push(s[a]);else this.options.saveMissingTo==="all"?f=this.languageUtils.toResolveHierarchy(r.lng||this.language):f.push(r.lng||this.language);this.options.saveMissing&&(this.options.missingKeyHandler?this.options.missingKeyHandler(f,e,u,i):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(f,e,u,i));this.emit("missingKey",f,e,u,i)}i=this.extendTranslation(i,u,r);o&&i===u&&this.options.appendNamespaceToMissingKey&&(i=e+":"+u);o&&this.options.parseMissingKeyHandler&&(i=this.options.parseMissingKeyHandler(i))}return i},u.prototype.extendTranslation=function(t,i,r){var o=this,u,f,e;return r.interpolation&&this.interpolator.init(n({},r,{interpolation:n({},this.options.interpolation,r.interpolation)})),u=r.replace&&typeof r.replace!="string"?r.replace:r,this.options.interpolation.defaultVariables&&(u=n({},this.options.interpolation.defaultVariables,u)),t=this.interpolator.interpolate(t,u,this.language),t=this.interpolator.nest(t,function(){for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return o.translate.apply(o,i)},r),r.interpolation&&this.interpolator.reset(),f=r.postProcess||this.options.postProcess,e=typeof f=="string"?[f]:f,t!==undefined&&e&&e.length&&r.applyPostProcessor!==!1&&(t=d.handle(e,t,i,r,this)),t},u.prototype.resolve=function(n){var t=this,i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},r=void 0;return typeof n=="string"&&(n=[n]),n.forEach(function(n){if(!t.isValidLookup(r)){var e=t.extractFromKey(n,i),s=e.key,u=e.namespaces;t.options.fallbackNS&&(u=u.concat(t.options.fallbackNS));var f=i.count!==undefined&&typeof i.count!="string",o=i.context!==undefined&&typeof i.context=="string"&&i.context!=="",h=i.lngs?i.lngs:t.languageUtils.toResolveHierarchy(i.lng||t.language);u.forEach(function(n){t.isValidLookup(r)||h.forEach(function(u){var l;if(!t.isValidLookup(r)){var e=s,h=[e],c=void 0;for(f&&(c=t.pluralResolver.getSuffix(u,i.count)),f&&o&&h.push(e+c),o&&h.push(e+=""+t.options.contextSeparator+i.context),f&&h.push(e+=c),l=void 0;l=h.pop();)t.isValidLookup(r)||(r=t.getResource(u,n,l,i))}})})}}),r},u.prototype.isValidLookup=function(n){return n!==undefined&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")},u.prototype.getResource=function(n,t,i){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.resourceStore.getResource(n,t,i,r)},u}(o),vt=function(){function n(r){i(this,n);this.options=r;this.whitelist=this.options.whitelist||!1;this.logger=t.create("languageUtils")}return n.prototype.getLanguagePartFromCode=function(n){if(n.indexOf("-")<0)return n;var t=n.split("-");return this.formatLanguageCode(["NB-NO","NN-NO","nb-NO","nn-NO","nb-no","nn-no"].indexOf(n)>-1?t[1].toLowerCase():t[0])},n.prototype.getScriptPartFromCode=function(n){if(n.indexOf("-")<0)return null;var t=n.split("-");return t.length===2?null:(t.pop(),this.formatLanguageCode(t.join("-")))},n.prototype.getLanguagePartFromCode=function(n){if(n.indexOf("-")<0)return n;var t=n.split("-");return this.formatLanguageCode(["NB-NO","NN-NO","nb-NO","nn-NO","nb-no","nn-no"].indexOf(n)>-1?t[1].toLowerCase():t[0])},n.prototype.formatLanguageCode=function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var i=["hans","hant","latn","cyrl","cans","mong","arab"],t=n.split("-");return this.options.lowerCaseLng?t=t.map(function(n){return n.toLowerCase()}):t.length===2?(t[0]=t[0].toLowerCase(),t[1]=t[1].toUpperCase(),i.indexOf(t[1].toLowerCase())>-1&&(t[1]=v(t[1].toLowerCase()))):t.length===3&&(t[0]=t[0].toLowerCase(),t[1].length===2&&(t[1]=t[1].toUpperCase()),t[0]!=="sgn"&&t[2].length===2&&(t[2]=t[2].toUpperCase()),i.indexOf(t[1].toLowerCase())>-1&&(t[1]=v(t[1].toLowerCase())),i.indexOf(t[2].toLowerCase())>-1&&(t[2]=v(t[2].toLowerCase()))),t.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n},n.prototype.isWhitelisted=function(n,t){return(this.options.load==="languageOnly"||this.options.nonExplicitWhitelist&&!t)&&(n=this.getLanguagePartFromCode(n)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(n)>-1?!0:!1},n.prototype.getFallbackCodes=function(n,t){if(!n)return[];if(typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;var i=n[t];return i||(i=n[this.getScriptPartFromCode(t)]),i||(i=n[this.formatLanguageCode(t)]),i||(i=n.default),i||[]},n.prototype.toResolveHierarchy=function(n,t){var r=this,f=this.getFallbackCodes(t||this.options.fallbackLng||[],n),u=[],i=function(n){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;n&&(r.isWhitelisted(n,t)?u.push(n):r.logger.warn("rejecting non-whitelisted language code: "+n))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(n),!0),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(n),!0),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(n))):typeof n=="string"&&i(this.formatLanguageCode(n)),f.forEach(function(n){u.indexOf(n)<0&&i(r.formatLanguageCode(n))}),u},n}(),yt=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","es_ar","et","eu","fi","fo","fur","fy","gl","gu","ha","he","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt","pt_br","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21}],pt={1:function(n){return Number(n>1)},2:function(n){return Number(n!=1)},3:function(){return 0},4:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},5:function(n){return Number(n===0?0:n==1?1:n==2?2:n%100>=3&&n%100<=10?3:n%100>=11?4:5)},6:function(n){return Number(n==1?0:n>=2&&n<=4?1:2)},7:function(n){return Number(n==1?0:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?1:2)},8:function(n){return Number(n==1?0:n==2?1:n!=8&&n!=11?2:3)},9:function(n){return Number(n>=2)},10:function(n){return Number(n==1?0:n==2?1:n<7?2:n<11?3:4)},11:function(n){return Number(n==1||n==11?0:n==2||n==12?1:n>2&&n<20?2:3)},12:function(n){return Number(n%10!=1||n%100==11)},13:function(n){return Number(n!==0)},14:function(n){return Number(n==1?0:n==2?1:n==3?2:3)},15:function(n){return Number(n%10==1&&n%100!=11?0:n%10>=2&&(n%100<10||n%100>=20)?1:2)},16:function(n){return Number(n%10==1&&n%100!=11?0:n!==0?1:2)},17:function(n){return Number(n==1||n%10==1?0:1)},18:function(n){return Number(n==0?0:n==1?1:2)},19:function(n){return Number(n==1?0:n===0||n%100>1&&n%100<11?1:n%100>10&&n%100<20?2:3)},20:function(n){return Number(n==1?0:n===0||n%100>0&&n%100<20?1:2)},21:function(n){return Number(n%100==1?1:n%100==2?2:n%100==3||n%100==4?3:0)}},bt=function(){function n(r){var u=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};i(this,n);this.languageUtils=r;this.options=u;this.logger=t.create("pluralResolver");this.rules=wt()}return n.prototype.addRule=function(n,t){this.rules[n]=t},n.prototype.getRule=function(n){return this.rules[this.languageUtils.getLanguagePartFromCode(n)]},n.prototype.needsPlural=function(n){var t=this.getRule(n);return t&&t.numbers.length<=1?!1:!0},n.prototype.getSuffix=function(n,t){var r=this,i=this.getRule(n),u;if(i){if(u=function(){var u,n,f;return i.numbers.length===1?{v:""}:(u=i.noAbs?i.plurals(t):i.plurals(Math.abs(t)),n=i.numbers[u],i.numbers.length===2&&i.numbers[0]===1&&(n===2?n="plural":n===1&&(n="")),f=function(){return r.options.prepend&&n.toString()?r.options.prepend+n.toString():n.toString()},r.options.compatibilityJSON==="v1")?n===1?{v:""}:typeof n=="number"?{v:"_plural_"+n.toString()}:{v:f()}:r.options.compatibilityJSON==="v2"||i.numbers.length===2&&i.numbers[0]===1?{v:f()}:i.numbers.length===2&&i.numbers[0]===1?{v:f()}:{v:r.options.prepend&&u.toString()?r.options.prepend+u.toString():u.toString()}}(),(typeof u=="undefined"?"undefined":c(u))==="object")return u.v}else return this.logger.warn("no plural rule found for: "+n),""},n}(),kt=function(){function n(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};i(this,n);this.logger=t.create("interpolator");this.init(r,!0)}return n.prototype.init=function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},i=arguments[1],n;i&&(this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.escape=t.interpolation&&t.interpolation.escape||k);t.interpolation||(t.interpolation={escapeValue:!0});n=t.interpolation;this.escapeValue=n.escapeValue!==undefined?n.escapeValue:!0;this.prefix=n.prefix?r(n.prefix):n.prefixEscaped||"{{";this.suffix=n.suffix?r(n.suffix):n.suffixEscaped||"}}";this.formatSeparator=n.formatSeparator?r(n.formatSeparator):n.formatSeparator||",";this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-";this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"";this.nestingPrefix=n.nestingPrefix?r(n.nestingPrefix):n.nestingPrefixEscaped||r("$t(");this.nestingSuffix=n.nestingSuffix?r(n.nestingSuffix):n.nestingSuffixEscaped||r(")");this.resetRegExp()},n.prototype.reset=function(){this.options&&this.init(this.options)},n.prototype.resetRegExp=function(){var i=this.prefix+"(.+?)"+this.suffix,n,t;this.regexp=new RegExp(i,"g");n=this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(n,"g");t=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(t,"g")},n.prototype.interpolate=function(n,t,i){function o(n){return n.replace(/\$/g,"$$$$")}var e=this,f=void 0,r=void 0,s=function(n){if(n.indexOf(e.formatSeparator)<0)return u(t,n);var r=n.split(e.formatSeparator),f=r.shift().trim(),o=r.join(e.formatSeparator).trim();return e.format(u(t,f),o,i)},h;for(this.resetRegExp();f=this.regexpUnescape.exec(n);)h=s(f[1].trim()),n=n.replace(f[0],h),this.regexpUnescape.lastIndex=0;while(f=this.regexp.exec(n))r=s(f[1].trim()),typeof r!="string"&&(r=p(r)),r||(this.logger.warn("missed to pass in variable "+f[1]+" for interpolating "+n),r=""),r=this.escapeValue?o(this.escape(r)):o(r),n=n.replace(f[0],r),this.regexp.lastIndex=0;return n},n.prototype.nest=function(n,t){function f(n){return n.replace(/\$/g,"$$$$")}function o(n){var i,t;if(n.indexOf(",")<0)return n;i=n.split(",");n=i.shift();t=i.join(",");t=this.interpolate(t,u);t=t.replace(/'/g,'"');try{u=JSON.parse(t)}catch(r){this.logger.error("failed parsing options string in nesting for key "+n,r)}return n}var e=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},r=void 0,i=void 0,u=JSON.parse(JSON.stringify(e));for(u.applyPostProcessor=!1;r=this.nestingRegexp.exec(n);)i=t(o.call(this,r[1].trim()),u),typeof i!="string"&&(i=p(i)),i||(this.logger.warn("missed to pass in variable "+r[1]+" for interpolating "+n),i=""),i=this.escapeValue?f(k(i)):f(i),n=n.replace(r[0],i),this.regexp.lastIndex=0;return n},n}(),gt=function(r){function o(n,u,f){var h=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s;return i(this,o),s=e(this,r.call(this)),s.backend=n,s.store=u,s.services=f,s.options=h,s.logger=t.create("backendConnector"),s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(f,h.backend,h),s}return f(o,r),o.prototype.queueLoad=function(n,t,i){var u=this,f=[],r=[],o=[],e=[];return n.forEach(function(n){var i=!0;t.forEach(function(t){var o=n+"|"+t;u.store.hasResourceBundle(n,t)?u.state[o]=2:u.state[o]<0||(u.state[o]===1?r.indexOf(o)<0&&r.push(o):(u.state[o]=1,i=!1,r.indexOf(o)<0&&r.push(o),f.indexOf(o)<0&&f.push(o),e.indexOf(t)<0&&e.push(t)))});i||o.push(n)}),(f.length||r.length)&&this.queue.push({pending:r,loaded:{},errors:[],callback:i}),{toLoad:f,pending:r,toLoadLanguages:o,toLoadNamespaces:e}},o.prototype.loaded=function(n,t,i){var e=this,o=n.split("|"),f=s(o,2),r=f[0],u=f[1];t&&this.emit("failedLoading",r,u,t);i&&this.store.addResourceBundle(r,u,i);this.state[n]=t?-1:2;this.queue.forEach(function(i){ot(i.loaded,[r],u);dt(i.pending,n);t&&i.errors.push(t);i.pending.length!==0||i.done||(i.errors.length?i.callback(i.errors):i.callback(),e.emit("loaded",i.loaded),i.done=!0)});this.queue=this.queue.filter(function(n){return!n.done})},o.prototype.read=function(n,t,i,r,u,f){var e=this;if(r||(r=0),u||(u=250),!n.length)return f(null,{});this.backend[i](n,t,function(o,s){if(o&&s&&r<5){setTimeout(function(){e.read.call(e,n,t,i,++r,u*2,f)},u);return}f(o,s)})},o.prototype.load=function(t,i,r){var e=this,o,f;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();if(o=n({},this.backend.options,this.options.backend),typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t)),typeof i=="string"&&(i=[i]),f=this.queueLoad(t,i,r),!f.toLoad.length){f.pending.length||r();return}o.allowMultiLoading&&this.backend.readMulti?this.read(f.toLoadLanguages,f.toLoadNamespaces,"readMulti",null,null,function(n,t){n&&e.logger.warn("loading namespaces "+f.toLoadNamespaces.join(", ")+" for languages "+f.toLoadLanguages.join(", ")+" via multiloading failed",n);!n&&t&&e.logger.log("loaded namespaces "+f.toLoadNamespaces.join(", ")+" for languages "+f.toLoadLanguages.join(", ")+" via multiloading",t);f.toLoad.forEach(function(i){var l=i.split("|"),f=s(l,2),o=f[0],h=f[1],c=u(t,[o,h]),r;c?e.loaded(i,n,c):(r="loading namespace "+h+" for language "+o+" via multiloading failed",e.loaded(i,r),e.logger.error(r))})}):function(){var n=function(n){var t=this,f=n.split("|"),u=s(f,2),i=u[0],r=u[1];this.read(i,r,"read",null,null,function(u,f){u&&t.logger.warn("loading namespace "+r+" for language "+i+" failed",u);!u&&f&&t.logger.log("loaded namespace "+r+" for language "+i,f);t.loaded(n,u,f)})};f.toLoad.forEach(function(t){n.call(e,t)})}()},o.prototype.reload=function(t,i){var r=this,f;this.backend||this.logger.warn("No backend was added via i18next.use. Will not load resources.");f=n({},this.backend.options,this.options.backend);typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t));typeof i=="string"&&(i=[i]);f.allowMultiLoading&&this.backend.readMulti?this.read(t,i,"readMulti",null,null,function(n,f){n&&r.logger.warn("reloading namespaces "+i.join(", ")+" for languages "+t.join(", ")+" via multiloading failed",n);!n&&f&&r.logger.log("reloaded namespaces "+i.join(", ")+" for languages "+t.join(", ")+" via multiloading",f);t.forEach(function(t){i.forEach(function(i){var o=u(f,[t,i]),e;o?r.loaded(t+"|"+i,n,o):(e="reloading namespace "+i+" for language "+t+" via multiloading failed",r.loaded(t+"|"+i,e),r.logger.error(e))})})}):function(){var n=function(n){var t=this,f=n.split("|"),u=s(f,2),i=u[0],r=u[1];this.read(i,r,"read",null,null,function(u,f){u&&t.logger.warn("reloading namespace "+r+" for language "+i+" failed",u);!u&&f&&t.logger.log("reloaded namespace "+r+" for language "+i,f);t.loaded(n,u,f)})};t.forEach(function(t){i.forEach(function(i){n.call(r,t+"|"+i)})})}()},o.prototype.saveMissing=function(n,t,i,r){(this.backend&&this.backend.create&&this.backend.create(n,t,i,r),n&&n[0])&&this.store.addResource(n[0],t,i,r)},o}(o),ni=function(r){function u(n,f,o){var h=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s;return i(this,u),s=e(this,r.call(this)),s.cache=n,s.store=f,s.services=o,s.options=h,s.logger=t.create("cacheConnector"),s.cache&&s.cache.init&&s.cache.init(o,h.cache,h),s}return f(u,r),u.prototype.load=function(t,i,r){var u=this,f;if(!this.cache)return r&&r();f=n({},this.cache.options,this.options.cache);typeof t=="string"&&(t=this.services.languageUtils.toResolveHierarchy(t));typeof i=="string"&&(i=[i]);f.enabled?this.cache.load(t,function(n,i){var f,e,o;if(n&&u.logger.error("loading languages "+t.join(", ")+" from cache failed",n),i)for(f in i)for(e in i[f])e!=="i18nStamp"&&(o=i[f][e],o&&u.store.addResourceBundle(f,e,o));r&&r()}):r&&r()},u.prototype.save=function(){this.cache&&this.options.cache&&this.options.cache.enabled&&this.cache.save(this.store.data)},u}(o),ti=function(r){function u(){var f=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},o=arguments[1],n;return i(this,u),n=e(this,r.call(this)),n.options=h(f),n.services={},n.logger=t,n.modules={},o&&!n.isInitialized&&n.init(f,o),n}return f(u,r),u.prototype.init=function(i,r){function e(n){if(n)return typeof n=="function"?new n:n}var f=this,o,u,c,s;if(typeof i=="function"&&(r=i,i={}),i||(i={}),this.options=i.compatibilityAPI==="v1"?n({},y(),h(ct(i)),{}):i.compatibilityJSON==="v1"?n({},y(),h(lt(i)),{}):n({},y(),this.options,h(i)),r||(r=tt),!this.options.isClone){this.modules.logger?t.init(e(this.modules.logger),this.options):t.init(null,this.options);o=new vt(this.options);this.store=new ht(this.options.resources,this.options);u=this.services;u.logger=t;u.resourceStore=this.store;u.resourceStore.on("added removed",function(){u.cacheConnector.save()});u.languageUtils=o;u.pluralResolver=new bt(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON});u.interpolator=new kt(this.options);u.backendConnector=new gt(e(this.modules.backend),u.resourceStore,u,this.options);u.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];f.emit.apply(f,[n].concat(r))});u.backendConnector.on("loaded",function(){u.cacheConnector.save()});u.cacheConnector=new ni(e(this.modules.cache),u.resourceStore,u,this.options);u.cacheConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];f.emit.apply(f,[n].concat(r))});this.modules.languageDetector&&(u.languageDetector=e(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options));this.translator=new nt(this.services,this.options);this.translator.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),t=1;t<i;t++)r[t-1]=arguments[t];f.emit.apply(f,[n].concat(r))})}return c=["getResource","addResource","addResources","addResourceBundle","removeResourceBundle","hasResourceBundle","getResourceBundle"],c.forEach(function(n){f[n]=function(){return this.store[n].apply(this.store,arguments)}}),this.options.compatibilityAPI==="v1"&&at(this),s=function(){f.changeLanguage(f.options.lng,function(n,t){f.emit("initialized",f.options);f.logger.log("initialized",f.options);r(n,t)})},this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),this},u.prototype.loadResources=function(n){var t=this,i;if(n||(n=tt),this.options.resources)n(null);else if(i=function(){if(t.language&&t.language.toLowerCase()==="cimode")return{v:n()};var i=[],r=function(n){var r=t.services.languageUtils.toResolveHierarchy(n);r.forEach(function(n){i.indexOf(n)<0&&i.push(n)})};r(t.language);t.options.preload&&t.options.preload.forEach(function(n){r(n)});t.services.cacheConnector.load(i,t.options.ns,function(){t.services.backendConnector.load(i,t.options.ns,n)})}(),(typeof i=="undefined"?"undefined":c(i))==="object")return i.v},u.prototype.reloadResources=function(n,t){n||(n=this.languages);t||(t=this.options.ns);this.services.backendConnector.reload(n,t)},u.prototype.use=function(n){return n.type==="backend"&&(this.modules.backend=n),n.type==="cache"&&(this.modules.cache=n),(n.type==="logger"||n.log&&n.warn&&n.warn)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="postProcessor"&&d.addPostProcessor(n),this},u.prototype.changeLanguage=function(n,t){var i=this,r=function(r){n&&(i.emit("languageChanged",n),i.logger.log("languageChanged",n));t&&t(r,function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return i.t.apply(i,r)})};!n&&this.services.languageDetector&&(n=this.services.languageDetector.detect());n&&(this.language=n,this.languages=this.services.languageUtils.toResolveHierarchy(n),this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage(n));this.loadResources(function(n){r(n)})},u.prototype.getFixedT=function(t,i){var u=this,r=function r(t){var f=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},i=n({},f);return i.lng=i.lng||r.lng,i.ns=i.ns||r.ns,u.t(t,i)};return r.lng=t,r.ns=i,r},u.prototype.t=function(){return this.translator&&this.translator.translate.apply(this.translator,arguments)},u.prototype.exists=function(){return this.translator&&this.translator.exists.apply(this.translator,arguments)},u.prototype.setDefaultNamespace=function(n){this.options.defaultNS=n},u.prototype.loadNamespaces=function(n,t){var i=this;if(!this.options.ns)return t&&t();typeof n=="string"&&(n=[n]);n.forEach(function(n){i.options.ns.indexOf(n)<0&&i.options.ns.push(n)});this.loadResources(t)},u.prototype.loadLanguages=function(n,t){typeof n=="string"&&(n=[n]);var i=this.options.preload||[],r=n.filter(function(n){return i.indexOf(n)<0});if(!r.length)return t();this.options.preload=i.concat(r);this.loadResources(t)},u.prototype.dir=function(n){if(n||(n=this.language),!n)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(n))>=0?"rtl":"ltr"},u.prototype.createInstance=function(){var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},t=arguments[1];return new u(n,t)},u.prototype.cloneInstance=function(){var i=this,r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},f=arguments[1],t=new u(n({},r,this.options,{isClone:!0}),f);["store","services","language"].forEach(function(n){t[n]=i[n]});t.translator=new nt(t.services,t.options);t.translator.on("*",function(n){for(var r=arguments.length,u=Array(r>1?r-1:0),i=1;i<r;i++)u[i-1]=arguments[i];t.emit.apply(t,[n].concat(u))});return t},u}(o);return new ti});
|