aboutsummaryrefslogtreecommitdiffhomepage
path: root/ui/form/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/form/user.go')
-rw-r--r--ui/form/user.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/form/user.go b/ui/form/user.go
index 404f9c7..e250462 100644
--- a/ui/form/user.go
+++ b/ui/form/user.go
@@ -22,15 +22,15 @@ type UserForm struct {
// ValidateCreation validates user creation.
func (u UserForm) ValidateCreation() error {
if u.Username == "" || u.Password == "" || u.Confirmation == "" {
- return errors.NewLocalizedError("All fields are mandatory.")
+ return errors.NewLocalizedError("error.fields_mandatory")
}
if u.Password != u.Confirmation {
- return errors.NewLocalizedError("Passwords are not the same.")
+ return errors.NewLocalizedError("error.different_passwords")
}
if len(u.Password) < 6 {
- return errors.NewLocalizedError("You must use at least 6 characters.")
+ return errors.NewLocalizedError("error.password_min_length")
}
return nil
@@ -39,16 +39,16 @@ func (u UserForm) ValidateCreation() error {
// ValidateModification validates user modification.
func (u UserForm) ValidateModification() error {
if u.Username == "" {
- return errors.NewLocalizedError("The username is mandatory.")
+ return errors.NewLocalizedError("error.user_mandatory_fields")
}
if u.Password != "" {
if u.Password != u.Confirmation {
- return errors.NewLocalizedError("Passwords are not the same.")
+ return errors.NewLocalizedError("error.different_passwords")
}
if len(u.Password) < 6 {
- return errors.NewLocalizedError("You must use at least 6 characters.")
+ return errors.NewLocalizedError("error.password_min_length")
}
}