martinlindhe/laravel-vue-i18n-generator

Release 0.1.42 breaks --multi flag

osuwariboy opened this issue · 9 comments

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.

f546c3f#diff-d93779d34fe1a4dd918ebed442a5d770

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

:( did I get the switches mixed around?

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

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

We will revert this patch for now.

lk77 commented

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.

@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