Closed grn-dk closed 4 months ago
can you share your .php
translation file?
looks like something related with that
@xiCO2k thank you for the hint!
I don't have a .php
translation file. I just wanted to use SSR (Server Side Rendering) (https://github.com/xiCO2k/laravel-vue-i18n?tab=readme-ov-file#ssr-server-side-rendering).
I followed the guide here: https://laraveldaily.com/post/laravel-and-vuejs-translations-with-i18n-plugin and it advises to add import of the plugin in vite.config.js
- but the vue translation works without the vite.config.js import.
I have this in my resources/js/app.js
which specifies that I have the language files in lang
folder.
.use(i18nVue, {
resolve: async lang => {
const langs = import.meta.glob('../../lang/*.json');
return await langs[`../../lang/${lang}.json`]();
}
})
But this is a bit different from the github documentation that is not using async
loading.
I will close this issue, because it has been resolved. Thank you.
thanks 👍
In a laravel vite vue project I installed laravel-vue-i18n with
npm i laravel-vue-i18n
.When starting the development server using the command npm run dev, an error occurred:
The problem is in the vite.config.js when i add
i18n()
in the plugins section:Any hints, tricks, or tips? Thank you.