How can I translate built-in validator messages? Is it possible? I need it in Polish...
Yes, it is possible. You need to overwrite the resources props in validators.
created() {
var res = VueFormGenerator.validators.resources;
res.textTooSmall = "T煤l r枚vid a sz枚veg!"
}
if you delete the password you will see the custom validator message
I did something like this yesterday and it was working, when I did it at the component level, but I don't know how to setup it once for the whole app (I have few forms in my app). This code should be placed at the created() method of the main App.vue component?
You can place this code everywhere after vfg imported. E.g. App.vue created or mounted. Example
Translations are working fine, thanks!
Now I have an issue with number validators :( Validators (nubmer, integer, double) uses lodash isNumber function, which evaluates to false if argument is type of string. Maybe I'm wrong, but value, which is returned from input is type of string and should be converted to number before validation? I tested it with field type='input' and inputType='number' / 'integer' / 'double' and always get 'Invalid number!'
https://lodash.com/docs/4.17.4#isNumber
@gkurdej please open a new issue about it and if you can please create a jsfiddle.
Most helpful comment
Yes, it is possible. You need to overwrite the resources props in validators.
Example fiddle