From ee2e313ed850c2be60c24071850e41e2661827da Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 9 Mar 2023 13:12:59 +0100 Subject: [PATCH] fix(i18n): load language files before doing anything else Resolves #3214 --- src/main.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index 81f619106..c73e3e5fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,6 +39,10 @@ if (window.API_URL.slice(window.API_URL.length - 1, window.API_URL.length) === ' window.API_URL = window.API_URL.slice(0, window.API_URL.length - 1) } +// We're loading the language before creating the app so that it won't fail to load when the user's +// language file is not yet loaded. +await setLanguage() + const app = createApp(App) app.use(Notifications) @@ -107,6 +111,4 @@ app.use(pinia) app.use(router) app.use(i18n) -setLanguage().then(() => { - app.mount('#app') -}) \ No newline at end of file +app.mount('#app')