2022-11-29 14:40:19 +01:00
|
|
|
export default async ({ app, store, res, $vuetify }) => {
|
2019-04-03 00:25:12 +02:00
|
|
|
|
2022-11-29 14:40:19 +01:00
|
|
|
$vuetify.lang.current = app.i18n.locale
|
2019-04-03 00:25:12 +02:00
|
|
|
|
2022-11-29 14:40:19 +01:00
|
|
|
app.i18n.onLanguageSwitched = (oldLocale, newLocale) => {
|
|
|
|
$vuetify.lang.current = newLocale
|
2019-09-19 16:23:46 +02:00
|
|
|
}
|
|
|
|
|
2022-11-29 14:40:19 +01:00
|
|
|
// const messages = {}
|
|
|
|
// if (process.server) {
|
|
|
|
// if (res.locals) {
|
|
|
|
// store.commit('setLocale', res.locals.acceptedLocale)
|
|
|
|
// if (res.locals.user_locale) {
|
|
|
|
// store.commit('setUserLocale', res.locals.user_locale)
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// messages[store.state.locale] = await import(/* webpackChunkName: "lang-[request]" */`../locales/${store.state.locale}.json`)
|
2020-02-20 18:37:10 +01:00
|
|
|
|
|
|
|
// always include en fallback locale
|
2022-11-29 14:40:19 +01:00
|
|
|
// if (store.state.locale !== 'en') {
|
|
|
|
// messages.en = await import('../locales/en.json')
|
|
|
|
// }
|
2020-02-20 18:37:10 +01:00
|
|
|
|
2022-11-29 14:40:19 +01:00
|
|
|
// if (store.state.user_locale) {
|
|
|
|
// merge(messages[store.state.locale], store.state.user_locale)
|
|
|
|
// }
|
2019-07-26 23:51:32 +02:00
|
|
|
|
2019-09-19 16:23:46 +02:00
|
|
|
// Set i18n instance on app
|
2022-11-29 14:40:19 +01:00
|
|
|
// app.i18n = new VueI18n({
|
|
|
|
// locale: store.state.locale,
|
|
|
|
// fallbackLocale: 'en',
|
|
|
|
// messages
|
|
|
|
// })
|
2019-04-03 00:25:12 +02:00
|
|
|
}
|