import { createI18n } from 'vue-i18n'
import ar from './locales/ar.json'
import cn from './locales/cn.json'
import de from './locales/de.json'
import en from './locales/en.json'
import es from './locales/es.json'
import fa from './locales/fa.json'
import id from './locales/id.json'
import ko from './locales/ko.json'
import ms from './locales/ms.json'
import pt from './locales/pt.json'
import th from './locales/th.json'
import tr from './locales/tr.json'
import vn from './locales/vn.json'
import zhHant from './locales/zhHant.json'

const messages = {
  ar,
  cn,
  de,
  en,
  es,
  fa,
  id,
  ko,
  ms,
  pt,
  th,
  tr,
  vn,
  zhHant,
}

function LocaleLanguage() {
  return 'en'
}

const i18n = createI18n({
  locale: LocaleLanguage(),
  fallbackLocale: import.meta.env.VITE_APP_I18N_FALLBACK_LOCALE || 'en',
  globalInjection: true,
  legacy: false,
  silentTranslationWarn: true,
  missingWarn: false,
  silentFallbackWarn: true,
  fallbackWarn: false,
  messages
})

export default i18n
