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 3.1.0 to 3.1.1

10

CHANGELOG.md

@@ -0,1 +1,11 @@

<a name="3.1.1"></a>
## [3.1.1](https://github.com/kazupon/vue-i18n/compare/v3.1.0...v3.1.1) (2016-05-09)
### :star: New Features
* auto installation for standalone ([2b0dc09](https://github.com/kazupon/vue-i18n/commit/2b0dc09))
<a name="3.1.0"></a>

@@ -2,0 +12,0 @@ # [3.1.0](https://github.com/kazupon/vue-i18n/compare/v3.0.0...v3.1.0) (2016-05-09)

8

dist/vue-i18n.common.js
/*!
* vue-i18n v3.1.0
* vue-i18n v3.1.1
* (c) 2016 kazuya kawaguchi

@@ -852,4 +852,8 @@ * Released under the MIT License.

plugin.version = '3.1.0';
plugin.version = '3.1.1';
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
}
module.exports = plugin;
/*!
* vue-i18n v3.1.0
* vue-i18n v3.1.1
* (c) 2016 kazuya kawaguchi

@@ -856,6 +856,10 @@ * Released under the MIT License.

plugin.version = '3.1.0';
plugin.version = '3.1.1';
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin);
}
return plugin;
}));
/*!
* vue-i18n v3.1.0
* vue-i18n v3.1.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(n,t){return j.call(n,t)}function e(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(m.Vue.util.isPlainObject(n))for(var e in n)if(t(n,e))return!1;return!0}function r(n){if(!A){var t=n.$watch("__watcher__",function(n){});A=n._watchers[0].constructor,t()}return A}function o(n){return O||(O=n._data.__ob__.dep.constructor),O}function i(n){return n&&"function"==typeof n.then}function u(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 a(n){var t=$.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 c(n){function t(){var t=n[r+1];return o===I&&"'"===t||o===L&&'"'===t?(r++,l="\\"+t,h[P](),!0):void 0}var e=[],r=-1,o=C,i=0,c=void 0,l=void 0,f=void 0,s=void 0,v=void 0,d=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==f&&(e.push(f),f=void 0)},h[P]=function(){void 0===f?f=l:f+=l},h[S]=function(){h[P](),i++},h[U]=function(){if(i>0)i--,o=N,h[P]();else{if(i=0,f=a(f),f===!1)return!1;h[k]()}};null!=o;)if(r++,c=n[r],"\\"!==c||!t()){if(s=u(c),p=B[o],v=p[s]||p["else"]||Z,v===Z)return;if(o=v[0],d=h[v[1]],d&&(l=v[2],l=void 0===l?c:l,d()===!1))return;if(o===Q)return e.raw=n,e}}function l(n){var t=V[n];return t||(t=c(n),t&&(V[n]=t)),t}function f(n,t){var r=$.Vue.util.isObject;if(!r(n))return null;var o=l(t);if(e(o))return null;for(var i=null,u=n,a=o.length,c=0;a>c;){var f=u[o[c]];if(void 0===f){u=null;break}u=f,c++}return i=u}function s(t){t.locale=function(t,e,r){return void 0===e?D[t]:void(null===e?(D[t]=void 0,delete D[t]):v(t,e,function(e){e?(D[t]=e,r&&r()):n("failed set `"+t+"` locale")}))}}function v(n,t,e){var r=this;"object"===("undefined"==typeof t?"undefined":_["typeof"](t))?e(t):!function(){var n=t.call(r);"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()})}():i(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function d(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,i=o.$lang;i?this.$lang=i:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){p(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 p(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function h(n,t){function e(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),u.target&&e.depend(),e.value}}var i=r(t),u=o(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:e(function(){return t.lang},t),set:n.util.bind(function(n){t.lang=n},t)})}function y(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return 1===e.length&&"object"===_["typeof"](e[0])&&(e=e[0]),e&&e.hasOwnProperty||(e={}),n.replace(E,function(t,r,o,i){var u=void 0;return"{"===n[i-1]&&"}"===n[i+t.length]?o:(u=e.hasOwnProperty(o)?e[o]:null,null===u||void 0===u?"":u)})}function g(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;return 1===e.length?u(e[0])||i(e[0])?e=e[0]:"string"==typeof e[0]&&(o=e[0]):2===e.length&&("string"==typeof e[0]&&(o=e[0]),(u(e[1])||i(e[1]))&&(e=e[1])),{lang:o,params:e}}function e(n,t,e){if(!n)return null;var r=f(n,t)||n[t];return r?e?y(r,e):r:null}function r(n){return n}var o=n.util,i=o.isArray,u=o.isObject;return n.t=function(o){for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];if(!o)return"";var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(n.locale(l),o,f)||r(o)},n.prototype.$t=function(o){if(!o)return"";for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(this.$options.locales&&this.$options.locales[l],o,f)||e(n.locale(l),o,f)||r(o)},n}function w(n){var t=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],"en");$.Vue=m.Vue=n,b(n,t),s(n),d(n,F),h(n,F),g(n)}function b(n,t){var e=n.config.silent;n.config.silent=!0,F||(F=new n({data:{lang:t}})),n.config.silent=e}var _={};_["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 m={},j=Object.prototype.hasOwnProperty,A=void 0,O=void 0,$={},V=Object.create(null),P=0,k=1,S=2,U=3,C=0,q=1,x=2,z=3,N=4,I=5,L=6,Q=7,Z=8,B=[];B[C]={ws:[C],ident:[z,P],"[":[N],eof:[Q]},B[q]={ws:[q],".":[x],"[":[N],eof:[Q]},B[x]={ws:[x],ident:[z,P]},B[z]={ident:[z,P],0:[z,P],number:[z,P],ws:[q,k],".":[x,k],"[":[N,k],eof:[Q,k]},B[N]={"'":[I,P],'"':[L,P],"[":[N,S],"]":[q,U],eof:Z,"else":[N,P]},B[I]={"'":[N,P],eof:Z,"else":[I,P]},B[L]={'"':[N,P],eof:Z,"else":[L,P]};var D=Object.create(null),E=/(%|)\{([0-9a-zA-Z]+)\}/g,F=void 0;return w.version="3.1.0",w});
!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(n,t){return j.call(n,t)}function e(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(m.Vue.util.isPlainObject(n))for(var e in n)if(t(n,e))return!1;return!0}function r(n){if(!A){var t=n.$watch("__watcher__",function(n){});A=n._watchers[0].constructor,t()}return A}function o(n){return O||(O=n._data.__ob__.dep.constructor),O}function i(n){return n&&"function"==typeof n.then}function u(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 a(n){var t=$.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 c(n){function t(){var t=n[r+1];return o===I&&"'"===t||o===L&&'"'===t?(r++,l="\\"+t,h[P](),!0):void 0}var e=[],r=-1,o=C,i=0,c=void 0,l=void 0,f=void 0,s=void 0,d=void 0,v=void 0,p=void 0,h=[];for(h[k]=function(){void 0!==f&&(e.push(f),f=void 0)},h[P]=function(){void 0===f?f=l:f+=l},h[S]=function(){h[P](),i++},h[U]=function(){if(i>0)i--,o=N,h[P]();else{if(i=0,f=a(f),f===!1)return!1;h[k]()}};null!=o;)if(r++,c=n[r],"\\"!==c||!t()){if(s=u(c),p=B[o],d=p[s]||p["else"]||Z,d===Z)return;if(o=d[0],v=h[d[1]],v&&(l=d[2],l=void 0===l?c:l,v()===!1))return;if(o===Q)return e.raw=n,e}}function l(n){var t=V[n];return t||(t=c(n),t&&(V[n]=t)),t}function f(n,t){var r=$.Vue.util.isObject;if(!r(n))return null;var o=l(t);if(e(o))return null;for(var i=null,u=n,a=o.length,c=0;a>c;){var f=u[o[c]];if(void 0===f){u=null;break}u=f,c++}return i=u}function s(t){t.locale=function(t,e,r){return void 0===e?D[t]:void(null===e?(D[t]=void 0,delete D[t]):d(t,e,function(e){e?(D[t]=e,r&&r()):n("failed set `"+t+"` locale")}))}}function d(n,t,e){var r=this;"object"===("undefined"==typeof t?"undefined":_["typeof"](t))?e(t):!function(){var n=t.call(r);"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()})}():i(n)&&n.then(function(n){e(n)},function(){e()})["catch"](function(n){console.error(n),e()})}()}function v(n,t){var e=n.prototype._init;n.prototype._init=function(n){var r=this;n=n||{};var o=n._parent||n.parent||this,i=o.$lang;i?this.$lang=i:this.$lang=t,this._langUnwatch=this.$lang.$watch("lang",function(n,t){p(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 p(n){for(var t=n._watchers.length;t--;)n._watchers[t].update(!0)}function h(n,t){function e(n,t){var e=new i(t,n,null,{lazy:!0});return function(){return e.dirty&&e.evaluate(),u.target&&e.depend(),e.value}}var i=r(t),u=o(t);Object.defineProperty(n.config,"lang",{enumerable:!0,configurable:!0,get:e(function(){return t.lang},t),set:n.util.bind(function(n){t.lang=n},t)})}function y(n){for(var t=arguments.length,e=Array(t>1?t-1:0),r=1;t>r;r++)e[r-1]=arguments[r];return 1===e.length&&"object"===_["typeof"](e[0])&&(e=e[0]),e&&e.hasOwnProperty||(e={}),n.replace(E,function(t,r,o,i){var u=void 0;return"{"===n[i-1]&&"}"===n[i+t.length]?o:(u=e.hasOwnProperty(o)?e[o]:null,null===u||void 0===u?"":u)})}function g(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;return 1===e.length?u(e[0])||i(e[0])?e=e[0]:"string"==typeof e[0]&&(o=e[0]):2===e.length&&("string"==typeof e[0]&&(o=e[0]),(u(e[1])||i(e[1]))&&(e=e[1])),{lang:o,params:e}}function e(n,t,e){if(!n)return null;var r=f(n,t)||n[t];return r?e?y(r,e):r:null}function r(n){return n}var o=n.util,i=o.isArray,u=o.isObject;return n.t=function(o){for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];if(!o)return"";var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(n.locale(l),o,f)||r(o)},n.prototype.$t=function(o){if(!o)return"";for(var i=arguments.length,u=Array(i>1?i-1:0),a=1;i>a;a++)u[a-1]=arguments[a];var c=t.apply(void 0,u),l=c.lang,f=c.params;return e(this.$options.locales&&this.$options.locales[l],o,f)||e(n.locale(l),o,f)||r(o)},n}function w(n){var t=(arguments.length<=1||void 0===arguments[1]?{}:arguments[1],"en");$.Vue=m.Vue=n,b(n,t),s(n),v(n,F),h(n,F),g(n)}function b(n,t){var e=n.config.silent;n.config.silent=!0,F||(F=new n({data:{lang:t}})),n.config.silent=e}var _={};_["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 m={},j=Object.prototype.hasOwnProperty,A=void 0,O=void 0,$={},V=Object.create(null),P=0,k=1,S=2,U=3,C=0,q=1,x=2,z=3,N=4,I=5,L=6,Q=7,Z=8,B=[];B[C]={ws:[C],ident:[z,P],"[":[N],eof:[Q]},B[q]={ws:[q],".":[x],"[":[N],eof:[Q]},B[x]={ws:[x],ident:[z,P]},B[z]={ident:[z,P],0:[z,P],number:[z,P],ws:[q,k],".":[x,k],"[":[N,k],eof:[Q,k]},B[N]={"'":[I,P],'"':[L,P],"[":[N,S],"]":[q,U],eof:Z,"else":[N,P]},B[I]={"'":[N,P],eof:Z,"else":[I,P]},B[L]={'"':[N,P],eof:Z,"else":[L,P]};var D=Object.create(null),E=/(%|)\{([0-9a-zA-Z]+)\}/g,F=void 0;return w.version="3.1.1","undefined"!=typeof window&&window.Vue&&window.Vue.use(w),w});
{
"name": "vue-i18n",
"description": "Internationalization plugin for Vue.js",
"version": "3.1.0",
"version": "3.1.1",
"author": {

@@ -6,0 +6,0 @@ "name": "kazuya kawaguchi",

@@ -22,3 +22,3 @@ # vue-i18n

```html
<script src="https://cdn.jsdelivr.net/vue.i18n/3.1.0/vue-i18n.min.js"></script>
<script src="https://cdn.jsdelivr.net/vue.i18n/3.1.1/vue-i18n.min.js"></script>
```

@@ -28,6 +28,13 @@

```shell
$ npm install vue-i18n
```
### stable version
$ npm install vue-i18n
### development version
$ git clone https://github.com/kazupon/vue-i18n node_modules/vue-i18n
$ cd node_modules/vue-i18n
$ npm install
$ npm run build
When used in CommonJS, you must explicitly install the router via Vue.use():

@@ -46,2 +53,4 @@

You don't need to do this when using the standalone build, as it installs itself automatically.
# Usage

@@ -68,17 +77,9 @@

// install plugin
// DEPRECATED:
// `options` arguments, please use `Vue.config.lang` and `Vue.locale`.
// 3.1 or later, not used `options` arguments!!
Vue.use(VueI18n/*, {
lang: 'ja',
locales: locales
}*/)
Vue.use(VueI18n)
// set lang
// RECOMMEND: 3.0 or later
Vue.config.lang = 'ja'
// set locales
// RECOMMEND: 3.0 or later
Object.keys(locales).forEach(function (lang) {

@@ -417,34 +418,2 @@ Vue.locale(lang, locales[lang])

# Options
> NOTE: Deprecated in 3.1 or later :warning:
## Plugin options
```javascript
Vue.use(plugin, {
lang: 'en',
locales: {
en: {
...
},
...
ja: {
...
}
}
})
```
### lang
Specify translate the language code.
If you abbreviated the `lang` option, translate as well as 'en' language code option (default: 'en').
### locales
Specify translate some local dictionary.
If you abbreviated the `locales` option, set the empty local dictionary.
# Contributing

@@ -451,0 +420,0 @@ - Fork it !

@@ -54,4 +54,8 @@ import util, { warn } from './util'

plugin.version = '3.1.0'
plugin.version = '3.1.1'
export default plugin
if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(plugin)
}
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