laravel-vue-i18n-generator icon indicating copy to clipboard operation
laravel-vue-i18n-generator copied to clipboard

Fix locale association

Open jimping opened this issue 4 years ago • 0 comments

When using multiple locales with e.g. a_locale.json files and folders with php files a_locale/errors.php then the translations were mixed in the wrong files because of a wrong "lastLocale" variable. The locale will now be determined by the given file path. That results to the correct association.

In my example translations from de and en had been merged to fr.js. With this patch it correct.

E.g. with:

resources/lang/{de|fr|en|pl|es}.json AND resources/lang/{de|fr|en|pl|es}/errors.php resources/lang/{de|fr|en|pl|es}/fields.php etc.

and Command:

php artisan vue-i18n:generate --multi-locales

jimping avatar Mar 23 '20 10:03 jimping