Fix error thrown on i18n setup

This commit is contained in:
Bubka 2023-09-22 17:14:00 +02:00
parent f6484bd73d
commit a57baa9de9

View File

@ -26,10 +26,13 @@ app.config.globalProperties.$2fauth = {
app.use(createPinia()) app.use(createPinia())
app.use(router) app.use(router)
app.use(i18nVue, { app.use(i18nVue, {
lang: document.documentElement.lang.substring(0, 2),
resolve: async lang => { resolve: async lang => {
const langs = import.meta.glob('../lang/*.json'); const langs = import.meta.glob('../lang/*.json');
if (lang.includes('php_')) {
return await langs[`../lang/${lang}.json`](); return await langs[`../lang/${lang}.json`]();
} }
}
}) })
app.use(Notifications) app.use(Notifications)
app app