Nuxt/examples/vue-i18n/middleware/i18n.js

6 lines
175 B
JavaScript
Raw Normal View History

export default function ({ app, store, params, error }) {
const locale = params.lang || 'en-US'
store.commit('SET_LANG', locale)
app.$i18n.locale = store.state.locale
}