forked from zhurui/management
6 lines
23 KiB
JavaScript
6 lines
23 KiB
JavaScript
|
/*!
|
||
|
* vue-i18n v8.14.0
|
||
|
* (c) 2019 kazuya kawaguchi
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
var t,e;t=this,e=function(){"use strict";var t=["style","currency","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","localeMatcher","formatMatcher"];function e(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}function n(t){return null!==t&&"object"==typeof t}var r=Object.prototype.toString,i="[object Object]";function a(t){return r.call(t)===i}function s(t){return null==t}function o(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=null,i=null;return 1===t.length?n(t[0])||Array.isArray(t[0])?i=t[0]:"string"==typeof t[0]&&(r=t[0]):2===t.length&&("string"==typeof t[0]&&(r=t[0]),(n(t[1])||Array.isArray(t[1]))&&(i=t[1])),{locale:r,params:i}}function l(t){return JSON.parse(JSON.stringify(t))}var c=Object.prototype.hasOwnProperty;function u(t,e){return c.call(t,e)}function f(t){for(var e=arguments,r=Object(t),i=1;i<arguments.length;i++){var a=e[i];if(null!=a){var s=void 0;for(s in a)u(a,s)&&(n(a[s])?r[s]=f(r[s],a[s]):r[s]=a[s])}}return r}function h(t,e){if(t===e)return!0;var r=n(t),i=n(e);if(!r||!i)return!r&&!i&&String(t)===String(e);try{var a=Array.isArray(t),s=Array.isArray(e);if(a&&s)return t.length===e.length&&t.every(function(t,n){return h(t,e[n])});if(a||s)return!1;var o=Object.keys(t),l=Object.keys(e);return o.length===l.length&&o.every(function(n){return h(t[n],e[n])})}catch(t){return!1}}var p={beforeCreate:function(){var t=this.$options;if(t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n){if(t.i18n instanceof Q){if(t.__i18n)try{var e={};t.__i18n.forEach(function(t){e=f(e,JSON.parse(t))}),Object.keys(e).forEach(function(n){t.i18n.mergeLocaleMessage(n,e[n])})}catch(t){}this._i18n=t.i18n,this._i18nWatcher=this._i18n.watchI18nData()}else if(a(t.i18n)){if(this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q&&(t.i18n.root=this.$root,t.i18n.formatter=this.$root.$i18n.formatter,t.i18n.fallbackLocale=this.$root.$i18n.fallbackLocale,t.i18n.formatFallbackMessages=this.$root.$i18n.formatFallbackMessages,t.i18n.silentTranslationWarn=this.$root.$i18n.silentTranslationWarn,t.i18n.silentFallbackWarn=this.$root.$i18n.silentFallbackWarn,t.i18n.pluralizationRules=this.$root.$i18n.pluralizationRules,t.i18n.preserveDirectiveContent=this.$root.$i18n.preserveDirectiveContent),t.__i18n)try{var n={};t.__i18n.forEach(function(t){n=f(n,JSON.parse(t))}),t.i18n.messages=n}catch(t){}var r=t.i18n.sharedMessages;r&&a(r)&&(t.i18n.messages=f(t.i18n.messages,r)),this._i18n=new Q(t.i18n),this._i18nWatcher=this._i18n.watchI18nData(),(void 0===t.i18n.sync||t.i18n.sync)&&(this._localeWatcher=this.$i18n.watchLocale())}}else this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?this._i18n=this.$root.$i18n:t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n=t.parent.$i18n)},beforeMount:function(){var t=this.$options;t.i18n=t.i18n||(t.__i18n?{}:null),t.i18n?t.i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):a(t.i18n)&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0):this.$root&&this.$root.$i18n&&this.$root.$i18n instanceof Q?(this._i18n.subscribeDataChanging(this),this._subscribing=!0):t.parent&&t.parent.$i18n&&t.parent.$i18n instanceof Q&&(this._i18n.subscribeDataChanging(this),this._subscribing=!0)},beforeDestroy:function(){if(this._i18n){var t=this;this.$nextTick(function(){t._subscribing&&(t._i18n.unsubscribeDataChanging(t),delete t._subscribing),t._i18nWatcher&&(t._i18nWatcher(),t._i18n.destroyVM(),delete t._i18nWatcher),t._localeWatcher&&(t._localeWatcher(),delete t._localeWatcher),t._i18n=null})}}},m={name:"i18n",functional:!0,props:{tag:{type:String},path:{type:String,required:!0},locale:{type:String},places:{type:[Array,Object]}},render:function(t,e){var n=e.data,r=e.parent,i=e.props,a=e.slots,s=r.$i18n;if(s){var o=i.path,l=i.locale,c=i.places,u=a(),f=s.i(o,l,function(t){var e;for(e in t)if("default"!==e)return!1;return Boolean(e)}(u)||c?function(t,e){var n=e?function(t){return Array.isArray(t)?t.reduce(_,{}):Object.assign({},t
|