locale via config
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import Vue from 'vue'
|
||||
import moment from 'dayjs'
|
||||
import 'dayjs/locale/it'
|
||||
moment.locale('it')
|
||||
moment.locale(process.env.locale)
|
||||
|
||||
function short_hour(datetime) {
|
||||
if (datetime.minute() === 0) {
|
||||
|
||||
@@ -8,18 +8,10 @@ export default ({ app, store }) => {
|
||||
// Set i18n instance on app
|
||||
// This way we can use it in middleware and pages asyncData/fetch
|
||||
app.i18n = new VueI18n({
|
||||
locale: store.state.locale,
|
||||
fallbackLocale: 'it',
|
||||
locale: process.env.locale,
|
||||
fallbackLocale: process.env.locale,
|
||||
messages: {
|
||||
it
|
||||
}
|
||||
})
|
||||
|
||||
// app.i18n.path = (link) => {
|
||||
// if (app.i18n.locale === app.i18n.fallbackLocale) {
|
||||
// return `/${link}`
|
||||
// }
|
||||
|
||||
// return `/${app.i18n.locale}/${link}`
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user