Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-i18n

Package Overview
Dependencies
Maintainers
1
Versions
355
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-i18n - npm Package Compare versions

Comparing version 4.9.0 to 4.10.0

15

CHANGELOG.md

@@ -0,1 +1,16 @@

<a name="4.10.0"></a>
# [4.10.0](https://github.com/kazupon/vue-i18n/compare/v4.9.0...v4.10.0) (2017-01-01)
### :star: New Features
* `$lang` property for all component ([#99](https://github.com/kazupon/vue-i18n/issues/99)) by [@albert](https://github.com/albert)-zhang ([5ed69f8](https://github.com/kazupon/vue-i18n/commit/5ed69f8))
### :up: Updates
* **override:** change langVM keeping variable name ([3ec1bb2](https://github.com/kazupon/vue-i18n/commit/3ec1bb2))
<a name="4.9.0"></a>

@@ -2,0 +17,0 @@ # [4.9.0](https://github.com/kazupon/vue-i18n/compare/v4.8.0...v4.9.0) (2016-12-17)

64

dist/vue-i18n.common.js
/*!
* vue-i18n v4.9.0
* (c) 2016 kazuya kawaguchi
* vue-i18n v4.10.0
* (c) 2017 kazuya kawaguchi
* Released under the MIT License.

@@ -12,3 +12,3 @@ */

} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

@@ -147,4 +147,4 @@ babelHelpers;

// root
this.$lang = langVM;
this._langUnwatch = this.$lang.$watch('$data', function (val, old) {
this._$lang = langVM;
this._langUnwatch = this._$lang.$watch('$data', function (val, old) {
update(_this);

@@ -161,3 +161,3 @@ }, { deep: true });

this._langUnwatch = null;
this.$lang = null;
this._$lang = null;
}

@@ -643,6 +643,6 @@

function Path (Vue) {
var _Vue$util = Vue.util;
var isObject = _Vue$util.isObject;
var isPlainObject = _Vue$util.isPlainObject;
var hasOwn = _Vue$util.hasOwn;
var _Vue$util = Vue.util,
isObject = _Vue$util.isObject,
isPlainObject = _Vue$util.isPlainObject,
hasOwn = _Vue$util.hasOwn;

@@ -722,5 +722,5 @@

function Extend (Vue) {
var _Vue$util = Vue.util;
var isObject = _Vue$util.isObject;
var bind = _Vue$util.bind;
var _Vue$util = Vue.util,
isObject = _Vue$util.isObject,
bind = _Vue$util.bind;

@@ -886,8 +886,7 @@ var format = Format(Vue);

var _parseArgs = parseArgs.apply(undefined, args);
var _parseArgs = parseArgs.apply(undefined, args),
lang = _parseArgs.lang,
fallback = _parseArgs.fallback,
params = _parseArgs.params;
var lang = _parseArgs.lang;
var fallback = _parseArgs.fallback;
var params = _parseArgs.params;
return warnDefault(lang, key, null, translate(getAssetLocale, lang, fallback, key, params));

@@ -926,6 +925,5 @@ };

var _parseArgs2 = parseArgs.apply(undefined, args);
var _parseArgs2 = parseArgs.apply(undefined, args),
lang = _parseArgs2.lang;
var lang = _parseArgs2.lang;
return exist(getAssetLocale(lang), key);

@@ -951,8 +949,7 @@ };

var _parseArgs3 = parseArgs.apply(undefined, args);
var _parseArgs3 = parseArgs.apply(undefined, args),
lang = _parseArgs3.lang,
fallback = _parseArgs3.fallback,
params = _parseArgs3.params;
var lang = _parseArgs3.lang;
var fallback = _parseArgs3.fallback;
var params = _parseArgs3.params;
var res = null;

@@ -1003,6 +1000,5 @@ if (this.$options.locales) {

var _parseArgs4 = parseArgs.apply(undefined, args);
var _parseArgs4 = parseArgs.apply(undefined, args),
lang = _parseArgs4.lang;
var lang = _parseArgs4.lang;
var found = false;

@@ -1019,2 +1015,10 @@ if (this.$options.locales) {

Vue.mixin({
computed: {
$lang: function $lang() {
return Vue.config.lang;
}
}
});
return Vue;

@@ -1034,3 +1038,3 @@ }

function plugin(Vue) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -1037,0 +1041,0 @@ var version = Vue.version && Number(Vue.version.split('.')[0]) || -1;

/*!
* vue-i18n v4.9.0
* (c) 2016 kazuya kawaguchi
* vue-i18n v4.10.0
* (c) 2017 kazuya kawaguchi
* Released under the MIT License.

@@ -16,3 +16,3 @@ */

} : function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj;
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};

@@ -151,4 +151,4 @@ babelHelpers;

// root
this.$lang = langVM;
this._langUnwatch = this.$lang.$watch('$data', function (val, old) {
this._$lang = langVM;
this._langUnwatch = this._$lang.$watch('$data', function (val, old) {
update(_this);

@@ -165,3 +165,3 @@ }, { deep: true });

this._langUnwatch = null;
this.$lang = null;
this._$lang = null;
}

@@ -647,6 +647,6 @@

function Path (Vue) {
var _Vue$util = Vue.util;
var isObject = _Vue$util.isObject;
var isPlainObject = _Vue$util.isPlainObject;
var hasOwn = _Vue$util.hasOwn;
var _Vue$util = Vue.util,
isObject = _Vue$util.isObject,
isPlainObject = _Vue$util.isPlainObject,
hasOwn = _Vue$util.hasOwn;

@@ -726,5 +726,5 @@

function Extend (Vue) {
var _Vue$util = Vue.util;
var isObject = _Vue$util.isObject;
var bind = _Vue$util.bind;
var _Vue$util = Vue.util,
isObject = _Vue$util.isObject,
bind = _Vue$util.bind;

@@ -890,8 +890,7 @@ var format = Format(Vue);

var _parseArgs = parseArgs.apply(undefined, args);
var _parseArgs = parseArgs.apply(undefined, args),
lang = _parseArgs.lang,
fallback = _parseArgs.fallback,
params = _parseArgs.params;
var lang = _parseArgs.lang;
var fallback = _parseArgs.fallback;
var params = _parseArgs.params;
return warnDefault(lang, key, null, translate(getAssetLocale, lang, fallback, key, params));

@@ -930,6 +929,5 @@ };

var _parseArgs2 = parseArgs.apply(undefined, args);
var _parseArgs2 = parseArgs.apply(undefined, args),
lang = _parseArgs2.lang;
var lang = _parseArgs2.lang;
return exist(getAssetLocale(lang), key);

@@ -955,8 +953,7 @@ };

var _parseArgs3 = parseArgs.apply(undefined, args);
var _parseArgs3 = parseArgs.apply(undefined, args),
lang = _parseArgs3.lang,
fallback = _parseArgs3.fallback,
params = _parseArgs3.params;
var lang = _parseArgs3.lang;
var fallback = _parseArgs3.fallback;
var params = _parseArgs3.params;
var res = null;

@@ -1007,6 +1004,5 @@ if (this.$options.locales) {

var _parseArgs4 = parseArgs.apply(undefined, args);
var _parseArgs4 = parseArgs.apply(undefined, args),
lang = _parseArgs4.lang;
var lang = _parseArgs4.lang;
var found = false;

@@ -1023,2 +1019,10 @@ if (this.$options.locales) {

Vue.mixin({
computed: {
$lang: function $lang() {
return Vue.config.lang;
}
}
});
return Vue;

@@ -1038,3 +1042,3 @@ }

function plugin(Vue) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -1071,3 +1075,3 @@ var version = Vue.version && Number(Vue.version.split('.')[0]) || -1;

plugin.version = '4.9.0';
plugin.version = '4.10.0';

@@ -1074,0 +1078,0 @@ if (typeof window !== 'undefined' && window.Vue) {

/*!
* vue-i18n v4.9.0
* (c) 2016 kazuya kawaguchi
* vue-i18n v4.10.0
* (c) 2017 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,r){t.locale=function(t,o,i){return void 0===o?r.locales[t]:void(null===o?(r.locales[t]=void 0,delete r.locales[t]):e(t,o,function(e){e?r.locales[t]=e:n("failed set `"+t+"` locale"),i&&i()}))}}function e(n,t,e){var o=this;"object"===("undefined"==typeof t?"undefined":w["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,e){function r(n){if(e>1)n.$forceUpdate();else for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}var o=n.prototype._init;n.prototype._init=function(n){var e=this;o.call(this,n),this.$parent||(this.$lang=t,this._langUnwatch=this.$lang.$watch("$data",function(n,t){r(e)},{deep:!0}))};var i=n.prototype._destroy;n.prototype._destroy=function(){!this.$parent&&this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null,this.$lang=null),i.apply(this,arguments)}}function i(n){if(!_){var t=n.$watch("__watcher__",function(n){});_=n._watchers[0].constructor,t()}return _}function a(n){return!A&&n&&n._data&&n._data.__ob__&&n._data.__ob__.dep&&(A=n._data.__ob__.dep.constructor),A}function u(n,t,e){function r(n,t){var e=new u(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),l&&l.target&&e.depend(),e.value}}var o=n.util.bind,u=i(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)}),$=e,Object.defineProperty(n.config,"fallbackLang",{enumerable:!0,configurable:!0,get:function(){return $},set:function(n){$=n}}),Object.defineProperty(n.config,"missingHandler",{enumerable:!0,configurable:!0,get:function(){return O},set:function(n){O=n}}),Object.defineProperty(n.config,"i18nFormatter",{enumerable:!0,configurable:!0,get:function(){return j},set:function(n){j=n}})}function l(n){return null===n||void 0===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 r=1===r.length&&"object"===w["typeof"](r[0])?r[0]:{},r&&r.hasOwnProperty||(r={}),n.replace(k,function(t,o,i,a){var u=void 0;return"{"===n[a-1]&&"}"===n[a+t.length]?i:(u=e(r,i)?r[i]:t,l(u)?"":u)})}var e=n.util.hasOwn;return t}function f(n){return B.test(n)}function s(n){var t=n.charCodeAt(0),e=n.charCodeAt(n.length-1);return t!==e||34!==t&&39!==t?n:n.slice(1,-1)}function d(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:case 45: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 g(n){var t=n.trim();return"0"===n.charAt(0)&&isNaN(n)?!1:f(t)?s(t):"*"+t}function v(n){function t(){var t=n[r+1];return o===z&&"'"===t||o===L&&'"'===t?(r++,u="\\"+t,p[C](),!0):void 0}var e=[],r=-1,o=x,i=0,a=void 0,u=void 0,l=void 0,c=void 0,f=void 0,s=void 0,v=void 0,p=[];for(p[U]=function(){void 0!==l&&(e.push(l),l=void 0)},p[C]=function(){void 0===l?l=u:l+=u},p[S]=function(){p[C](),i++},p[V]=function(){if(i>0)i--,o=q,p[C]();else{if(i=0,l=g(l),l===!1)return!1;p[U]()}};null!=o;)if(r++,a=n[r],"\\"!==a||!t()){if(c=d(a),v=Z[o],f=v[c]||v["else"]||I,f===I)return;if(o=f[0],s=p[f[1]],s&&(u=f[2],u=void 0===u?a:u,s()===!1))return;if(o===M)return e.raw=n,e}}function p(n){var t=P[n];return t||(t=v(n),t&&(P[n]=t)),t}function y(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=p(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(t){function e(){for(var n=arguments.length,e=Array(n),r=0;n>r;r++)e[r]=arguments[r];var o=t.config.lang,i=t.config.fallbackLang;return 1===e.length?p(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]),(p(e[1])||Array.isArray(e[1]))&&(e=e[1])),{lang:o,fallback:i,params:e}}function r(n,t){return n&&t?!l(b(n,t)):!1}function o(e,r,i){if(!e)return null;var a=b(e,r);if(Array.isArray(a))return a;if(l(a)&&(a=e[r]),l(a))return null;if("string"!=typeof a)return n("Value of key '"+r+"' is not a string!"),null;if(a.indexOf("@:")>=0){var u=a.match(/(@:[\w|.]+)/g);for(var c in u){var f=u[c],s=f.substr(2),d=o(e,s,i);a=a.replace(f,d)}}return i?t.config.i18nFormatter?t.config.i18nFormatter.apply(null,[a].concat(i)):m(a,i):a}function i(n,t,e,r,i){var a=null;return a=o(n(t),r,i),l(a)?(a=o(n(e),r,i),l(a)?null:a):a}function a(n,e,r,o){return l(o)?(t.config.missingHandler&&t.config.missingHandler.apply(null,[n,e,r]),e):o}function u(n){return t.locale(n)}function f(n){return this.$options.locales[n]}function s(n){return n?n>1?1:0:1}function d(n,t){return n=Math.abs(n),2===t?s(n):n?Math.min(n,2):0}function g(n,t){if(!n&&"string"!=typeof n)return null;var e=n.split("|");return t=d(t,e.length),e[t]?e[t].trim():n}var v=t.util,p=v.isObject,h=v.bind,m=c(t),b=y(t);return t.t=function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];if(!n)return"";var l=e.apply(void 0,r),c=l.lang,f=l.fallback,s=l.params;return a(c,n,null,i(u,c,f,n,s))},t.tc=function(n,e){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;r>i;i++)o[i-2]=arguments[i];return g(t.t.apply(t,[n].concat(o)),e)},t.te=function(n){for(var t=arguments.length,o=Array(t>1?t-1:0),i=1;t>i;i++)o[i-1]=arguments[i];var a=e.apply(void 0,o),l=a.lang;return r(u(l),n)},t.prototype.$t=function(n){if(!n)return"";for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];var l=e.apply(void 0,r),c=l.lang,s=l.fallback,d=l.params,g=null;return this.$options.locales&&(g=i(h(f,this),c,s,n,d))?g:a(c,n,this,i(u,c,s,n,d))},t.prototype.$tc=function(n,t){if("number"!=typeof t&&"undefined"!=typeof t)return n;for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;e>o;o++)r[o-2]=arguments[o];return g(this.$t.apply(this,[n].concat(r)),t)},t.prototype.$te=function(n){for(var t=arguments.length,o=Array(t>1?t-1:0),i=1;t>i;i++)o[i-1]=arguments[i];var a=e.apply(void 0,o),l=a.lang,c=!1;return this.$options.locales&&(c=r(h(f)(l),n)),c||(c=r(u(l),n)),c},t}function m(n){var e=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n.version&&Number(n.version.split(".")[0])||-1),r="en";b(n,r),t(n,D),o(n,D,e),u(n,D,r),h(n)}function b(n,t){var e=n.config.silent;n.config.silent=!0,D||(D=new n({data:{lang:t,locales:{}}})),n.config.silent=e}var w={};w["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 _=void 0,A=void 0,$=void 0,O=null,j=null,k=/(%|)\{([0-9a-zA-Z_]+)\}/g,P=Object.create(null),C=0,U=1,S=2,V=3,x=0,F=1,H=2,N=3,q=4,z=5,L=6,M=7,I=8,Z=[];Z[x]={ws:[x],ident:[N,C],"[":[q],eof:[M]},Z[F]={ws:[F],".":[H],"[":[q],eof:[M]},Z[H]={ws:[H],ident:[N,C],0:[N,C],number:[N,C]},Z[N]={ident:[N,C],0:[N,C],number:[N,C],ws:[F,U],".":[H,U],"[":[q,U],eof:[M,U]},Z[q]={"'":[z,C],'"':[L,C],"[":[q,S],"]":[F,V],eof:I,"else":[q,C]},Z[z]={"'":[q,C],eof:I,"else":[z,C]},Z[L]={'"':[q,C],eof:I,"else":[L,C]};var B=/^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/,D=void 0;return m.version="4.9.0","undefined"!=typeof window&&window.Vue&&window.Vue.use(m),m});
!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,r){t.locale=function(t,o,i){return void 0===o?r.locales[t]:void(null===o?(r.locales[t]=void 0,delete r.locales[t]):e(t,o,function(e){e?r.locales[t]=e:n("failed set `"+t+"` locale"),i&&i()}))}}function e(n,t,e){var o=this;"object"===("undefined"==typeof t?"undefined":m.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;r<o;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,e){function r(n){if(e>1)n.$forceUpdate();else for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}var o=n.prototype._init;n.prototype._init=function(n){var e=this;o.call(this,n),this.$parent||(this._$lang=t,this._langUnwatch=this._$lang.$watch("$data",function(n,t){r(e)},{deep:!0}))};var i=n.prototype._destroy;n.prototype._destroy=function(){!this.$parent&&this._langUnwatch&&(this._langUnwatch(),this._langUnwatch=null,this._$lang=null),i.apply(this,arguments)}}function i(n){if(!w){var t=n.$watch("__watcher__",function(n){});w=n._watchers[0].constructor,t()}return w}function a(n){return!A&&n&&n._data&&n._data.__ob__&&n._data.__ob__.dep&&(A=n._data.__ob__.dep.constructor),A}function u(n,t,e){function r(n,t){var e=new u(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),l&&l.target&&e.depend(),e.value}}var o=n.util.bind,u=i(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)}),$=e,Object.defineProperty(n.config,"fallbackLang",{enumerable:!0,configurable:!0,get:function(){return $},set:function(n){$=n}}),Object.defineProperty(n.config,"missingHandler",{enumerable:!0,configurable:!0,get:function(){return O},set:function(n){O=n}}),Object.defineProperty(n.config,"i18nFormatter",{enumerable:!0,configurable:!0,get:function(){return j},set:function(n){j=n}})}function l(n){return null===n||void 0===n}function c(n){function t(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];return r=1===r.length&&"object"===m.typeof(r[0])?r[0]:{},r&&r.hasOwnProperty||(r={}),n.replace(k,function(t,o,i,a){var u=void 0;return"{"===n[a-1]&&"}"===n[a+t.length]?i:(u=e(r,i)?r[i]:t,l(u)?"":u)})}var e=n.util.hasOwn;return t}function f(n){return B.test(n)}function s(n){var t=n.charCodeAt(0),e=n.charCodeAt(n.length-1);return t!==e||34!==t&&39!==t?n:n.slice(1,-1)}function d(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:case 45:return"ident";case 32:case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"ws"}return t>=97&&t<=122||t>=65&&t<=90?"ident":t>=49&&t<=57?"number":"else"}function v(n){var t=n.trim();return("0"!==n.charAt(0)||!isNaN(n))&&(f(t)?s(t):"*"+t)}function p(n){function t(){var t=n[r+1];if(o===z&&"'"===t||o===L&&'"'===t)return r++,u="\\"+t,g[C](),!0}var e=[],r=-1,o=V,i=0,a=void 0,u=void 0,l=void 0,c=void 0,f=void 0,s=void 0,p=void 0,g=[];for(g[S]=function(){void 0!==l&&(e.push(l),l=void 0)},g[C]=function(){void 0===l?l=u:l+=u},g[U]=function(){g[C](),i++},g[x]=function(){if(i>0)i--,o=q,g[C]();else{if(i=0,l=v(l),l===!1)return!1;g[S]()}};null!=o;)if(r++,a=n[r],"\\"!==a||!t()){if(c=d(a),p=Z[o],f=p[c]||p.else||I,f===I)return;if(o=f[0],s=g[f[1]],s&&(u=f[2],u=void 0===u?a:u,s()===!1))return;if(o===M)return e.raw=n,e}}function g(n){var t=P[n];return t||(t=p(n),t&&(P[n]=t)),t}function y(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=g(e);if(t(r))return null;for(var i=r.length,a=null,u=n,l=0;l<i;){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(t){function e(){for(var n=arguments.length,e=Array(n),r=0;r<n;r++)e[r]=arguments[r];var o=t.config.lang,i=t.config.fallbackLang;return 1===e.length?g(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]),(g(e[1])||Array.isArray(e[1]))&&(e=e[1])),{lang:o,fallback:i,params:e}}function r(n,t){return!(!n||!t)&&!l(_(n,t))}function o(e,r,i){if(!e)return null;var a=_(e,r);if(Array.isArray(a))return a;if(l(a)&&(a=e[r]),l(a))return null;if("string"!=typeof a)return n("Value of key '"+r+"' is not a string!"),null;if(a.indexOf("@:")>=0){var u=a.match(/(@:[\w|.]+)/g);for(var c in u){var f=u[c],s=f.substr(2),d=o(e,s,i);a=a.replace(f,d)}}return i?t.config.i18nFormatter?t.config.i18nFormatter.apply(null,[a].concat(i)):b(a,i):a}function i(n,t,e,r,i){var a=null;return a=o(n(t),r,i),l(a)?(a=o(n(e),r,i),l(a)?null:a):a}function a(n,e,r,o){return l(o)?(t.config.missingHandler&&t.config.missingHandler.apply(null,[n,e,r]),e):o}function u(n){return t.locale(n)}function f(n){return this.$options.locales[n]}function s(n){return n?n>1?1:0:1}function d(n,t){return n=Math.abs(n),2===t?s(n):n?Math.min(n,2):0}function v(n,t){if(!n&&"string"!=typeof n)return null;var e=n.split("|");return t=d(t,e.length),e[t]?e[t].trim():n}var p=t.util,g=p.isObject,h=p.bind,b=c(t),_=y(t);return t.t=function(n){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];if(!n)return"";var l=e.apply(void 0,r),c=l.lang,f=l.fallback,s=l.params;return a(c,n,null,i(u,c,f,n,s))},t.tc=function(n,e){for(var r=arguments.length,o=Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return v(t.t.apply(t,[n].concat(o)),e)},t.te=function(n){for(var t=arguments.length,o=Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var a=e.apply(void 0,o),l=a.lang;return r(u(l),n)},t.prototype.$t=function(n){if(!n)return"";for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];var l=e.apply(void 0,r),c=l.lang,s=l.fallback,d=l.params,v=null;return this.$options.locales&&(v=i(h(f,this),c,s,n,d))?v:a(c,n,this,i(u,c,s,n,d))},t.prototype.$tc=function(n,t){if("number"!=typeof t&&"undefined"!=typeof t)return n;for(var e=arguments.length,r=Array(e>2?e-2:0),o=2;o<e;o++)r[o-2]=arguments[o];return v(this.$t.apply(this,[n].concat(r)),t)},t.prototype.$te=function(n){for(var t=arguments.length,o=Array(t>1?t-1:0),i=1;i<t;i++)o[i-1]=arguments[i];var a=e.apply(void 0,o),l=a.lang,c=!1;return this.$options.locales&&(c=r(h(f)(l),n)),c||(c=r(u(l),n)),c},t.mixin({computed:{$lang:function(){return t.config.lang}}}),t}function b(n){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n.version&&Number(n.version.split(".")[0])||-1),r="en";_(n,r),t(n,D),o(n,D,e),u(n,D,r),h(n)}function _(n,t){var e=n.config.silent;n.config.silent=!0,D||(D=new n({data:{lang:t,locales:{}}})),n.config.silent=e}var m={};m.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n};var w=void 0,A=void 0,$=void 0,O=null,j=null,k=/(%|)\{([0-9a-zA-Z_]+)\}/g,P=Object.create(null),C=0,S=1,U=2,x=3,V=0,F=1,H=2,N=3,q=4,z=5,L=6,M=7,I=8,Z=[];Z[V]={ws:[V],ident:[N,C],"[":[q],eof:[M]},Z[F]={ws:[F],".":[H],"[":[q],eof:[M]},Z[H]={ws:[H],ident:[N,C],0:[N,C],number:[N,C]},Z[N]={ident:[N,C],0:[N,C],number:[N,C],ws:[F,S],".":[H,S],"[":[q,S],eof:[M,S]},Z[q]={"'":[z,C],'"':[L,C],"[":[q,U],"]":[F,x],eof:I,else:[q,C]},Z[z]={"'":[q,C],eof:I,else:[z,C]},Z[L]={'"':[q,C],eof:I,else:[L,C]};var B=/^\s?(true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/,D=void 0;return b.version="4.10.0","undefined"!=typeof window&&window.Vue&&window.Vue.use(b),b});
{
"name": "vue-i18n",
"description": "Internationalization plugin for Vue.js",
"version": "4.9.0",
"version": "4.10.0",
"author": {

@@ -13,9 +13,9 @@ "name": "kazuya kawaguchi",

"devDependencies": {
"babel-core": "^6.7.4",
"babel-loader": "^6.2.4",
"babel-plugin-espower": "^2.1.2",
"babel-plugin-transform-es2015-modules-commonjs": "^6.7.4",
"babel-core": "6.7.4",
"babel-loader": "6.2.4",
"babel-plugin-espower": "2.1.2",
"babel-plugin-transform-es2015-modules-commonjs": "6.7.4",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-es2015-rollup": "^1.1.1",
"babel-preset-es2015": "6.6.0",
"babel-preset-es2015-rollup": "1.1.1",
"conventional-changelog-cli": "^1.1.1",

@@ -25,4 +25,4 @@ "conventional-github-releaser": "^1.1.3",

"eslint-config-vue": "^1.1.0",
"eslint-loader": "^1.3.0",
"eslint-plugin-html": "^1.5.2",
"eslint-loader": "^1.3.0",
"git-commit-message-convention": "git://github.com/kazupon/git-commit-message-convention.git",

@@ -50,4 +50,4 @@ "gitbook-cli": "^2.3.0",

"power-assert": "^1.3.1",
"rollup": "^0.25.6",
"rollup-plugin-babel": "^2.4.0",
"rollup": "0.25.6",
"rollup-plugin-babel": "2.4.0",
"rollup-plugin-replace": "^1.1.0",

@@ -54,0 +54,0 @@ "uglify-js": "^2.6.1",

@@ -235,3 +235,11 @@ import warn from './warn'

Vue.mixin({
computed: {
$lang () {
return Vue.config.lang
}
}
})
return Vue
}

@@ -19,4 +19,4 @@ export default function (Vue, langVM, version) {

if (!this.$parent) { // root
this.$lang = langVM
this._langUnwatch = this.$lang.$watch('$data', (val, old) => {
this._$lang = langVM
this._langUnwatch = this._$lang.$watch('$data', (val, old) => {
update(this)

@@ -33,3 +33,3 @@ }, { deep: true })

this._langUnwatch = null
this.$lang = null
this._$lang = null
}

@@ -36,0 +36,0 @@

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