import Vue from 'vue'
import vuexI18n from 'vuex-i18n'
import VueCurrencyFilter from 'vue-currency-filter'

import store from '@/store'

import Locales from './vue-i18n-locales.generated'

Vue.use(vuexI18n.plugin, store)

Vue.i18n.add('en', Locales.en)
Vue.i18n.add('es', Locales.es)

const htmlTag = document.documentElement
let lang

if (htmlTag) {
  lang = htmlTag.lang
}

lang = 'es'

Vue.i18n.set(lang)

Vue.use(VueCurrencyFilter,
  {
    symbol: '$',
    thousandsSeparator: ',',
    fractionCount: 2,
    fractionSeparator: '.',
    symbolPosition: 'front',
    symbolSpacing: false
  })
