fix for aliases

pull/975/head
Gleb 2 years ago committed by glebmalcev
parent 9e2ea40380
commit 4f6acec017
  1. 8
      errors.go

@ -260,15 +260,19 @@ func (fe *fieldError) Error() string {
// NOTE: if no registered translation can be found, it returns the original
// untranslated error message.
func (fe *fieldError) Translate(ut ut.Translator) string {
var fn TranslationFunc
m, ok := fe.v.transTagFunc[ut]
if !ok {
return fe.Error()
}
fn, ok := m[fe.tag]
fn, ok = m[fe.tag]
if !ok {
return fe.Error()
fn, ok = m[fe.actualTag]
if !ok {
return fe.Error()
}
}
return fn(ut, fe)

Loading…
Cancel
Save