feat: localizations
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
+8
-1
@@ -7,6 +7,8 @@ import { PerfectScrollbarPlugin } from 'vue3-perfect-scrollbar'
|
||||
import { useModuleStore } from '@KTXC/stores/moduleStore'
|
||||
import { useTenantStore } from '@KTXC/stores/tenantStore'
|
||||
import { useUserStore } from '@KTXC/stores/userStore'
|
||||
import { useL10nStore } from '@KTXC/stores/l10nStore'
|
||||
import { i18n } from '@KTXC/l10n/runtime'
|
||||
import { fetchWrapper } from '@KTXC/utils/helpers/fetch-wrapper'
|
||||
import { FetchError } from '@KTXC/utils/helpers/fetch-wrapper-core'
|
||||
import { initializeModules } from '@KTXC/utils/modules'
|
||||
@@ -22,6 +24,7 @@ const app = createApp(App)
|
||||
const pinia = createPinia()
|
||||
app.use(pinia)
|
||||
app.use(PerfectScrollbarPlugin)
|
||||
app.use(i18n)
|
||||
app.use(vuetify)
|
||||
|
||||
const globalWindow = window as typeof window & {
|
||||
@@ -37,13 +40,17 @@ globalWindow.Pinia = PiniaLib as unknown
|
||||
const moduleStore = useModuleStore();
|
||||
const tenantStore = useTenantStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
const l10nStore = useL10nStore();
|
||||
|
||||
try {
|
||||
const payload = await fetchWrapper.get('/init');
|
||||
moduleStore.init(payload?.modules ?? {});
|
||||
tenantStore.init(payload?.tenant ?? null);
|
||||
userStore.init(payload?.user ?? {});
|
||||
|
||||
// Resolve locale and load catalogs before modules boot
|
||||
await l10nStore.init(payload?.l10n ?? null);
|
||||
|
||||
// Initialize auth session monitor
|
||||
const sessionMonitor = createSessionMonitor({ onLogout: () => userStore.logout() });
|
||||
sessionMonitor.start();
|
||||
|
||||
Reference in New Issue
Block a user