aboutsummaryrefslogtreecommitdiff
path: root/modules/auth/auth.go
diff options
context:
space:
mode:
authorcrohr <cyril.rohr@gmail.com>2015-07-14 15:09:08 +0000
committercrohr <cyril.rohr@gmail.com>2015-07-14 15:09:08 +0000
commitcbce2ec9cf74a96b15bbd1a5463957921465a980 (patch)
tree48f08facd06aa9910c98cdcada1a73d8d308775c /modules/auth/auth.go
parentb8e9c600409683b0f5eb10b637de003ce23b7796 (diff)
parentec774d48c58f83b599ac210d6def718187806ecd (diff)
Merge remote-tracking branch 'origin/master' into pkgr
Diffstat (limited to 'modules/auth/auth.go')
-rw-r--r--modules/auth/auth.go9
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")