mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
add i18n middlware
This commit is contained in:
parent
f9e0883eaf
commit
2402511cf3
1 changed files with 7 additions and 0 deletions
7
middleware/i18n.js
Normal file
7
middleware/i18n.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
export default function ({ req, app, store }) {
|
||||
if (process.server) {
|
||||
const lang = req.acceptsLanguages('en', 'it')
|
||||
store.commit('setLocale', lang || 'it')
|
||||
app.i18n.locale = store.state.locale
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue