amiranagram / localizator

Scan your Laravel project and generate language files ready to translate in language(s) of choosing.
Other
226 stars 28 forks source link

Keep Laravel default language when using --remove-missing #46

Open Stevemoretz opened 1 year ago

Stevemoretz commented 1 year ago

Hi thanks for this package, it's pretty great.

Laravel comes with a bunch of messages used at core for validation, auth, pagination, and passwords, we can get a default set of languages using: https://github.com/Laravel-Lang/lang

if we use something like trans("validation.color") and then run

php artisan localize en --remove-missing

the validation.php file will be emptied, this probably can be solved using search.dirs in the config, any idea what the dirs should be? I don't think it would be as easy as that actually. for instance $this->translator->get was used at vendor/laravel/framework/src/Illuminate/Validation/Concerns/FormatsMessages.php

Anyways I think this should be supported by default maybe.

Stevemoretz commented 1 year ago

attributes in validation.php needs to be handled somehow for the other languages, like sync keys that are defined, same for custom in validation.php those are important.