move to nuxt-i18n, switch language,address #171

This commit is contained in:
lesion
2022-10-12 12:45:09 +02:00
parent 33084237e9
commit 2cb4359ffd
13 changed files with 59 additions and 48 deletions

View File

@@ -63,13 +63,6 @@ module.exports = {
})
},
async setUserLocale(req, res, next) {
// select locale based on cookie? and accept-language header
acceptLanguage.languages(Object.keys(locales))
res.locals.acceptedLocale = acceptLanguage.get(req.headers['accept-language'])
dayjs.locale(res.locals.acceptedLocale)
next()
},
async initSettings(_req, res, next) {
// initialize settings