1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

Use unique translation IDs instead of English text as key

This commit is contained in:
Frédéric Guillot 2018-09-21 18:53:29 -07:00
parent f244df6293
commit beb7a0cfcb
66 changed files with 4069 additions and 2972 deletions

View file

@ -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")
}
}