xiCO2k / laravel-vue-i18n

Allows to connect your `Laravel` Framework translation files with `Vue`.
MIT License
598 stars 49 forks source link

Generate translations when using vite #48

Closed ahuininga closed 2 years ago

ahuininga commented 2 years ago

Hi,

I'm using a new Laravel Jetstream application and am using vite. I've followed the readme, but the language json files aren't generated when running 'npm run build' (or npm run dev)

Which command should I run to generate the language json files?

xiCO2k commented 2 years ago

Hey @ahuininga, can you show me your vite.config.js file and your app.js file.

Thanks.

andrey-helldar commented 2 years ago

@ahuininga, you can also use the publisher.laravel-lang.com

ahuininga commented 2 years ago

Vite config

https://github.com/ahuininga/mountain/blob/cd6d01a20e5f9e353efbf55a3bf31be350078e2e/vite.config.js#L1

App.js

https://github.com/ahuininga/mountain/blob/cd6d01a20e5f9e353efbf55a3bf31be350078e2e/resources/js/app.js#L1

xiCO2k commented 2 years ago

Thanks, will debug that.

xiCO2k commented 2 years ago

Hey @ahuininga, after debugging, looks like you are using the SSR Implementation and that is nothing wrong with that, but there will be no .json files generated.

You can use this https://github.com/xiCO2k/laravel-vue-i18n#with-vite with the glob instead of globEager.

Thanks.