If you are using a fixed set of localization files, you can use Webpack's Hot Module Replacement (HMR) to update the VueI18n instance without a full page reload. Use module.hot.accept to watch specific files and call i18n.setLocaleMessage with the newly required content.
import Vue from "vue"
import VueI18n from "vue-i18n"
import en from './en'
import ja from './ja'
const messages = {
en,
ja
}
// VueI18n instance
const i18n = new VueI18n({
locale: 'en',
messages
})
// Run app
const app = new Vue({
i18n,
// ...
}).$mount('#app')
// Hot updates
if (module.hot) {
module.hot.accept(['./en', './ja'], function () {
i18n.setLocaleMessage('en', require('./en').default)
i18n.setLocaleMessage('ja', require('./ja').default)
// Or the following hot updates via $i18n property
// app.$i18n.setLocaleMessage('en', require('./en').default)
// app.$i18n.setLocaleMessage('ja', require('./ja').default)
})
}