Commit cd95c7eb authored by les's avatar les

fixes #7, add es locale

parent b755f940
This diff is collapsed.
import it from './it'
import en from './en'
import es from './es'
export default {
it, en
it, en, es
}
......@@ -2,10 +2,10 @@ import acceptLanguage from 'accept-language'
export default function ({ req, app, store }) {
if (process.server) {
const acceptedLanguages = req.headers['accept-language']
const supportedLanguages = ['en', 'it']
const supportedLanguages = ['en', 'it', 'es']
acceptLanguage.languages(supportedLanguages)
const lang = acceptLanguage.get(acceptedLanguages)
store.commit('setLocale', lang || 'it')
store.commit('setLocale', lang || 'it')
app.i18n.locale = store.state.locale
}
}
......@@ -7,7 +7,8 @@ import locale from 'element-ui/lib/locale'
const locales = {
it: require('element-ui/lib/locale/lang/it'),
en: require('element-ui/lib/locale/lang/en')
en: require('element-ui/lib/locale/lang/en'),
es: require('element-ui/lib/locale/lang/es')
}
export default ({ app, store }) => {
......
import Vue from 'vue'
import moment from 'dayjs'
import 'dayjs/locale/it'
import 'dayjs/locale/es'
export default ({ app, store }) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment