diff --git a/resources/js/app.ts b/resources/js/app.ts index adee5ccb..bd7d8e45 100644 --- a/resources/js/app.ts +++ b/resources/js/app.ts @@ -2,7 +2,7 @@ import './bootstrap'; import { createStore } from './store'; import Vue, {createApp, h} from 'vue'; import {createInertiaApp} from '@inertiajs/inertia-vue3'; -import i18nMessages, { I18nMessages } from './lib/i18n'; +import getI18nMessages, { I18nMessages } from './lib/i18n'; import {createI18n} from 'vue-banana-i18n' import bubble from './lib/bubble'; import Error from './Pages/Error.vue'; @@ -10,18 +10,13 @@ import Layout from './Pages/Layout.vue'; Vue.use(bubble); -// Retrieve i18n messages and setup the Vue instance to handle them. -async function setupI18n(locale: string): Promise{ - return await i18nMessages(locale); -} - // Only bootstrap inertia if setup is successful. Display generic error // component otherwise (async () => { try { const store = createStore(); const locale = document.documentElement.lang; - const i18nMessages = await setupI18n(locale); + const i18nMessages = await getI18nMessages(locale); const i18nPlugin = createI18n({ locale: locale, messages: i18nMessages