martinlindhe / laravel-vue-i18n-generator

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

vue-i18n-locales.generated.js empty #41

Closed eduardor2k closed 6 years ago

eduardor2k commented 6 years ago

Hi, when i run the command: php artisan vue-i18n:generate The file vue-i18n-locales.generated.js only contains export default

martinlindhe commented 6 years ago

That's strange. It should process your laravel translations, perhaps you haven't created any yet?

eduardor2k commented 6 years ago

Hi, I've found the cause of error. Some malformed language files, instead of being encoded in utf-8 it was encoded in ISO-8859-1

See #43

Now i get:

root@1f38f50e1ebf:/var/www# php artisan vue-i18n:generate
In Generator.php line 73:                                           
  Could not generate JSON file, error code 5
martinlindhe commented 6 years ago

You should try to analyse what is wrong with the json file using a json validator and fix the issues with it.

laravel-vue-i18n-validator expects well-formed input json to work. There are some online tools and some offline ones.

Like https://jsonlint.com/

I made one in go: https://github.com/martinlindhe/validjson

eduardor2k commented 6 years ago

I'm using PhpStorm, just browsing each file, PhpStorm told me that i was reading a file with the wrong encoding, thank god i had only 20 language files.

Thanks for the tip!