code optimization: removed en.json import as it is to heavy
This commit is contained in:
@ -1,24 +1,31 @@
|
||||
import Vue from 'vue'
|
||||
import VueI18n from 'vue-i18n'
|
||||
import * as en from 'locales/en.json'
|
||||
import axios from 'axios'
|
||||
// do not preload language files as they are to weight
|
||||
// import * as en from 'locales/en.json'
|
||||
// import * as fr from 'locales/fr.json'
|
||||
import axios from 'axios'
|
||||
|
||||
Vue.use(VueI18n)
|
||||
|
||||
const messages = {
|
||||
en: {
|
||||
...en.default
|
||||
}
|
||||
}
|
||||
// const messages = {
|
||||
// en: {
|
||||
// // ...en.default
|
||||
// },
|
||||
// fr: {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
export const i18n = new VueI18n({
|
||||
locale: 'en',
|
||||
fallbackLocale: 'en',
|
||||
messages
|
||||
})
|
||||
// export const i18n = new VueI18n({
|
||||
// locale: 'en',
|
||||
// fallbackLocale: 'en',
|
||||
// messages
|
||||
// })
|
||||
|
||||
const loadedLanguages = ['en'] // our default language that is preloaded
|
||||
export const i18n = new VueI18n()
|
||||
|
||||
// const loadedLanguages = ['en'] // our default language that is preloaded
|
||||
const loadedLanguages = [] // our default language that is preloaded
|
||||
|
||||
function setI18nLanguage (lang) {
|
||||
i18n.locale = lang
|
||||
|
Reference in New Issue
Block a user