import { createI18n } from 'vue-i18n'
import en from './en.json'
import es from './es.json'

const browserLang = 'pt' //avigator.language.split('-')[0]

const i18n = createI18n({
  legacy: false,
  locale: browserLang,
  fallbackLocale: 'en',
  missingWarn: false,
  fallbackWarn: false,
  messages: {
    en,
    es,
  },
})

export default i18n
const { t } = i18n.global
export { t, t as $t }
