Skip to content

Commit

Permalink
enable i18n for vuetify
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Oct 11, 2023
1 parent f2b61d3 commit da8cdb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function loadLocaleMessages() {
}

export default createI18n({
legacy: false,
locale: process.env.VUE_APP_I18N_LOCALE || navigator.language.split('-')[0] || 'en',
fallbackLocale: process.env.VUE_APP_I18N_FALLBACK_LOCALE || 'en',
messages: loadLocaleMessages(),
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { createVuetify } from 'vuetify';
import { aliases, fa } from 'vuetify/iconsets/fa'
import { VDataTable } from 'vuetify/labs/VDataTable'
import '@fortawesome/fontawesome-free/css/all.css'
import { createVueI18nAdapter } from 'vuetify/locale/adapters/vue-i18n'
import { useI18n } from 'vue-i18n'
import { i18n } from '../i18n.js'

import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
Expand Down Expand Up @@ -30,7 +33,10 @@ const vuetify = createVuetify({
}
}
}
}
},
locale: {
adapter: createVueI18nAdapter({ i18n, useI18n }),
},
})

export default vuetify;

0 comments on commit da8cdb8

Please sign in to comment.