feat(i18n): integrate i18next-vue plugin

This commit is contained in:
2026-08-01 21:36:09 +02:00
parent 7fb49131c4
commit 69f214ade3
5 changed files with 30 additions and 8 deletions
+10 -4
View File
@@ -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;
},
});
+3 -1
View File
@@ -1,7 +1,9 @@
import i18next from 'i18next';
import translations from './translations';
export const init = i18next.init({
await i18next.init({
lng: 'nl',
resources: translations,
});
export default i18next;