Closed mila-rodriguez-netapp closed 3 months ago
v10
require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.19.0 )
The rfc3339 rule has no translation in english or spanish.
rfc3339
Type:
type Event struct { EventTime string `json:"eventTime" validate:"required,rfc3339"` }
Result:
"Key: 'Event.EventTime' Error:Field validation for 'EventTime' failed on the 'rfc3339' tag"
Tried with English translations:
v := validator.New() en := english.New() uni := ut.New(en, en) trans, _ := uni.GetTranslator("en") en_translations.RegisterDefaultTranslations(v, trans) event := Event{} err := validate.Struct(event) validationErrors := err.(validator.ValidationErrors) failures := validationErrors.Translate(trans)
Poked through the code and I don't see any in the spanish translations either. Probably missing across the board.
Package version eg. v9, v10:
v10
Issue, Question or Enhancement:
The
rfc3339
rule has no translation in english or spanish.Code sample, to showcase or reproduce:
Type:
Result:
Tried with English translations:
Poked through the code and I don't see any in the spanish translations either. Probably missing across the board.