Skip to content

Commit

Permalink
Remove unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
itamargiv committed Nov 9, 2023
1 parent 8a35aed commit 3fbcee5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions resources/js/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,21 @@ 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';
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<I18nMessages>{
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
Expand Down

0 comments on commit 3fbcee5

Please sign in to comment.