How can one get localized custom error messages? #3729
Replies: 1 comment 1 reply
-
In v4, vee-validate was re-worked to include 3rd party validation support without the need for global registration. That meant that vee-validate could no longer have special treatment for individual rules.
Because the composition API didn't exist before, which means that features that was very hard to implement like interaction modes was no longer required to be built-in. I realize this is easily said than done especially when there is no migration guide or examples on the missing features. I will try to add what I can to the current docs. at the moment there is no straightforward way to do this at the field level, you may consider using the i18n dictionary API to achieve this but you need to call it in your |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In version 3 you could get a custom message for each specific validation rule error for a specific field with:
However, there seems to be no option for doing this on
<Field />
or on<ErrorMessage />
. I also cannot get this working without writing some very dodgy code because<Form />
,<Field />
and<ErrorMessage />
do not return any reference to the rule that the current error is stemming from.It seems very strange to me that (1.) this feature is not replicated in v4 and (2.) that
<Field />
and<ErrorMessage />
doesn't reference the errors' originating rule. I'm not sure why vee-validate v4 has gotten rid of so many features that made previous versions so easy/powerful to use (for another examplemode="eager|lazy|etc"
).Beta Was this translation helpful? Give feedback.
All reactions