locales: wait locales loading before mounting the vue app

This commit is contained in:
axolotle 2022-10-10 17:27:36 +02:00
parent e3cad1c2b3
commit 76895be395
2 changed files with 9 additions and 9 deletions

View file

@ -80,7 +80,7 @@ function initDefaultLocales () {
store.dispatch('UPDATE_LOCALE', locale) store.dispatch('UPDATE_LOCALE', locale)
store.dispatch('UPDATE_FALLBACKLOCALE', fallbackLocale || 'en') store.dispatch('UPDATE_FALLBACKLOCALE', fallbackLocale || 'en')
loadLocaleMessages('en') return loadLocaleMessages('en')
} }
export { export {

View file

@ -55,8 +55,7 @@ requireComponent.keys().forEach((fileName) => {
registerGlobalErrorHandlers() registerGlobalErrorHandlers()
// Load default locales translations files and setup store data // Load default locales translations files and setup store data
initDefaultLocales() initDefaultLocales().then(() => {
const app = new Vue({ const app = new Vue({
store, store,
router, router,
@ -65,3 +64,4 @@ const app = new Vue({
}) })
app.$mount('#app') app.$mount('#app')
})