somnambulist-tech / validation

A re-write of rakit/validation, a standalone validation library inspired by Laravel Validation
MIT License
44 stars 13 forks source link

Autoload i18n files when changing default language #15

Closed DeveloperMarius closed 1 year ago

DeveloperMarius commented 1 year ago

Hey,

I think it would be easier to load the i18n files when changing the default language. That way you don't have to do it by yourself.

~ Marius

dave-redfern commented 1 year ago

While I can see the attraction in this change the issue here is: any time you change the default language and a translation file in the library exists, any existing translations that are specific to your project will be overwritten by the library defaults.

That would be a poor developer experience and potentially cause all kinds of random issues.

As such I'm going to reject this; however: adding a method to the Factory class to easily load messages is a good idea so I will add that in the next release.

Thanks again for your continued interest and PRs to this project. I really appreciate your feedback and suggestions!

dave-redfern commented 1 year ago

@DeveloperMarius I have added a method to the Factory class that will allow easier loading of existing or alternative data. This is available in 1.6.0.

DeveloperMarius commented 1 year ago

Hey, I also though that my approach is not ideal, but more painless.

But a function is also great, thank you.

~ Marius