This plugin only comes with English messages to keep things small, but it was built with flexible message generation in mind.
The English messages file is an example on how you would structure those messages.
Then you may want to update the validator dictionary, which should happen once in your app startup. still you may update them whenever you want in any point of your app, review the custom messages here.
Here is a little code example on how would you add support for your localized messages. Note that this is the entry point of your application.
setLocale
method on the validator instance.
And you can also switch the language for all future validators (not created yet) via the setDefaultLocale
static method on the Validator class.
In the dist/locale
directory of this plugin, is a collection of localized files, mainly the English and The Arabic languages.
If you can't find your locale, you could help this plugin by contributing a localized version to the repo. I will happily accept it.