diff options
author | crohr <cyril.rohr@gmail.com> | 2015-07-14 15:09:08 +0000 |
---|---|---|
committer | crohr <cyril.rohr@gmail.com> | 2015-07-14 15:09:08 +0000 |
commit | cbce2ec9cf74a96b15bbd1a5463957921465a980 (patch) | |
tree | 48f08facd06aa9910c98cdcada1a73d8d308775c /modules/auth/auth.go | |
parent | b8e9c600409683b0f5eb10b637de003ce23b7796 (diff) | |
parent | ec774d48c58f83b599ac210d6def718187806ecd (diff) |
Merge remote-tracking branch 'origin/master' into pkgr
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r-- | modules/auth/auth.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/auth/auth.go b/modules/auth/auth.go index 5b24591a..edcb1306 100644 --- a/modules/auth/auth.go +++ b/modules/auth/auth.go @@ -208,7 +208,14 @@ func validate(errs binding.Errors, data map[string]interface{}, f Form, l macaro if errs[0].FieldNames[0] == field.Name { data["Err_"+field.Name] = true - trName := l.Tr("form." + field.Name) + + trName := field.Tag.Get("locale") + if len(trName) == 0 { + trName = l.Tr("form." + field.Name) + } else { + trName = l.Tr(trName) + } + switch errs[0].Classification { case binding.ERR_REQUIRED: data["ErrorMsg"] = trName + l.Tr("form.require_error") |