Closed tariksadiku-buckaroo closed 4 months ago
I believe you have the wrong resolve.
.use(i18nVue, {
resolve: async lang => {
const langs = import.meta.glob('../../lang/*.json');
return await langs[`../../lang/${lang}.json`]();
}
})
and also I would suggest having the <html lang="nl">
instead of window?.selectedLanguage
.
I am currently running into an issue where I can switch back and forth between EN and NL just fine, however, when I reload the page, I set the locale depending on the users session (using Sessions instead of API tokens). If my current session of the chosen language is NL, it seems to work great, however when I try to switch to EN, the page breaks, no configs are loaded.
Here is my vite config (I am running my Vue project inside a Package in my Laravel project).
i18n({ langPath: 'src/lang', }),
Here is my config for i18n.