Comparing version 4.2.0 to 4.2.1
@@ -0,1 +1,11 @@ | ||
<a name="4.2.1"></a> | ||
## [4.2.1](https://github.com/kazupon/vue-i18n/compare/v4.2.0...v4.2.1) (2016-08-13) | ||
### :zap: Improvements | ||
* **translate:** fallback translation warning ([5f6b271](https://github.com/kazupon/vue-i18n/commit/5f6b271)) | ||
<a name="4.2.0"></a> | ||
@@ -2,0 +12,0 @@ # [4.2.0](https://github.com/kazupon/vue-i18n/compare/v4.1.0...v4.2.0) (2016-08-12) |
/*! | ||
* vue-i18n v4.2.0 | ||
* vue-i18n v4.2.1 | ||
* (c) 2016 kazuya kawaguchi | ||
@@ -661,3 +661,5 @@ * Released under the MIT License. | ||
function Extend (Vue) { | ||
var isObject = Vue.util.isObject; | ||
var _Vue$util = Vue.util; | ||
var isObject = _Vue$util.isObject; | ||
var bind = _Vue$util.bind; | ||
@@ -693,3 +695,3 @@ var format = Format(Vue); | ||
function translate(locale, key, args) { | ||
function interpolate(locale, key, args) { | ||
if (!locale) { | ||
@@ -707,2 +709,20 @@ return null; | ||
function translate(getter, lang, fallback, key, params) { | ||
var res = null; | ||
res = interpolate(getter(lang), key, params); | ||
if (res) { | ||
return res; | ||
} | ||
res = interpolate(getter(fallback), key, params); | ||
if (res) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
warn('Fall back to translate the keypath "' + key + '" with "' + fallback + '" language.'); | ||
} | ||
return res; | ||
} else { | ||
return null; | ||
} | ||
} | ||
function warnDefault(key) { | ||
@@ -715,2 +735,10 @@ if (process.env.NODE_ENV !== 'production') { | ||
function getAssetLocale(lang) { | ||
return Vue.locale(lang); | ||
} | ||
function getComponentLocale(lang) { | ||
return this.$options.locales[lang]; | ||
} | ||
/** | ||
@@ -739,3 +767,3 @@ * Vue.t | ||
return translate(Vue.locale(lang), key, params) || translate(Vue.locale(fallback), key, params) || warnDefault(key); | ||
return translate(getAssetLocale, lang, fallback, key, params) || warnDefault(key); | ||
}; | ||
@@ -766,3 +794,10 @@ | ||
return translate(this.$options.locales && this.$options.locales[lang], key, params) || translate(this.$options.locales && this.$options.locales[fallback], key, params) || translate(Vue.locale(lang), key, params) || translate(Vue.locale(fallback), key, params) || warnDefault(key); | ||
var res = null; | ||
if (this.$options.locales) { | ||
res = translate(bind(getComponentLocale, this), lang, fallback, key, params); | ||
if (res) { | ||
return res; | ||
} | ||
} | ||
return translate(getAssetLocale, lang, fallback, key, params) || warnDefault(key); | ||
}; | ||
@@ -815,3 +850,3 @@ | ||
plugin.version = '4.2.0'; | ||
plugin.version = '4.2.1'; | ||
@@ -818,0 +853,0 @@ if (typeof window !== 'undefined' && window.Vue) { |
/*! | ||
* vue-i18n v4.2.0 | ||
* vue-i18n v4.2.1 | ||
* (c) 2016 kazuya kawaguchi | ||
@@ -665,3 +665,5 @@ * Released under the MIT License. | ||
function Extend (Vue) { | ||
var isObject = Vue.util.isObject; | ||
var _Vue$util = Vue.util; | ||
var isObject = _Vue$util.isObject; | ||
var bind = _Vue$util.bind; | ||
@@ -697,3 +699,3 @@ var format = Format(Vue); | ||
function translate(locale, key, args) { | ||
function interpolate(locale, key, args) { | ||
if (!locale) { | ||
@@ -711,2 +713,20 @@ return null; | ||
function translate(getter, lang, fallback, key, params) { | ||
var res = null; | ||
res = interpolate(getter(lang), key, params); | ||
if (res) { | ||
return res; | ||
} | ||
res = interpolate(getter(fallback), key, params); | ||
if (res) { | ||
if ('development' !== 'production') { | ||
warn('Fall back to translate the keypath "' + key + '" with "' + fallback + '" language.'); | ||
} | ||
return res; | ||
} else { | ||
return null; | ||
} | ||
} | ||
function warnDefault(key) { | ||
@@ -719,2 +739,10 @@ if ('development' !== 'production') { | ||
function getAssetLocale(lang) { | ||
return Vue.locale(lang); | ||
} | ||
function getComponentLocale(lang) { | ||
return this.$options.locales[lang]; | ||
} | ||
/** | ||
@@ -743,3 +771,3 @@ * Vue.t | ||
return translate(Vue.locale(lang), key, params) || translate(Vue.locale(fallback), key, params) || warnDefault(key); | ||
return translate(getAssetLocale, lang, fallback, key, params) || warnDefault(key); | ||
}; | ||
@@ -770,3 +798,10 @@ | ||
return translate(this.$options.locales && this.$options.locales[lang], key, params) || translate(this.$options.locales && this.$options.locales[fallback], key, params) || translate(Vue.locale(lang), key, params) || translate(Vue.locale(fallback), key, params) || warnDefault(key); | ||
var res = null; | ||
if (this.$options.locales) { | ||
res = translate(bind(getComponentLocale, this), lang, fallback, key, params); | ||
if (res) { | ||
return res; | ||
} | ||
} | ||
return translate(getAssetLocale, lang, fallback, key, params) || warnDefault(key); | ||
}; | ||
@@ -819,3 +854,3 @@ | ||
plugin.version = '4.2.0'; | ||
plugin.version = '4.2.1'; | ||
@@ -822,0 +857,0 @@ if (typeof window !== 'undefined' && window.Vue) { |
/*! | ||
* vue-i18n v4.2.0 | ||
* vue-i18n v4.2.1 | ||
* (c) 2016 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueI18n=t()}(this,function(){"use strict";function n(n,t){window.console&&(console.warn("[vue-i18n] "+n),t&&console.warn(t.stack))}function t(t){t.locale=function(t,r,o){return void 0===r?w[t]:void(null===r?(w[t]=void 0,delete w[t]):e(t,r,function(e){e?(w[t]=e,o&&o()):n("failed set `"+t+"` locale")}))}}function e(n,t,e){var o=this;"object"===("undefined"==typeof t?"undefined":b["typeof"](t))?e(t):!function(){var n=t.call(o);"function"==typeof n?n.resolved?e(n.resolved):n.requested?n.pendingCallbacks.push(e):!function(){n.requested=!0;var t=n.pendingCallbacks=[e];n(function(e){n.resolved=e;for(var r=0,o=t.length;o>r;r++)t[r](e)},function(){e()})}():r(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function r(n){return n&&"function"==typeof n.then}function o(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,a=o.$lang;a?this.$lang=a:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){i(r)}),e.call(this,n)};var r=n.prototype._destroy;n.prototype._destroy=function(){this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null),this.$lang=null,r.apply(this,arguments)}}function i(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function a(n){if(!_){var t=n.$watch("__watcher__",function(n){});_=n._watchers[0].constructor,t()}return _}function u(n){return m||(m=n._data.__ob__.dep.constructor),m}function l(n,t,e){function r(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),l.target&&e.depend(),e.value}}var o=n.util.bind,i=a(t),l=u(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:r(function(){return t.lang},t),set:o(function(n){t.lang=n},t)}),A=e,Object.defineProperty(n.config,"fallbackLang",{enumerable:!0,configurable:!0,get:function(){return A},set:function(n){A=n}})}function c(n){function t(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return 1===r.length&&"object"===b["typeof"](r[0])&&(r=r[0]),r&&r.hasOwnProperty||(r={}),n.replace($,function(t,o,i,a){var u=void 0;return"{"===n[a-1]&&"}"===n[a+t.length]?i:(u=e(r,i)?r[i]:null,null===u||void 0===u?"":u)})}var e=n.util.hasOwn;return t}function f(n){if(void 0===n)return"eof";var t=n.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return n;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&122>=t||t>=65&&90>=t?"ident":t>=49&&57>=t?"number":"else"}function s(n){var t=exports.Vue.util,e=t.isLiteral,r=t.stripQuotes,o=n.trim();return"0"===n.charAt(0)&&isNaN(n)?!1:e(o)?r(o):"*"+o}function v(n){function t(){var t=n[r+1];return o===N&&"'"===t||o===q&&'"'===t?(r++,u="\\"+t,h[O](),!0):void 0}var e=[],r=-1,o=U,i=0,a=void 0,u=void 0,l=void 0,c=void 0,v=void 0,d=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==l&&(e.push(l),l=void 0)},h[O]=function(){void 0===l?l=u:l+=u},h[P]=function(){h[O](),i++},h[S]=function(){if(i>0)i--,o=L,h[O]();else{if(i=0,l=s(l),l===!1)return!1;h[k]()}};null!=o;)if(r++,a=n[r],"\\"!==a||!t()){if(c=f(a),p=Q[o],v=p[c]||p["else"]||I,v===I)return;if(o=v[0],d=h[v[1]],d&&(u=v[2],u=void 0===u?a:u,d()===!1))return;if(o===z)return e.raw=n,e}}function d(n){var t=j[n];return t||(t=v(n),t&&(j[n]=t)),t}function p(n){function t(n){if(null===n||void 0===n)return!0;if(Array.isArray(n)){if(n.length>0)return!1;if(0===n.length)return!0}else if(i(n))for(var t in n)if(a(n,t))return!1;return!0}function e(n,e){if(!o(n))return null;var r=d(e);if(t(r))return null;for(var i=r.length,a=null,u=n,l=0;i>l;){var c=u[r[l]];if(void 0===c){u=null;break}u=c,l++}return a=u}var r=n.util,o=r.isObject,i=r.isPlainObject,a=r.hasOwn;return e}function h(n){function t(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var i=n.config.lang,a=n.config.fallbackLang;return 1===e.length?o(e[0])||Array.isArray(e[0])?e=e[0]:"string"==typeof e[0]&&(i=e[0]):2===e.length&&("string"==typeof e[0]&&(i=e[0]),(o(e[1])||Array.isArray(e[1]))&&(e=e[1])),{lang:i,fallback:a,params:e}}function e(n,t,e){if(!n)return null;var r=a(n,t)||n[t];return r?e?i(r,e):r:null}function r(n){return n}var o=n.util.isObject,i=c(n),a=p(n);return n.t=function(o){for(var i=arguments.length,a=Array(i>1?i-1:0),u=1;i>u;u++)a[u-1]=arguments[u];if(!o)return"";var l=t.apply(void 0,a),c=l.lang,f=l.fallback,s=l.params;return e(n.locale(c),o,s)||e(n.locale(f),o,s)||r(o)},n.prototype.$t=function(o){if(!o)return"";for(var i=arguments.length,a=Array(i>1?i-1:0),u=1;i>u;u++)a[u-1]=arguments[u];var l=t.apply(void 0,a),c=l.lang,f=l.fallback,s=l.params;return e(this.$options.locales&&this.$options.locales[c],o,s)||e(this.$options.locales&&this.$options.locales[f],o,s)||e(n.locale(c),o,s)||e(n.locale(f),o,s)||r(o)},n}function g(n){var e=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n.version&&Number(n.version.split(".")[0])||-1,"en");y(n,e),t(n),o(n,Z),l(n,Z,e),h(n)}function y(n,t){var e=n.config.silent;n.config.silent=!0,Z||(Z=new n({data:{lang:t}})),n.config.silent=e}var b={};b["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var w=Object.create(null),_=void 0,m=void 0,A=void 0,$=/(%|)\{([0-9a-zA-Z_]+)\}/g,j=Object.create(null),O=0,k=1,P=2,S=3,U=0,V=1,x=2,C=3,L=4,N=5,q=6,z=7,I=8,Q=[];Q[U]={ws:[U],ident:[C,O],"[":[L],eof:[z]},Q[V]={ws:[V],".":[x],"[":[L],eof:[z]},Q[x]={ws:[x],ident:[C,O]},Q[C]={ident:[C,O],0:[C,O],number:[C,O],ws:[V,k],".":[x,k],"[":[L,k],eof:[z,k]},Q[L]={"'":[N,O],'"':[q,O],"[":[L,P],"]":[V,S],eof:I,"else":[L,O]},Q[N]={"'":[L,O],eof:I,"else":[N,O]},Q[q]={'"':[L,O],eof:I,"else":[q,O]};var Z=void 0;return g.version="4.2.0","undefined"!=typeof window&&window.Vue&&window.Vue.use(g),g}); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.VueI18n=t()}(this,function(){"use strict";function n(n,t){window.console&&(console.warn("[vue-i18n] "+n),t&&console.warn(t.stack))}function t(t){t.locale=function(t,r,o){return void 0===r?w[t]:void(null===r?(w[t]=void 0,delete w[t]):e(t,r,function(e){e?(w[t]=e,o&&o()):n("failed set `"+t+"` locale")}))}}function e(n,t,e){var o=this;"object"===("undefined"==typeof t?"undefined":b["typeof"](t))?e(t):!function(){var n=t.call(o);"function"==typeof n?n.resolved?e(n.resolved):n.requested?n.pendingCallbacks.push(e):!function(){n.requested=!0;var t=n.pendingCallbacks=[e];n(function(e){n.resolved=e;for(var r=0,o=t.length;o>r;r++)t[r](e)},function(){e()})}():r(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function r(n){return n&&"function"==typeof n.then}function o(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,u=o.$lang;u?this.$lang=u:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){i(r)}),e.call(this,n)};var r=n.prototype._destroy;n.prototype._destroy=function(){this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null),this.$lang=null,r.apply(this,arguments)}}function i(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function u(n){if(!_){var t=n.$watch("__watcher__",function(n){});_=n._watchers[0].constructor,t()}return _}function a(n){return m||(m=n._data.__ob__.dep.constructor),m}function l(n,t,e){function r(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),l.target&&e.depend(),e.value}}var o=n.util.bind,i=u(t),l=a(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:r(function(){return t.lang},t),set:o(function(n){t.lang=n},t)}),A=e,Object.defineProperty(n.config,"fallbackLang",{enumerable:!0,configurable:!0,get:function(){return A},set:function(n){A=n}})}function c(n){function t(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return 1===r.length&&"object"===b["typeof"](r[0])&&(r=r[0]),r&&r.hasOwnProperty||(r={}),n.replace(j,function(t,o,i,u){var a=void 0;return"{"===n[u-1]&&"}"===n[u+t.length]?i:(a=e(r,i)?r[i]:null,null===a||void 0===a?"":a)})}var e=n.util.hasOwn;return t}function f(n){if(void 0===n)return"eof";var t=n.charCodeAt(0);switch(t){case 91:case 93:case 46:case 34:case 39:case 48:return n;case 95:case 36:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&122>=t||t>=65&&90>=t?"ident":t>=49&&57>=t?"number":"else"}function s(n){var t=exports.Vue.util,e=t.isLiteral,r=t.stripQuotes,o=n.trim();return"0"===n.charAt(0)&&isNaN(n)?!1:e(o)?r(o):"*"+o}function v(n){function t(){var t=n[r+1];return o===N&&"'"===t||o===q&&'"'===t?(r++,a="\\"+t,h[$](),!0):void 0}var e=[],r=-1,o=U,i=0,u=void 0,a=void 0,l=void 0,c=void 0,v=void 0,d=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==l&&(e.push(l),l=void 0)},h[$]=function(){void 0===l?l=a:l+=a},h[P]=function(){h[$](),i++},h[S]=function(){if(i>0)i--,o=L,h[$]();else{if(i=0,l=s(l),l===!1)return!1;h[k]()}};null!=o;)if(r++,u=n[r],"\\"!==u||!t()){if(c=f(u),p=Q[o],v=p[c]||p["else"]||I,v===I)return;if(o=v[0],d=h[v[1]],d&&(a=v[2],a=void 0===a?u:a,d()===!1))return;if(o===z)return e.raw=n,e}}function d(n){var t=O[n];return t||(t=v(n),t&&(O[n]=t)),t}function p(n){function t(n){if(null===n||void 0===n)return!0;if(Array.isArray(n)){if(n.length>0)return!1;if(0===n.length)return!0}else if(i(n))for(var t in n)if(u(n,t))return!1;return!0}function e(n,e){if(!o(n))return null;var r=d(e);if(t(r))return null;for(var i=r.length,u=null,a=n,l=0;i>l;){var c=a[r[l]];if(void 0===c){a=null;break}a=c,l++}return u=a}var r=n.util,o=r.isObject,i=r.isPlainObject,u=r.hasOwn;return e}function h(n){function t(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];var o=n.config.lang,i=n.config.fallbackLang;return 1===e.length?l(e[0])||Array.isArray(e[0])?e=e[0]:"string"==typeof e[0]&&(o=e[0]):2===e.length&&("string"==typeof e[0]&&(o=e[0]),(l(e[1])||Array.isArray(e[1]))&&(e=e[1])),{lang:o,fallback:i,params:e}}function e(n,t,e){if(!n)return null;var r=v(n,t)||n[t];return r?e?s(r,e):r:null}function r(n,t,r,o,i){var u=null;return(u=e(n(t),o,i))?u:(u=e(n(r),o,i),u?u:null)}function o(n){return n}function i(t){return n.locale(t)}function u(n){return this.$options.locales[n]}var a=n.util,l=a.isObject,f=a.bind,s=c(n),v=p(n);return n.t=function(n){for(var e=arguments.length,u=Array(e>1?e-1:0),a=1;e>a;a++)u[a-1]=arguments[a];if(!n)return"";var l=t.apply(void 0,u),c=l.lang,f=l.fallback,s=l.params;return r(i,c,f,n,s)||o(n)},n.prototype.$t=function(n){if(!n)return"";for(var e=arguments.length,a=Array(e>1?e-1:0),l=1;e>l;l++)a[l-1]=arguments[l];var c=t.apply(void 0,a),s=c.lang,v=c.fallback,d=c.params,p=null;return this.$options.locales&&(p=r(f(u,this),s,v,n,d))?p:r(i,s,v,n,d)||o(n)},n}function g(n){var e=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n.version&&Number(n.version.split(".")[0])||-1,"en");y(n,e),t(n),o(n,Z),l(n,Z,e),h(n)}function y(n,t){var e=n.config.silent;n.config.silent=!0,Z||(Z=new n({data:{lang:t}})),n.config.silent=e}var b={};b["typeof"]="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol?"symbol":typeof n};var w=Object.create(null),_=void 0,m=void 0,A=void 0,j=/(%|)\{([0-9a-zA-Z_]+)\}/g,O=Object.create(null),$=0,k=1,P=2,S=3,U=0,V=1,x=2,C=3,L=4,N=5,q=6,z=7,I=8,Q=[];Q[U]={ws:[U],ident:[C,$],"[":[L],eof:[z]},Q[V]={ws:[V],".":[x],"[":[L],eof:[z]},Q[x]={ws:[x],ident:[C,$]},Q[C]={ident:[C,$],0:[C,$],number:[C,$],ws:[V,k],".":[x,k],"[":[L,k],eof:[z,k]},Q[L]={"'":[N,$],'"':[q,$],"[":[L,P],"]":[V,S],eof:I,"else":[L,$]},Q[N]={"'":[L,$],eof:I,"else":[N,$]},Q[q]={'"':[L,$],eof:I,"else":[q,$]};var Z=void 0;return g.version="4.2.1","undefined"!=typeof window&&window.Vue&&window.Vue.use(g),g}); |
{ | ||
"name": "vue-i18n", | ||
"description": "Internationalization plugin for Vue.js", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "kazuya kawaguchi", |
@@ -14,3 +14,3 @@ import warn from './warn' | ||
export default function (Vue) { | ||
const { isObject } = Vue.util | ||
const { isObject, bind } = Vue.util | ||
const format = Format(Vue) | ||
@@ -41,3 +41,3 @@ const getValue = Path(Vue) | ||
function translate (locale, key, args) { | ||
function interpolate (locale, key, args) { | ||
if (!locale) { return null } | ||
@@ -51,2 +51,19 @@ | ||
function translate (getter, lang, fallback, key, params) { | ||
let res = null | ||
res = interpolate(getter(lang), key, params) | ||
if (res) { return res } | ||
res = interpolate(getter(fallback), key, params) | ||
if (res) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
warn('Fall back to translate the keypath "' + key + '" with "' + fallback + '" language.') | ||
} | ||
return res | ||
} else { | ||
return null | ||
} | ||
} | ||
function warnDefault (key) { | ||
@@ -60,3 +77,10 @@ if (process.env.NODE_ENV !== 'production') { | ||
function getAssetLocale (lang) { | ||
return Vue.locale(lang) | ||
} | ||
function getComponentLocale (lang) { | ||
return this.$options.locales[lang] | ||
} | ||
/** | ||
@@ -72,6 +96,4 @@ * Vue.t | ||
if (!key) { return '' } | ||
const { lang, fallback, params } = parseArgs(...args) | ||
return translate(Vue.locale(lang), key, params) | ||
|| translate(Vue.locale(fallback), key, params) | ||
return translate(getAssetLocale, lang, fallback, key, params) | ||
|| warnDefault(key) | ||
@@ -91,8 +113,9 @@ } | ||
if (!key) { return '' } | ||
const { lang, fallback, params } = parseArgs(...args) | ||
return translate(this.$options.locales && this.$options.locales[lang], key, params) | ||
|| translate(this.$options.locales && this.$options.locales[fallback], key, params) | ||
|| translate(Vue.locale(lang), key, params) | ||
|| translate(Vue.locale(fallback), key, params) | ||
let res = null | ||
if (this.$options.locales) { | ||
res = translate(bind(getComponentLocale, this), lang, fallback, key, params) | ||
if (res) { return res } | ||
} | ||
return translate(getAssetLocale, lang, fallback, key, params) | ||
|| warnDefault(key) | ||
@@ -99,0 +122,0 @@ } |
@@ -50,3 +50,3 @@ import warn from './warn' | ||
plugin.version = '4.2.0' | ||
plugin.version = '4.2.1' | ||
@@ -53,0 +53,0 @@ export default plugin |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78233
17
2075
495
4