You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote custom validator tag as shown below and it works fine. However, I couldn't find a way/example to add a custom translator to go with it so as a result the error message reads as Key: 'Item.founded_at' Error:Field validation for 'founded_at' failed on the 'iso_8601_date' tag when I use err.Translate(universal.Translator). How can I add custom translator for it? Any example or a link to it would be nice. All I want to use is {0} must be in valid ISO8601 date format. I looked into val.RegisterTranslation but cannot get my head around with the third and fourth arguments.
Hi,
I wrote custom validator tag as shown below and it works fine. However, I couldn't find a way/example to add a custom translator to go with it so as a result the error message reads as
Key: 'Item.founded_at' Error:Field validation for 'founded_at' failed on the 'iso_8601_date' tag
when I useerr.Translate(universal.Translator)
. How can I add custom translator for it? Any example or a link to it would be nice. All I want to use is{0} must be in valid ISO8601 date format
. I looked intoval.RegisterTranslation
but cannot get my head around with the third and fourth arguments.Thanks
Package version eg. v8, v9:
v9
Issue, Question or Enhancement:
Question
Code sample, to showcase or reproduce:
The text was updated successfully, but these errors were encountered: