martinlindhe / laravel-vue-i18n-generator

Generates a vue-i18n compatible include file from your Laravel translations
MIT License
306 stars 207 forks source link

Release 0.1.42 breaks --multi flag #99

Closed osuwariboy closed 4 years ago

osuwariboy commented 4 years ago

Previously, when I ran the command php artisan vue-i18n:generate --multi I'd end up with one js file per Laravel language file I had (which, in my case, is one file per page). Now however, the generator generates only two files (en.js and fr.js) which is what the --multi-locales option should do unless I misread the documentation.

This might be due to the fact that generateMultiple function changed. It went from:

foreach ($this->filesToCreate as $fileName => $data) {

to this:

foreach ($locales as $fileName => $data) {

And that's just one of the many changes that lead me to this conclusion. In fact, if you check the diff (link below), it's like the --multi flag was completely removed from the generator, only keeping the --multi-locale flag.

https://github.com/martinlindhe/laravel-vue-i18n-generator/commit/f546c3f520d085f508b73933000da95ad528e1f1#diff-d93779d34fe1a4dd918ebed442a5d770

martinlindhe commented 4 years ago

@murrant

martinlindhe commented 4 years ago

This was part of a refactor, we should resolve it. Meanwhile please stick to an older version

murrant commented 4 years ago

:( did I get the switches mixed around?

murrant commented 4 years ago

Is there any way we could get a test case for the expected behavior?

osuwariboy commented 4 years ago

I don't really know, but the diff makes it look like the switch was completely removed altogether

martinlindhe commented 4 years ago

We will revert this patch for now.

martinlindhe commented 4 years ago

https://github.com/martinlindhe/laravel-vue-i18n-generator/commit/79789166462da1b9e8cf899c772bd907cc902a70

lk77 commented 4 years ago

Hello,

since the revert our translation system does not work anymore, we should have one file per locale, and it's not the case anymore. When having a folder for a locale, and a json file for that locale, at the same time, the translation file is not generated. do you have any tips how to solve this ?

thanks.

murrant commented 4 years ago

@lk77 I'm working on re-coding this, but first I had to fix tests because they were inadequate.

For now you can specifically use version 0.1.42