mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Merge pull request #3699 from modoboa/fix/vuetify_i18n
Enabled i18n support in vuetify
This commit is contained in:
@@ -7,6 +7,24 @@
|
||||
// Styles
|
||||
import '@mdi/font/css/materialdesignicons.css'
|
||||
import 'vuetify/styles'
|
||||
import {
|
||||
cs,
|
||||
de,
|
||||
el,
|
||||
en,
|
||||
es,
|
||||
fi,
|
||||
fr,
|
||||
it,
|
||||
ja,
|
||||
nl,
|
||||
pl,
|
||||
pt,
|
||||
ru,
|
||||
sv,
|
||||
tr,
|
||||
zhHans,
|
||||
} from 'vuetify/locale'
|
||||
|
||||
// Composables
|
||||
import { createVuetify } from 'vuetify'
|
||||
@@ -26,6 +44,28 @@ export default createVuetify({
|
||||
},
|
||||
},
|
||||
},
|
||||
locale: {
|
||||
locale: 'en',
|
||||
fallback: 'en',
|
||||
messages: {
|
||||
cs,
|
||||
de,
|
||||
el,
|
||||
en,
|
||||
es,
|
||||
fi,
|
||||
fr,
|
||||
it,
|
||||
ja,
|
||||
nl,
|
||||
pl,
|
||||
pt,
|
||||
ru,
|
||||
sv,
|
||||
tr,
|
||||
zhHans,
|
||||
},
|
||||
},
|
||||
styles: { configFile: 'src/styles/settings.scss' },
|
||||
defaults: {
|
||||
VCard: {
|
||||
|
||||
@@ -3,6 +3,7 @@ import Cookies from 'js-cookie'
|
||||
import { defineStore } from 'pinia'
|
||||
import { computed, inject, ref } from 'vue'
|
||||
import gettext from '@/plugins/gettext'
|
||||
import { useLocale } from 'vuetify'
|
||||
import router from '@/router/index.js'
|
||||
import { UserManager } from 'oidc-client-ts'
|
||||
|
||||
@@ -19,6 +20,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
const isAuthenticated = ref(false)
|
||||
let redirectUri = getAbsoluteUrl(config.OAUTH_REDIRECT_URI)
|
||||
let postLogoutRedirectUri = getAbsoluteUrl(config.OAUTH_POST_REDIRECT_URI)
|
||||
const { current } = useLocale()
|
||||
|
||||
const manager = new UserManager({
|
||||
authority: config.OAUTH_AUTHORITY_URL,
|
||||
@@ -48,11 +50,11 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
})
|
||||
|
||||
async function fetchUser() {
|
||||
return accountApi.getMe().then((resp) => {
|
||||
authUser.value = resp.data
|
||||
gettext.current = accountLanguage.value
|
||||
isAuthenticated.value = true
|
||||
})
|
||||
const resp = await accountApi.getMe()
|
||||
authUser.value = resp.data
|
||||
gettext.current = accountLanguage.value
|
||||
current.value = accountLanguage.value
|
||||
isAuthenticated.value = true
|
||||
}
|
||||
|
||||
async function getFidoCreds() {
|
||||
@@ -169,6 +171,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
authUser.value = { ...newAuthUser }
|
||||
if (accountLanguage.value in gettext.available) {
|
||||
gettext.current = accountLanguage.value
|
||||
current.value = accountLanguage.value
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user