Nuxt/examples/vue-i18n/middleware/i18n.js
2017-04-10 18:44:08 +02:00

6 lines
175 B
JavaScript

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