New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-i18n-gettext

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-i18n-gettext - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

48

dist/vue-i18n-gettext.common.js

@@ -1410,3 +1410,3 @@ /*!

if (actualTo) {
actualTo.params = Object.assign(to.params, { _detected: true });
actualTo.params = to.params;
actualTo.hash = to.hash;

@@ -1509,3 +1509,3 @@ actualTo.query = to.query;

// If there is a detection of an route that was mismatch originally, reroute to the valid match.
if (actualTo && !actualTo.params._detected) {
if (actualTo) {
next(actualTo);

@@ -1582,16 +1582,42 @@ }

// Converts a router link to the version of the current locale.
var _localeLink = function (link) {
var toPath;
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp_1.compile(_path('/:_locale?/' + link));
var _localeLink = function (location) {
if (typeof location === 'string') {
var toPath;
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp_1.compile(_path('/:_locale?/' + location));
} else {
toPath = pathToRegexp_1.compile(location.replace('$locale', ':_locale?'));
}
var path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale });
return path === '' ? '/' : path
} else {
toPath = pathToRegexp_1.compile(link.replace('$locale', ':_locale?'));
return location
}
var path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale });
return path === '' ? '/' : path
// TODO: Add support when the object contains name and/or path.
};
Vue.prototype.$localeLink = _localeLink;
Vue.prototype.$L = _localeLink;
Vue.prototype.$ll = _localeLink;
// Expose the locale version of the router.
if (config.usingRouter && router) {
router.locPush = function (location, onComplete, onAbort) {
router.push(location ? router.app.$localeLink(location) : location, onComplete, onAbort);
};
router.locReplace = function (location, onComplete, onAbort) {
router.replace(location ? router.app.$localeLink(location) : location, onComplete, onAbort);
};
router.locGo = function (n) {
if (typeof n === 'string') {
router.go(n ? router.app.$localeLink(n) : n);
} else {
router.go(n);
}
// TODO: Check if route object support is needed.
};
// TODO: Test support for router.resolve and router.getMatchedComponents
}
// Makes <translate> available as a global component.

@@ -1598,0 +1624,0 @@ Vue.component('translate', Component(Vue, marked));

@@ -1412,3 +1412,3 @@ /*!

if (actualTo) {
actualTo.params = Object.assign(to.params, { _detected: true });
actualTo.params = to.params;
actualTo.hash = to.hash;

@@ -1511,3 +1511,3 @@ actualTo.query = to.query;

// If there is a detection of an route that was mismatch originally, reroute to the valid match.
if (actualTo && !actualTo.params._detected) {
if (actualTo) {
next(actualTo);

@@ -1584,16 +1584,42 @@ }

// Converts a router link to the version of the current locale.
var _localeLink = function (link) {
var toPath;
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp_1.compile(_path('/:_locale?/' + link));
var _localeLink = function (location) {
if (typeof location === 'string') {
var toPath;
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp_1.compile(_path('/:_locale?/' + location));
} else {
toPath = pathToRegexp_1.compile(location.replace('$locale', ':_locale?'));
}
var path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale });
return path === '' ? '/' : path
} else {
toPath = pathToRegexp_1.compile(link.replace('$locale', ':_locale?'));
return location
}
var path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale });
return path === '' ? '/' : path
// TODO: Add support when the object contains name and/or path.
};
Vue.prototype.$localeLink = _localeLink;
Vue.prototype.$L = _localeLink;
Vue.prototype.$ll = _localeLink;
// Expose the locale version of the router.
if (config.usingRouter && router) {
router.locPush = function (location, onComplete, onAbort) {
router.push(location ? router.app.$localeLink(location) : location, onComplete, onAbort);
};
router.locReplace = function (location, onComplete, onAbort) {
router.replace(location ? router.app.$localeLink(location) : location, onComplete, onAbort);
};
router.locGo = function (n) {
if (typeof n === 'string') {
router.go(n ? router.app.$localeLink(n) : n);
} else {
router.go(n);
}
// TODO: Check if route object support is needed.
};
// TODO: Test support for router.resolve and router.getMatchedComponents
}
// Makes <translate> available as a global component.

@@ -1600,0 +1626,0 @@ Vue.component('translate', Component(Vue, marked));

@@ -6,2 +6,2 @@ /*!

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueI18nGettext=e.VueI18nGettext||{})}(this,function(e){"use strict";function t(e,t){for(var r,n=[],o=0,s=0,c="",l=t&&t.delimiter||x,u=t&&t.delimiters||w,h=!1;null!==(r=L.exec(e));){var d=r[0],p=r[1],g=r.index;if(c+=e.slice(s,g),s=g+d.length,p)c+=p[1],h=!0;else{var f="",m=e[s],v=r[2],_=r[3],y=r[4],$=r[5];if(!h&&c.length){var E=c.length-1;u.indexOf(c[E])>-1&&(f=c[E],c=c.slice(0,E))}c&&(n.push(c),c="",h=!1);var b=""!==f&&void 0!==m&&m!==f,O="+"===$||"*"===$,T="?"===$||"*"===$,R=f||l,I=_||y;n.push({name:v||o++,prefix:f,delimiter:R,optional:T,repeat:O,partial:b,pattern:I?i(I):"[^"+a(R)+"]+?"})}}return(c||s<e.length)&&n.push(c+e.substr(s)),n}function r(e,r){return n(t(e,r))}function n(e){for(var t=new Array(e.length),r=0;r<e.length;r++)"object"==typeof e[r]&&(t[r]=new RegExp("^(?:"+e[r].pattern+")$"));return function(r,n){for(var a="",i=n&&n.encode||encodeURIComponent,o=0;o<e.length;o++){var s=e[o];if("string"!=typeof s){var c,l=r?r[s.name]:void 0;if(Array.isArray(l)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but got array');if(0===l.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var u=0;u<l.length;u++){if(c=i(l[u]),!t[o].test(c))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'"');a+=(0===u?s.prefix:s.delimiter)+c}}else if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if(!s.optional)throw new TypeError('Expected "'+s.name+'" to be '+(s.repeat?"an array":"a string"));s.partial&&(a+=s.prefix)}else{if(c=i(String(l)),!t[o].test(c))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but got "'+c+'"');a+=s.prefix+c}}else a+=s}return a}}function a(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function i(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function o(e){return e&&e.sensitive?"":"i"}function s(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return e}function c(e,t,r){for(var n=[],a=0;a<e.length;a++)n.push(h(e[a],t,r).source);return new RegExp("(?:"+n.join("|")+")",o(r))}function l(e,r,n){return u(t(e,n),r,n)}function u(e,t,r){r=r||{};for(var n=r.strict,i=!1!==r.end,s=a(r.delimiter||x),c=r.delimiters||w,l=[].concat(r.endsWith||[]).map(a).concat("$").join("|"),u="",h=!1,d=0;d<e.length;d++){var p=e[d];if("string"==typeof p)u+=a(p),h=d===e.length-1&&c.indexOf(p[p.length-1])>-1;else{var g=a(p.prefix),f=p.repeat?"(?:"+p.pattern+")(?:"+g+"(?:"+p.pattern+"))*":p.pattern;t&&t.push(p),p.optional?p.partial?u+=g+"("+f+")?":u+="(?:"+g+"("+f+"))?":u+=g+"("+f+")"}}return i?(n||(u+="(?:"+s+")?"),u+="$"===l?"$":"(?="+l+")"):(n||(u+="(?:"+s+"(?="+l+"))?"),h||(u+="(?="+s+"|"+l+")")),new RegExp("^"+u,o(r))}function h(e,t,r){return e instanceof RegExp?s(e,t):Array.isArray(e)?c(e,t,r):l(e,t,r)}function d(e){for(var t=[],r=0,n="";r<e.length;){var a=e[r++];if("{"===a){n&&t.push({type:"text",value:n}),n="";var i="";for(a=e[r++];"}"!==a;)i+=a,a=e[r++];var o=N.test(i)?"list":A.test(i)?"named":"unknown";t.push({value:i,type:o})}else"$"===a?"{"!==e[r]&&(n+=a):n+=a}return n&&t.push({type:"text",value:n}),t}function p(e,t){var r=[],n=0,a=Array.isArray(t)?"list":O(t)?"named":"unknown";if("unknown"===a)return r;for(;n<e.length;){var i=e[n];switch(i.type){case"text":r.push(i.value);break;case"list":r.push(t[parseInt(i.value,10)]);break;case"named":if("named"===a){-1!==i.value.indexOf(".")?r.push(function(e){var r=e.split("."),n=t;if(r.length>0){for(var a=0;a<r.length;a++)n=n[r[a]];return n}}(i.value)):r.push(t[i.value])}}n++}return r}function g(){var e,t,r="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(r+="-"),r+=(12===e?4:16===e?3&t|8:t).toString(16);return r}function f(e,t,r,n){void 0===t&&(t={}),e.prototype.$gettext=C._gettext,e.prototype.$pgettext=C._pgettext,e.prototype.$ngettext=C._ngettext,e.prototype.$npgettext=C._npgettext,e.prototype.$_i=C._i18nInterpolate,e.prototype.$parseGettext=function(e,t,r){try{var n=D(e);return"ngettext"!==n.identifier&&"npgettext"!==n.identifier||(t&&"number"==typeof t?(n.parameters[n.parameters.length-1]=t,r.counter=r.counter+1):n.parameters[n.parameters.length-1]=1),(a=this)["$"+n.identifier].apply(a,n.parameters)}catch(t){return"NOT_STRING"!==t.message&&"INVALID_START"!==t.message&&b("[gettext-miniparser] "+e+" => "+t),e}var a},e.prototype.$parseObjectGettext=function(e,t,r){if("object"==typeof e){var n=this,a=JSON.parse(JSON.stringify(e)),i={counter:0,getN:function(){return t[this.counter]?t[this.counter]:void 0}};return function e(a){for(var o=Object.keys(a),s=0;s<o.length;s++)"string"==typeof a[o[s]]?(a[o[s]]=t?n.$parseGettext(a[o[s]],i.getN(),i):n.$parseGettext(a[o[s]]),r&&"object"==typeof r&&(a[o[s]]=n.$_i(a[o[s]],r))):"object"==typeof a[o[s]]&&e(a[o[s]])}(a),a}return this.$parseGettext(e,t)};var a,i=B(t);a="custom"!==i.storageMethod?G[i.storageMethod].load(i.storageKey)||i.defaultLocale:i.storageFunctions.load(i.storageKey)||i.defaultLocale;var o=function(e,t,r){var n=e.replace(t,r).replace(new RegExp("/{2,}","giu"),"/");return""!==n?n:"/"},s=[];r&&(r.options.routes.forEach(function(e){var t=g();s.push(Object.assign(Object.assign({},e),{name:e.name?e.name:t,path:i.routeAutoPrefix?e.path:o(e.path,"$locale",""),meta:{i18nId:t,localized:!1}}));var r=s[s.length-1];r.children&&r.children.length>0&&function e(t){t.children.forEach(function(t){var r=g();t.name=t.name||r,t.meta||(t.meta={}),t.meta={i18nId:r,localized:!1},t.children&&t.children.length>0&&e(t)})}(r),s.push(Object.assign(Object.assign({},r),{name:"__locale:"+r.meta.i18nId,path:i.routeAutoPrefix?o("/:_locale?/"+r.path):r.path,meta:{i18nId:void 0,seedI18nId:r.meta.i18nId,localized:!0,seedRoute:r},redirect:r.redirect?"/:_locale?"+r.redirect:void 0})),delete s[s.length-1].meta.i18nId;var n=s[s.length-1];if(n.children&&n.children.length>0){var a=JSON.parse(JSON.stringify(n.children));!function e(t,r){t.forEach(function(t,n){Object.keys(t).forEach(function(e){"children"!==e&&"meta"!==e&&(t[e]=r[n][e])}),t.children&&t.children.length>0&&e(t.children,r[n].children)})}(a,n.children),function e(t,r){t.forEach(function(t,n){t.name="__locale:"+t.meta.i18nId,t.meta||(t.meta={}),t.meta=Object.assign(t.meta,{i18nId:void 0,seedI18n:t.meta.i18nId,localized:!0,seedRoute:r[n]}),t.children&&t.children.length>0&&e(t.children,r[n].children)})}(a,n.children),n.children=a}}),r.matcher=new(Object.getPrototypeOf(r).constructor)({mode:"history",routes:[]}).matcher,r.addRoutes(s),r.beforeEach(function(e,t,n){var o;if(e.params._locale||(e.params._locale=i.defaultLocale),!i.allLocales.includes(e.params._locale)){var s=e.matched[0].path.replace(":_locale?","__locale__/"+e.params._locale);o=r.match(s).meta.seedRoute}o&&(o.params=Object.assign(e.params,{_detected:!0}),o.hash=e.hash,o.query=e.query,o._actual=!0,i.allLocales.includes(o.params._locale)||(o.params._locale=i.defaultLocale),e=o);var c=(e.params._changeLocale,function(t,r){return{name:t||e.name,params:r?Object.assign(e.params,r):e.params,hash:e.hash,query:e.query}}),l=function(t){if(e.meta.localized&&!i.defaultLocaleInRoutes){var a=c(e.meta.seedRoute.name);t?r.go(a):n(a)}else if(!e.meta.localized&&i.defaultLocaleInRoutes){var o=c("__locale:"+e.meta.i18nId);t?r.go(o):n(o)}else t&&r.go(c())},u=function(e){"custom"!==i.storageMethod?G[i.storageMethod].save(i.storageKey,e,a,i.cookieExpirationInDays):i.storageFunctions.save(i.storageKey,e,a)};e.params._locale!==a?e.meta.localized?e.params._locale!==i.defaultLocale?"changeLocale"===i.routingStyle?(u(e.params._locale),r.go(c())):"redirect"===i.routingStyle&&n(c(null,{_locale:a})):"changeLocale"===i.routingStyle?(u(e.params._locale),l(!0)):"redirect"===i.routingStyle&&n(c(null,{_locale:a})):e.params._locale!==i.defaultLocale?"changeLocale"===i.routingStyle?(u(e.params._locale),r.go(c("__locale:"+e.meta.i18nId))):"redirect"===i.routingStyle&&n(c("__locale:"+e.meta.i18nId,{_locale:a})):"changeLocale"===i.routingStyle?(u(e.params._locale),l(!0)):"redirect"===i.routingStyle&&n(c("__locale:"+e.meta.i18nId,{_locale:a})):e.params._locale===i.defaultLocale&&l(),o&&!o.params._detected&&n(o),n()})),e.prototype.$i18nRoutes=s,e.prototype.$i18n=new e({data:function(){return i.activeLocale=a&&a!==i.defaultLocale?a:i.defaultLocale,i},methods:{getLocaleMessage:function(e){return this.messages[e]}}}),e.prototype.$changeLocale=function(e){if(this.$i18n.allLocales.includes(e)){var t=this.$i18n.activeLocale;"custom"!==this.$i18n.storageMethod?G[this.$i18n.storageMethod].save(this.$i18n.storageKey,e,t,this.$i18n.cookieExpirationInDays):this.$i18n.storageFunctions.save(this.$i18n.storageKey,e,t),this.$i18n.forceReloadOnSwitch||(this.$i18n.activeLocale=e),this.$i18n.usingRouter&&r?(this.$i18n.defaultLocaleInRoutes||e!==this.$i18n.defaultLocale||!0!==this.$route.meta.localized?!0===this.$route.meta.localized?this.$router.push({name:this.$route.name,params:Object.assign(this.$route.params,{_locale:e,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}):this.$router.push({name:"__locale:"+this.$route.meta.i18nId,params:Object.assign(this.$route.params,{_locale:e,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}):this.$router.push({name:this.$route.meta.seedRoute.name,params:Object.assign(this.$route.params,{_locale:void 0,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}),this.$i18n.forceReloadOnSwitch&&window.location.reload()):this.$i18n.forceReloadOnSwitch&&window.location.reload()}};var c=function(e){var t;t=this.$i18n.routeAutoPrefix?m.compile(o("/:_locale?/"+e)):m.compile(e.replace("$locale",":_locale?"));var r=t({_locale:this.$i18n.activeLocale===this.$i18n.defaultLocale?this.$i18n.defaultLocaleInRoutes?this.$i18n.activeLocale:void 0:this.$i18n.activeLocale});return""===r?"/":r};e.prototype.$localeLink=c,e.prototype.$L=c,e.component("translate",q(e,n)),e.directive("translate",z(n))}var m=h,v=t,_=r,y=n,$=u,x="/",w="./",L=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");m.parse=v,m.compile=_,m.tokensToFunction=y,m.tokensToRegExp=$;var E={getTranslationIndex:function(e,t){switch(t=Number.isNaN(parseInt(t))?1:parseInt(t),e.length>2&&"pt_BR"!==e&&(e=e.split("_")[0]),e){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return t%10!=1||t%100==11?1:0;case"jv":return 0!==t?1:0;case"mk":return 1===t||t%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return t>1?1:0;case"lv":return t%10==1&&t%100!=11?0:0!==t?1:2;case"lt":return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"mnk":return 0===t?0:1===t?1:2;case"ro":return 1===t?0:0===t||t%100>0&&t%100<20?1:2;case"pl":return 1===t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"cs":case"sk":return 1===t?0:t>=2&&t<=4?1:2;case"csb":return 1===t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"sl":return t%100==1?0:t%100==2?1:t%100==3||t%100==4?2:3;case"mt":return 1===t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3;case"gd":return 1===t||11===t?0:2===t||12===t?1:t>2&&t<20?2:3;case"cy":return 1===t?0:2===t?1:8!==t&&11!==t?2:3;case"kw":return 1===t?0:2===t?1:3===t?2:3;case"ga":return 1===t?0:2===t?1:t>2&&t<7?2:t>6&&t<11?3:4;case"ar":return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5;default:return 1!==t?1:0}}},b=function(e,t){"undefined"!=typeof console&&(console.warn("[vue-i18n-gettext] "+e),t&&console.warn(t.stack))},O=function(e){return null!==e&&"object"==typeof e},T=function(e){return e.replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*data\-v\-[0-9A-Za-z\u017F\u212A]{8,}="(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?"/gi,"")},R=function(e){return e.replace(/>[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]{2,}/gi,"> ").replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]{2,}</gi," <")},I=function(){this._caches=Object.create(null)};I.prototype.interpolate=function(e,t){var r=this._caches[e];return r||(r=d(e),this._caches[e]=r),p(r,t)};var N=/^(\d)+/,A=/^(\w)+/,M=function(e,t,r){var n=new I,a=n.interpolate(e,r);return"string"===t?a.join(""):a},F=function(e){var t=this.$i18n.getLocaleMessage(this.$i18n.activeLocale).$$NOCONTEXT[e];return t?t.msgstr[0]||t.msgid:e},S=function(e,t){var r;return this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e]&&(r=this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e][t]),r?r.msgstr[0]||r.msgid:t},k=function(e,t,r){var n=this.$i18n.getLocaleMessage(this.$i18n.activeLocale).$$NOCONTEXT[e];if(n){var a=E.getTranslationIndex(this.$i18n.activeLocale,r),i=n.msgstr[a];return i||(i=1===Math.abs(r)?n.msgstr[0]||n.msgid:n.msgstr[1]||n.msgid_plural||t),i}return 1===Math.abs(r)?e:t},j=function(e,t,r,n){var a;if(this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e]&&(a=this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e][t]),a){var i=E.getTranslationIndex(this.$i18n.activeLocale,n),o=a.msgstr[i];return o||(o=1===Math.abs(n)?a.msgstr[0]||a.msgid:a.msgstr[1]||a.msgid_plural||r),o}return 1===Math.abs(n)?t:r},P=function(e,t){return M(e,"string",t)},C={_i18nInterpolate:P,_gettext:F,_pgettext:S,_ngettext:k,_npgettext:j},D=function(e){if("string"!=typeof e)throw Error("NOT_STRING");if(e=e.trim(),"$"===e[0]){var t=e.substr(1,2);if(["ge","pg","ng","np"].includes(t)){var r=e,n=null;switch(t){case"ge":n="gettext",r=r.substr(8);break;case"pg":n="pgettext",r=r.substr(9);break;case"ng":n="ngettext",r=r.substr(9);break;case"np":n="npgettext",r=r.substr(10)}return{identifier:n,parameters:function(e,t){var r=[],n=t.length;if(n>0){if("("!==t[0])throw Error("NO_START_BRACKET");if(")"!==t[n-1])throw Error("NO_END_BRACKET");t=t.substr(1).slice(0,-1);for(var a=function(){switch(e){case"ge":return 1;case"pg":return 2;case"ng":return 3;case"np":return 4}}(),i=null,o=[],s=0;s<t.length;s++){var c=t.charAt(s);if(","!==i)if(null!==i||"'"!==c&&'"'!==c)if("'"===i&&"'"===c||'"'===i&&'"'===c){var l=s>=1?t.charAt(s-1):null;if("\\"!==l){if(r.length>=a)throw Error("TOO_MANY_PARAMETERS");var u=o.join("");r.push(u),o=[],i="ng"===e&&2===r.length||"np"===e&&3===r.length?",":null}else o.push(c)}else null!==i&&void 0!==i&&!1!==i&&"\\"!==c&&o.push(c);else i=c;else{if(o.length>0)o.push(c);else{if(0===c.trim().length)continue;if(","!==c)throw Error("MISSING_COMMA_BEFORE_LAST_PARAMETER");o.push(" ")}if(s===t.length-1){if(0===o.length)throw Error("UNDEFINED_LAST_PARAMETER");var h=o.join("").trim();if(isNaN(+h)&&"$n"!==h){if(-1!==h.indexOf(","))throw Error("TOO_MANY_PARAMETERS");throw Error("LAST_PARAMETER_NOT_NUMBER")}r.push("$n"===h?"$n":+h)}}}if(r.length<a)throw Error("PARAMETERS_INCORRECT");return r}throw Error("NO_PARAMETERS")}(t,r.trim())}}throw Error("NO_GETTEXT_IDENTIFIER")}throw Error("INVALID_START")},q=function(e,t){return{name:"translate",created:function(){if(this.msgid="",this.msgidHTML=!1,this.tN&&"string"==typeof this.tN&&this.tParams?(this._tN=this.tN.trim(),this.tParams.hasOwnProperty(this._tN)&&this.tParams[this._tN]?this._tN=this.tParams[this._tN]:this._tN=void 0):this._tN=this.tN,this.isPlural=void 0!==this._tN&&void 0!==this.tPlural,!this.isPlural&&(this._tN||this.tPlural))throw new Error("`t-n` and `t-plural` attributes must be used together: "+this.msgid+".");if(this.$options._renderChildren)if(this.$options._renderChildren.length&&1===this.$options._renderChildren.length&&this.$options._renderChildren[0].hasOwnProperty("text")&&void 0!==this.$options._renderChildren[0].text&&this.$options._renderChildren[0].hasOwnProperty("tag")&&void 0===this.$options._renderChildren[0].tag)this.msgid=this.$options._renderChildren[0].text.trim();else{var t=this,r=e.component("i18n-helper-component",{render:function(e){return e("div",t.$options._renderChildren)}}),n=(new r).$mount();this.msgid=T(R(n.$el.innerHTML).trim()),this.msgidHTML=!0,n.$destroy()}},props:{tag:{type:String,default:"span"},tN:{type:[String,Number],required:!1},tPlural:{type:String,required:!1},tContext:{type:String,required:!1},tComment:{type:String,required:!1},tParams:{type:Object,required:!1},md:{required:!1},markdown:{required:!1}},computed:{translation:function(){var e=null;return e=this.isPlural&&this.tContext?this.$npgettext(this.tContext,this.msgid,this.isPlural?this.tPlural:null,this._tN):this.isPlural?this.$ngettext(this.msgid,this.isPlural?this.tPlural:null,this._tN):this.tContext?this.$pgettext(this.tContext,this.msgid):this.$gettext(this.msgid),e=this.$_i(e,Object.assign(this.$parent,"object"==typeof this.tParams?this.tParams:{})),void 0!==t&&void 0!==this.markdown&&!1!==this.markdown||void 0!==this.md&&!1!==this.md?(this.msgidHTML=!0,t(e)):e}},render:function(e){return this.$vnode.key||(this.$vnode.key=g()),e(this.tag,[this.translation])},mounted:function(){this.msgidHTML&&(this.$el.innerHTML=this.$el.innerText)}}},z=function(e){return{bind:function(t,r,n){n.key||(n.key=g());var a=n.context,i=n.data.attrs||{},o=t.innerHTML,s=i["t-context"],c=i["t-n"],l=c,u=i["t-plural"],h=i["t-params"]||{},d=i.md,p=i.markdown,f=void 0!==c&&void 0!==u;if(r.value&&"object"==typeof r.value&&(h=Object.assign(h,r.value)),l&&"string"==typeof l&&h?(l=c.trim(),l=h.hasOwnProperty(l)&&h[l]?h[l]:void 0):"number"!=typeof l&&(l=void 0),!f&&(c||u))throw new Error("`translate-n` and `translate-plural` attributes must be used together:"+o+".");o=t.innerHTML.trim()!==t.innerText?T(R(t.innerHTML).trim()):t.innerText;var m=null;m=f&&s?a.$npgettext(s,o,f?u:null,l):f?a.$ngettext(o,f?u:null,l):s?a.$pgettext(s,o):a.$gettext(o),m=a.$_i(m,Object.assign(a,"object"==typeof h?h:{})),t.innerHTML=void 0!==e&&void 0!==p&&!1!==p||void 0!==d&&!1!==d?e(m):m}}},G={session:{save:function(e,t,r){window.sessionStorage.setItem(e,t)},load:function(e){return window.sessionStorage.getItem(e)}},local:{save:function(e,t,r){window.localStorage.setItem(e,t)},load:function(e){return window.localStorage.getItem(e)}},cookie:{save:function(e,t,r,n){!function(e,t,r){var n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);var a="expires="+n.toUTCString();document.cookie=e+"="+t+";"+a+";path=/"}(e,t,n||365)},load:function(e){return function(e){for(var t=e+"=",r=decodeURIComponent(document.cookie),n=r.split(";"),a=0;a<n.length;a++){for(var i=n[a];" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return""}(e)}}},B=function(e){var t={messages:e.messages||{},defaultLocale:e.defaultLocale||"en",allLocales:e.allLocales||(e.defaultLocale?[e.defaultLocale]:["en"]),forceReloadOnSwitch:e.forceReloadOnSwitch||!0,usingRouter:e.usingRouter||!1,defaultLocaleInRoutes:e.defaultLocaleInRoutes||!1,routingStyle:e.routingStyle||"changeLocale",routeAutoPrefix:e.routeAutoPrefix||!0,storageMethod:"object"!=typeof e.storageMethod?["session","local","cookie"].includes(e.storageMethod.trim())?e.storageMethod.trim():"local":"custom",storageKey:e.storageKey||"_vue_i18n_gettext_locale",cookieExpirationInDays:e.cookieExpirationInDays||30,customOnLoad:e.customOnLoad};return"custom"===t.storageMethod&&(t.storageFunctions=e.storageMethod),t},H={created:function(){this.$i18n.customOnLoad&&"function"==typeof this.$i18n.customOnLoad&&this.$i18n.customOnLoad(this)}};f.version="0.0.7","undefined"!=typeof window&&window.Vue&&window.Vue.use(f),e.VueGettext=f,e.gettextMixin=H,e.default=f,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VueI18nGettext=e.VueI18nGettext||{})}(this,function(e){"use strict";function t(e,t){for(var r,n=[],o=0,s=0,c="",l=t&&t.delimiter||x,u=t&&t.delimiters||w,h=!1;null!==(r=L.exec(e));){var p=r[0],d=r[1],g=r.index;if(c+=e.slice(s,g),s=g+p.length,d)c+=d[1],h=!0;else{var f="",m=e[s],v=r[2],_=r[3],$=r[4],y=r[5];if(!h&&c.length){var E=c.length-1;u.indexOf(c[E])>-1&&(f=c[E],c=c.slice(0,E))}c&&(n.push(c),c="",h=!1);var b=""!==f&&void 0!==m&&m!==f,O="+"===y||"*"===y,R="?"===y||"*"===y,T=f||l,I=_||$;n.push({name:v||o++,prefix:f,delimiter:T,optional:R,repeat:O,partial:b,pattern:I?i(I):"[^"+a(T)+"]+?"})}}return(c||s<e.length)&&n.push(c+e.substr(s)),n}function r(e,r){return n(t(e,r))}function n(e){for(var t=new Array(e.length),r=0;r<e.length;r++)"object"==typeof e[r]&&(t[r]=new RegExp("^(?:"+e[r].pattern+")$"));return function(r,n){for(var a="",i=n&&n.encode||encodeURIComponent,o=0;o<e.length;o++){var s=e[o];if("string"!=typeof s){var c,l=r?r[s.name]:void 0;if(Array.isArray(l)){if(!s.repeat)throw new TypeError('Expected "'+s.name+'" to not repeat, but got array');if(0===l.length){if(s.optional)continue;throw new TypeError('Expected "'+s.name+'" to not be empty')}for(var u=0;u<l.length;u++){if(c=i(l[u]),!t[o].test(c))throw new TypeError('Expected all "'+s.name+'" to match "'+s.pattern+'"');a+=(0===u?s.prefix:s.delimiter)+c}}else if("string"!=typeof l&&"number"!=typeof l&&"boolean"!=typeof l){if(!s.optional)throw new TypeError('Expected "'+s.name+'" to be '+(s.repeat?"an array":"a string"));s.partial&&(a+=s.prefix)}else{if(c=i(String(l)),!t[o].test(c))throw new TypeError('Expected "'+s.name+'" to match "'+s.pattern+'", but got "'+c+'"');a+=s.prefix+c}}else a+=s}return a}}function a(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function i(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function o(e){return e&&e.sensitive?"":"i"}function s(e,t){if(!t)return e;var r=e.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)t.push({name:n,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,pattern:null});return e}function c(e,t,r){for(var n=[],a=0;a<e.length;a++)n.push(h(e[a],t,r).source);return new RegExp("(?:"+n.join("|")+")",o(r))}function l(e,r,n){return u(t(e,n),r,n)}function u(e,t,r){r=r||{};for(var n=r.strict,i=!1!==r.end,s=a(r.delimiter||x),c=r.delimiters||w,l=[].concat(r.endsWith||[]).map(a).concat("$").join("|"),u="",h=!1,p=0;p<e.length;p++){var d=e[p];if("string"==typeof d)u+=a(d),h=p===e.length-1&&c.indexOf(d[d.length-1])>-1;else{var g=a(d.prefix),f=d.repeat?"(?:"+d.pattern+")(?:"+g+"(?:"+d.pattern+"))*":d.pattern;t&&t.push(d),d.optional?d.partial?u+=g+"("+f+")?":u+="(?:"+g+"("+f+"))?":u+=g+"("+f+")"}}return i?(n||(u+="(?:"+s+")?"),u+="$"===l?"$":"(?="+l+")"):(n||(u+="(?:"+s+"(?="+l+"))?"),h||(u+="(?="+s+"|"+l+")")),new RegExp("^"+u,o(r))}function h(e,t,r){return e instanceof RegExp?s(e,t):Array.isArray(e)?c(e,t,r):l(e,t,r)}function p(e){for(var t=[],r=0,n="";r<e.length;){var a=e[r++];if("{"===a){n&&t.push({type:"text",value:n}),n="";var i="";for(a=e[r++];"}"!==a;)i+=a,a=e[r++];var o=N.test(i)?"list":A.test(i)?"named":"unknown";t.push({value:i,type:o})}else"$"===a?"{"!==e[r]&&(n+=a):n+=a}return n&&t.push({type:"text",value:n}),t}function d(e,t){var r=[],n=0,a=Array.isArray(t)?"list":O(t)?"named":"unknown";if("unknown"===a)return r;for(;n<e.length;){var i=e[n];switch(i.type){case"text":r.push(i.value);break;case"list":r.push(t[parseInt(i.value,10)]);break;case"named":if("named"===a){-1!==i.value.indexOf(".")?r.push(function(e){var r=e.split("."),n=t;if(r.length>0){for(var a=0;a<r.length;a++)n=n[r[a]];return n}}(i.value)):r.push(t[i.value])}}n++}return r}function g(){var e,t,r="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(r+="-"),r+=(12===e?4:16===e?3&t|8:t).toString(16);return r}function f(e,t,r,n){void 0===t&&(t={}),e.prototype.$gettext=C._gettext,e.prototype.$pgettext=C._pgettext,e.prototype.$ngettext=C._ngettext,e.prototype.$npgettext=C._npgettext,e.prototype.$_i=C._i18nInterpolate,e.prototype.$parseGettext=function(e,t,r){try{var n=D(e);return"ngettext"!==n.identifier&&"npgettext"!==n.identifier||(t&&"number"==typeof t?(n.parameters[n.parameters.length-1]=t,r.counter=r.counter+1):n.parameters[n.parameters.length-1]=1),(a=this)["$"+n.identifier].apply(a,n.parameters)}catch(t){return"NOT_STRING"!==t.message&&"INVALID_START"!==t.message&&b("[gettext-miniparser] "+e+" => "+t),e}var a},e.prototype.$parseObjectGettext=function(e,t,r){if("object"==typeof e){var n=this,a=JSON.parse(JSON.stringify(e)),i={counter:0,getN:function(){return t[this.counter]?t[this.counter]:void 0}};return function e(a){for(var o=Object.keys(a),s=0;s<o.length;s++)"string"==typeof a[o[s]]?(a[o[s]]=t?n.$parseGettext(a[o[s]],i.getN(),i):n.$parseGettext(a[o[s]]),r&&"object"==typeof r&&(a[o[s]]=n.$_i(a[o[s]],r))):"object"==typeof a[o[s]]&&e(a[o[s]])}(a),a}return this.$parseGettext(e,t)};var a,i=B(t);a="custom"!==i.storageMethod?G[i.storageMethod].load(i.storageKey)||i.defaultLocale:i.storageFunctions.load(i.storageKey)||i.defaultLocale;var o=function(e,t,r){var n=e.replace(t,r).replace(new RegExp("/{2,}","giu"),"/");return""!==n?n:"/"},s=[];r&&(r.options.routes.forEach(function(e){var t=g();s.push(Object.assign(Object.assign({},e),{name:e.name?e.name:t,path:i.routeAutoPrefix?e.path:o(e.path,"$locale",""),meta:{i18nId:t,localized:!1}}));var r=s[s.length-1];r.children&&r.children.length>0&&function e(t){t.children.forEach(function(t){var r=g();t.name=t.name||r,t.meta||(t.meta={}),t.meta={i18nId:r,localized:!1},t.children&&t.children.length>0&&e(t)})}(r),s.push(Object.assign(Object.assign({},r),{name:"__locale:"+r.meta.i18nId,path:i.routeAutoPrefix?o("/:_locale?/"+r.path):r.path,meta:{i18nId:void 0,seedI18nId:r.meta.i18nId,localized:!0,seedRoute:r},redirect:r.redirect?"/:_locale?"+r.redirect:void 0})),delete s[s.length-1].meta.i18nId;var n=s[s.length-1];if(n.children&&n.children.length>0){var a=JSON.parse(JSON.stringify(n.children));!function e(t,r){t.forEach(function(t,n){Object.keys(t).forEach(function(e){"children"!==e&&"meta"!==e&&(t[e]=r[n][e])}),t.children&&t.children.length>0&&e(t.children,r[n].children)})}(a,n.children),function e(t,r){t.forEach(function(t,n){t.name="__locale:"+t.meta.i18nId,t.meta||(t.meta={}),t.meta=Object.assign(t.meta,{i18nId:void 0,seedI18n:t.meta.i18nId,localized:!0,seedRoute:r[n]}),t.children&&t.children.length>0&&e(t.children,r[n].children)})}(a,n.children),n.children=a}}),r.matcher=new(Object.getPrototypeOf(r).constructor)({mode:"history",routes:[]}).matcher,r.addRoutes(s),r.beforeEach(function(e,t,n){var o;if(e.params._locale||(e.params._locale=i.defaultLocale),!i.allLocales.includes(e.params._locale)){var s=e.matched[0].path.replace(":_locale?","__locale__/"+e.params._locale);o=r.match(s).meta.seedRoute}o&&(o.params=e.params,o.hash=e.hash,o.query=e.query,o._actual=!0,i.allLocales.includes(o.params._locale)||(o.params._locale=i.defaultLocale),e=o);var c=(e.params._changeLocale,function(t,r){return{name:t||e.name,params:r?Object.assign(e.params,r):e.params,hash:e.hash,query:e.query}}),l=function(t){if(e.meta.localized&&!i.defaultLocaleInRoutes){var a=c(e.meta.seedRoute.name);t?r.go(a):n(a)}else if(!e.meta.localized&&i.defaultLocaleInRoutes){var o=c("__locale:"+e.meta.i18nId);t?r.go(o):n(o)}else t&&r.go(c())},u=function(e){"custom"!==i.storageMethod?G[i.storageMethod].save(i.storageKey,e,a,i.cookieExpirationInDays):i.storageFunctions.save(i.storageKey,e,a)};e.params._locale!==a?e.meta.localized?e.params._locale!==i.defaultLocale?"changeLocale"===i.routingStyle?(u(e.params._locale),r.go(c())):"redirect"===i.routingStyle&&n(c(null,{_locale:a})):"changeLocale"===i.routingStyle?(u(e.params._locale),l(!0)):"redirect"===i.routingStyle&&n(c(null,{_locale:a})):e.params._locale!==i.defaultLocale?"changeLocale"===i.routingStyle?(u(e.params._locale),r.go(c("__locale:"+e.meta.i18nId))):"redirect"===i.routingStyle&&n(c("__locale:"+e.meta.i18nId,{_locale:a})):"changeLocale"===i.routingStyle?(u(e.params._locale),l(!0)):"redirect"===i.routingStyle&&n(c("__locale:"+e.meta.i18nId,{_locale:a})):e.params._locale===i.defaultLocale&&l(),o&&n(o),n()})),e.prototype.$i18nRoutes=s,e.prototype.$i18n=new e({data:function(){return i.activeLocale=a&&a!==i.defaultLocale?a:i.defaultLocale,i},methods:{getLocaleMessage:function(e){return this.messages[e]}}}),e.prototype.$changeLocale=function(e){if(this.$i18n.allLocales.includes(e)){var t=this.$i18n.activeLocale;"custom"!==this.$i18n.storageMethod?G[this.$i18n.storageMethod].save(this.$i18n.storageKey,e,t,this.$i18n.cookieExpirationInDays):this.$i18n.storageFunctions.save(this.$i18n.storageKey,e,t),this.$i18n.forceReloadOnSwitch||(this.$i18n.activeLocale=e),this.$i18n.usingRouter&&r?(this.$i18n.defaultLocaleInRoutes||e!==this.$i18n.defaultLocale||!0!==this.$route.meta.localized?!0===this.$route.meta.localized?this.$router.push({name:this.$route.name,params:Object.assign(this.$route.params,{_locale:e,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}):this.$router.push({name:"__locale:"+this.$route.meta.i18nId,params:Object.assign(this.$route.params,{_locale:e,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}):this.$router.push({name:this.$route.meta.seedRoute.name,params:Object.assign(this.$route.params,{_locale:void 0,_changeLocale:!0}),hash:this.$route.hash,query:this.$route.query}),this.$i18n.forceReloadOnSwitch&&window.location.reload()):this.$i18n.forceReloadOnSwitch&&window.location.reload()}};var c=function(e){if("string"==typeof e){var t;t=this.$i18n.routeAutoPrefix?m.compile(o("/:_locale?/"+e)):m.compile(e.replace("$locale",":_locale?"));var r=t({_locale:this.$i18n.activeLocale===this.$i18n.defaultLocale?this.$i18n.defaultLocaleInRoutes?this.$i18n.activeLocale:void 0:this.$i18n.activeLocale});return""===r?"/":r}return e};e.prototype.$localeLink=c,e.prototype.$ll=c,i.usingRouter&&r&&(r.locPush=function(e,t,n){r.push(e?r.app.$localeLink(e):e,t,n)},r.locReplace=function(e,t,n){r.replace(e?r.app.$localeLink(e):e,t,n)},r.locGo=function(e){"string"==typeof e?r.go(e?r.app.$localeLink(e):e):r.go(e)}),e.component("translate",q(e,n)),e.directive("translate",z(n))}var m=h,v=t,_=r,$=n,y=u,x="/",w="./",L=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");m.parse=v,m.compile=_,m.tokensToFunction=$,m.tokensToRegExp=y;var E={getTranslationIndex:function(e,t){switch(t=Number.isNaN(parseInt(t))?1:parseInt(t),e.length>2&&"pt_BR"!==e&&(e=e.split("_")[0]),e){case"ay":case"bo":case"cgg":case"dz":case"fa":case"id":case"ja":case"jbo":case"ka":case"kk":case"km":case"ko":case"ky":case"lo":case"ms":case"my":case"sah":case"su":case"th":case"tt":case"ug":case"vi":case"wo":case"zh":return 0;case"is":return t%10!=1||t%100==11?1:0;case"jv":return 0!==t?1:0;case"mk":return 1===t||t%10==1?0:1;case"ach":case"ak":case"am":case"arn":case"br":case"fil":case"fr":case"gun":case"ln":case"mfe":case"mg":case"mi":case"oc":case"pt_BR":case"tg":case"ti":case"tr":case"uz":case"wa":case"zh":return t>1?1:0;case"lv":return t%10==1&&t%100!=11?0:0!==t?1:2;case"lt":return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2;case"be":case"bs":case"hr":case"ru":case"sr":case"uk":return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"mnk":return 0===t?0:1===t?1:2;case"ro":return 1===t?0:0===t||t%100>0&&t%100<20?1:2;case"pl":return 1===t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"cs":case"sk":return 1===t?0:t>=2&&t<=4?1:2;case"csb":return 1===t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2;case"sl":return t%100==1?0:t%100==2?1:t%100==3||t%100==4?2:3;case"mt":return 1===t?0:0===t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3;case"gd":return 1===t||11===t?0:2===t||12===t?1:t>2&&t<20?2:3;case"cy":return 1===t?0:2===t?1:8!==t&&11!==t?2:3;case"kw":return 1===t?0:2===t?1:3===t?2:3;case"ga":return 1===t?0:2===t?1:t>2&&t<7?2:t>6&&t<11?3:4;case"ar":return 0===t?0:1===t?1:2===t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5;default:return 1!==t?1:0}}},b=function(e,t){"undefined"!=typeof console&&(console.warn("[vue-i18n-gettext] "+e),t&&console.warn(t.stack))},O=function(e){return null!==e&&"object"==typeof e},R=function(e){return e.replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*data\-v\-[0-9A-Za-z\u017F\u212A]{8,}="(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?"/gi,"")},T=function(e){return e.replace(/>[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]{2,}/gi,"> ").replace(/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]{2,}</gi," <")},I=function(){this._caches=Object.create(null)};I.prototype.interpolate=function(e,t){var r=this._caches[e];return r||(r=p(e),this._caches[e]=r),d(r,t)};var N=/^(\d)+/,A=/^(\w)+/,M=function(e,t,r){var n=new I,a=n.interpolate(e,r);return"string"===t?a.join(""):a},k=function(e){var t=this.$i18n.getLocaleMessage(this.$i18n.activeLocale).$$NOCONTEXT[e];return t?t.msgstr[0]||t.msgid:e},F=function(e,t){var r;return this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e]&&(r=this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e][t]),r?r.msgstr[0]||r.msgid:t},S=function(e,t,r){var n=this.$i18n.getLocaleMessage(this.$i18n.activeLocale).$$NOCONTEXT[e];if(n){var a=E.getTranslationIndex(this.$i18n.activeLocale,r),i=n.msgstr[a];return i||(i=1===Math.abs(r)?n.msgstr[0]||n.msgid:n.msgstr[1]||n.msgid_plural||t),i}return 1===Math.abs(r)?e:t},j=function(e,t,r,n){var a;if(this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e]&&(a=this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[e][t]),a){var i=E.getTranslationIndex(this.$i18n.activeLocale,n),o=a.msgstr[i];return o||(o=1===Math.abs(n)?a.msgstr[0]||a.msgid:a.msgstr[1]||a.msgid_plural||r),o}return 1===Math.abs(n)?t:r},P=function(e,t){return M(e,"string",t)},C={_i18nInterpolate:P,_gettext:k,_pgettext:F,_ngettext:S,_npgettext:j},D=function(e){if("string"!=typeof e)throw Error("NOT_STRING");if(e=e.trim(),"$"===e[0]){var t=e.substr(1,2);if(["ge","pg","ng","np"].includes(t)){var r=e,n=null;switch(t){case"ge":n="gettext",r=r.substr(8);break;case"pg":n="pgettext",r=r.substr(9);break;case"ng":n="ngettext",r=r.substr(9);break;case"np":n="npgettext",r=r.substr(10)}return{identifier:n,parameters:function(e,t){var r=[],n=t.length;if(n>0){if("("!==t[0])throw Error("NO_START_BRACKET");if(")"!==t[n-1])throw Error("NO_END_BRACKET");t=t.substr(1).slice(0,-1);for(var a=function(){switch(e){case"ge":return 1;case"pg":return 2;case"ng":return 3;case"np":return 4}}(),i=null,o=[],s=0;s<t.length;s++){var c=t.charAt(s);if(","!==i)if(null!==i||"'"!==c&&'"'!==c)if("'"===i&&"'"===c||'"'===i&&'"'===c){var l=s>=1?t.charAt(s-1):null;if("\\"!==l){if(r.length>=a)throw Error("TOO_MANY_PARAMETERS");var u=o.join("");r.push(u),o=[],i="ng"===e&&2===r.length||"np"===e&&3===r.length?",":null}else o.push(c)}else null!==i&&void 0!==i&&!1!==i&&"\\"!==c&&o.push(c);else i=c;else{if(o.length>0)o.push(c);else{if(0===c.trim().length)continue;if(","!==c)throw Error("MISSING_COMMA_BEFORE_LAST_PARAMETER");o.push(" ")}if(s===t.length-1){if(0===o.length)throw Error("UNDEFINED_LAST_PARAMETER");var h=o.join("").trim();if(isNaN(+h)&&"$n"!==h){if(-1!==h.indexOf(","))throw Error("TOO_MANY_PARAMETERS");throw Error("LAST_PARAMETER_NOT_NUMBER")}r.push("$n"===h?"$n":+h)}}}if(r.length<a)throw Error("PARAMETERS_INCORRECT");return r}throw Error("NO_PARAMETERS")}(t,r.trim())}}throw Error("NO_GETTEXT_IDENTIFIER")}throw Error("INVALID_START")},q=function(e,t){return{name:"translate",created:function(){if(this.msgid="",this.msgidHTML=!1,this.tN&&"string"==typeof this.tN&&this.tParams?(this._tN=this.tN.trim(),this.tParams.hasOwnProperty(this._tN)&&this.tParams[this._tN]?this._tN=this.tParams[this._tN]:this._tN=void 0):this._tN=this.tN,this.isPlural=void 0!==this._tN&&void 0!==this.tPlural,!this.isPlural&&(this._tN||this.tPlural))throw new Error("`t-n` and `t-plural` attributes must be used together: "+this.msgid+".");if(this.$options._renderChildren)if(this.$options._renderChildren.length&&1===this.$options._renderChildren.length&&this.$options._renderChildren[0].hasOwnProperty("text")&&void 0!==this.$options._renderChildren[0].text&&this.$options._renderChildren[0].hasOwnProperty("tag")&&void 0===this.$options._renderChildren[0].tag)this.msgid=this.$options._renderChildren[0].text.trim();else{var t=this,r=e.component("i18n-helper-component",{render:function(e){return e("div",t.$options._renderChildren)}}),n=(new r).$mount();this.msgid=R(T(n.$el.innerHTML).trim()),this.msgidHTML=!0,n.$destroy()}},props:{tag:{type:String,default:"span"},tN:{type:[String,Number],required:!1},tPlural:{type:String,required:!1},tContext:{type:String,required:!1},tComment:{type:String,required:!1},tParams:{type:Object,required:!1},md:{required:!1},markdown:{required:!1}},computed:{translation:function(){var e=null;return e=this.isPlural&&this.tContext?this.$npgettext(this.tContext,this.msgid,this.isPlural?this.tPlural:null,this._tN):this.isPlural?this.$ngettext(this.msgid,this.isPlural?this.tPlural:null,this._tN):this.tContext?this.$pgettext(this.tContext,this.msgid):this.$gettext(this.msgid),e=this.$_i(e,Object.assign(this.$parent,"object"==typeof this.tParams?this.tParams:{})),void 0!==t&&void 0!==this.markdown&&!1!==this.markdown||void 0!==this.md&&!1!==this.md?(this.msgidHTML=!0,t(e)):e}},render:function(e){return this.$vnode.key||(this.$vnode.key=g()),e(this.tag,[this.translation])},mounted:function(){this.msgidHTML&&(this.$el.innerHTML=this.$el.innerText)}}},z=function(e){return{bind:function(t,r,n){n.key||(n.key=g());var a=n.context,i=n.data.attrs||{},o=t.innerHTML,s=i["t-context"],c=i["t-n"],l=c,u=i["t-plural"],h=i["t-params"]||{},p=i.md,d=i.markdown,f=void 0!==c&&void 0!==u;if(r.value&&"object"==typeof r.value&&(h=Object.assign(h,r.value)),l&&"string"==typeof l&&h?(l=c.trim(),l=h.hasOwnProperty(l)&&h[l]?h[l]:void 0):"number"!=typeof l&&(l=void 0),!f&&(c||u))throw new Error("`translate-n` and `translate-plural` attributes must be used together:"+o+".");o=t.innerHTML.trim()!==t.innerText?R(T(t.innerHTML).trim()):t.innerText;var m=null;m=f&&s?a.$npgettext(s,o,f?u:null,l):f?a.$ngettext(o,f?u:null,l):s?a.$pgettext(s,o):a.$gettext(o),m=a.$_i(m,Object.assign(a,"object"==typeof h?h:{})),t.innerHTML=void 0!==e&&void 0!==d&&!1!==d||void 0!==p&&!1!==p?e(m):m}}},G={session:{save:function(e,t,r){window.sessionStorage.setItem(e,t)},load:function(e){return window.sessionStorage.getItem(e)}},local:{save:function(e,t,r){window.localStorage.setItem(e,t)},load:function(e){return window.localStorage.getItem(e)}},cookie:{save:function(e,t,r,n){!function(e,t,r){var n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);var a="expires="+n.toUTCString();document.cookie=e+"="+t+";"+a+";path=/"}(e,t,n||365)},load:function(e){return function(e){for(var t=e+"=",r=decodeURIComponent(document.cookie),n=r.split(";"),a=0;a<n.length;a++){for(var i=n[a];" "===i.charAt(0);)i=i.substring(1);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return""}(e)}}},B=function(e){var t={messages:e.messages||{},defaultLocale:e.defaultLocale||"en",allLocales:e.allLocales||(e.defaultLocale?[e.defaultLocale]:["en"]),forceReloadOnSwitch:e.forceReloadOnSwitch||!0,usingRouter:e.usingRouter||!1,defaultLocaleInRoutes:e.defaultLocaleInRoutes||!1,routingStyle:e.routingStyle||"changeLocale",routeAutoPrefix:e.routeAutoPrefix||!0,storageMethod:"object"!=typeof e.storageMethod?["session","local","cookie"].includes(e.storageMethod.trim())?e.storageMethod.trim():"local":"custom",storageKey:e.storageKey||"_vue_i18n_gettext_locale",cookieExpirationInDays:e.cookieExpirationInDays||30,customOnLoad:e.customOnLoad};return"custom"===t.storageMethod&&(t.storageFunctions=e.storageMethod),t},H={created:function(){this.$i18n.customOnLoad&&"function"==typeof this.$i18n.customOnLoad&&this.$i18n.customOnLoad(this)}};f.version="0.0.7","undefined"!=typeof window&&window.Vue&&window.Vue.use(f),e.VueGettext=f,e.gettextMixin=H,e.default=f,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vue-i18n-gettext",
"description": "Full-featured gettext support for Vue.js.",
"version": "0.0.7",
"version": "0.0.8",
"author": {

@@ -6,0 +6,0 @@ "name": "Eldar Cejvanovic",

@@ -240,3 +240,3 @@ import pathToRegexp from 'path-to-regexp'

if (actualTo) {
actualTo.params = Object.assign(to.params, { _detected: true })
actualTo.params = to.params
actualTo.hash = to.hash

@@ -339,3 +339,3 @@ actualTo.query = to.query

// If there is a detection of an route that was mismatch originally, reroute to the valid match.
if (actualTo && !actualTo.params._detected) {
if (actualTo) {
next(actualTo)

@@ -412,16 +412,42 @@ }

// Converts a router link to the version of the current locale.
const _localeLink = function (link) {
let toPath
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp.compile(_path('/:_locale?/' + link))
const _localeLink = function (location) {
if (typeof location === 'string') {
let toPath
if (this.$i18n.routeAutoPrefix) {
toPath = pathToRegexp.compile(_path('/:_locale?/' + location))
} else {
toPath = pathToRegexp.compile(location.replace('$locale', ':_locale?'))
}
const path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale })
return path === '' ? '/' : path
} else {
toPath = pathToRegexp.compile(link.replace('$locale', ':_locale?'))
return location
}
const path = toPath({ _locale: this.$i18n.activeLocale === this.$i18n.defaultLocale ? (this.$i18n.defaultLocaleInRoutes ? this.$i18n.activeLocale : undefined) : this.$i18n.activeLocale })
return path === '' ? '/' : path
// TODO: Add support when the object contains name and/or path.
}
Vue.prototype.$localeLink = _localeLink
Vue.prototype.$L = _localeLink
Vue.prototype.$ll = _localeLink
// Expose the locale version of the router.
if (config.usingRouter && router) {
router.locPush = (location, onComplete, onAbort) => {
router.push(location ? router.app.$localeLink(location) : location, onComplete, onAbort)
}
router.locReplace = (location, onComplete, onAbort) => {
router.replace(location ? router.app.$localeLink(location) : location, onComplete, onAbort)
}
router.locGo = (n) => {
if (typeof n === 'string') {
router.go(n ? router.app.$localeLink(n) : n)
} else {
router.go(n)
}
// TODO: Check if route object support is needed.
}
// TODO: Test support for router.resolve and router.getMatchedComponents
}
// Makes <translate> available as a global component.

@@ -428,0 +454,0 @@ Vue.component('translate', Component(Vue, marked))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc