import extend from './extend'


/**
 * plugin
 *
 * @param {Object} Vue
 * @param {Object} opts
 */

export default function (Vue, opts = { lang: 'en', locales: {} }) {
  defineConfig(Vue.config, opts.lang)
  extend(Vue, opts.locales)
}


/**
 * defineConfig
 *
 * This function define `lang` property to `Vue.config`.
 *
 * @param {Object} config
 * @param {String} lang
 * @private
 */

function defineConfig (config, lang) {
  Object.defineProperty(config, 'lang', {
    get: () => { return lang },
    set: (val) => { lang = val }
  })
}

@@ -36,14 +36,15 @@
 %0A * 
-plugin
+install
 %0A *%0A
@@ -119,16 +119,24 @@
 unction 
+install 
 (Vue, op
@@ -540,12 +540,127 @@
 al %7D%0A  %7D)%0A%7D%0A
+%0A%0A/**%0A * install automaticlly %0A */%0A%0Aif (typeof window !== 'undefined' && window.Vue) %7B%0A  window.Vue.use(install)%0A%7D%0A

support automatically install for standalone