Bottelet / translation-checker

find translations you forgot to add to your language files, check, and maintain translations in yor Laravel application
MIT License
90 stars 6 forks source link

translations:find-missing removed all old entries #15

Open rabol opened 1 day ago

rabol commented 1 day ago

Hi

I have a en.json with 1330 lines, but after running:

php artisan translations:find-missing

the file only contains 26 lines and all empty strings

I would have expected the lines to be added :)

Bottelet commented 1 day ago

Hi @rabol

That would also be what is intended, not for it to remove current strings.

Is it a public repo, that I could check out? I'll see if I can reproduce it over the weekend.

rabol commented 1 day ago

Sorry, it's not a public repository, but I think it's okay to share the en.json file

I found another thing when executing the translations:sync ...

I have added the offending file aswell ...

Bottelet commented 1 day ago

Thanks, I've downloaded them if you wish to remove them again.

I edited your response so, it does not include the files. Just in-case.

rabol commented 1 day ago

ups... my mistake, the offending file is actually .DS_Store

maybe you should add a check in JsonLnaguageFileManager.php, readfile() method

Bottelet commented 1 day ago

Alright, so it all worked when you removed the .DS_Store?

Was the file located in your resources or lang folder?

rabol commented 1 day ago

i did not remove the .DS_Store file as that is a file that MacOS will create again.. I added a check in the JsonLanguageFileManager :)

Bottelet commented 1 day ago

Make sense. I'm just wondering, because .DS_Store file is located in root? And the checker should only be using lang/ and resources/ unless other is configured.

rabol commented 1 day ago

.DS_Stors is in all folders I think