feat(i18n): integrate i18next-vue plugin
This commit is contained in:
+10
-4
@@ -1,7 +1,8 @@
|
||||
import { createInertiaApp } from '@inertiajs/vue3';
|
||||
import { DefineComponent } from 'vue';
|
||||
import I18NextVue from 'i18next-vue';
|
||||
import type { DefineComponent } from 'vue';
|
||||
import i18next from './lang/init';
|
||||
import Layout from './layouts/Layout.vue';
|
||||
import { init } from './lang/init.js';
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
||||
|
||||
@@ -31,7 +32,12 @@ createInertiaApp({
|
||||
|
||||
return pages[`./pages/${name}.vue`];
|
||||
},
|
||||
async withApp(app, options) {
|
||||
await init;
|
||||
withApp(app, options) {
|
||||
app.use(I18NextVue, {
|
||||
i18next,
|
||||
...options,
|
||||
});
|
||||
|
||||
return app;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user