Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

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

Closed
eduardor2k opened this issue Feb 7, 2018 · 4 comments
Closed

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

eduardor2k opened this issue Feb 7, 2018 · 4 comments

Comments

@eduardor2k
Copy link
Contributor

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

@martinlindhe
Copy link
Owner

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

@eduardor2k
Copy link
Contributor Author

eduardor2k commented Feb 10, 2018

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
Copy link
Owner

martinlindhe commented Feb 10, 2018

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
Copy link
Contributor Author

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants