add translation for errors checking group name (#27196)

Co-authored-by: Mattermost Build <build@mattermost.com>
This commit is contained in:
Scott Bishel 2024-06-04 07:57:55 -06:00 committed by GitHub
parent 5114c3b7cd
commit 206ff6e697
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -1226,10 +1226,10 @@ func (a *App) isUniqueToGroupNames(val string) *model.AppError {
var notFoundErr *store.ErrNotFound
group, err := a.Srv().Store().Group().GetByName(val, model.GroupSearchOpts{})
if err != nil && !errors.As(err, &notFoundErr) {
return model.NewAppError("isUniqueToGroupNames", model.NoTranslation, nil, "", http.StatusInternalServerError).Wrap(err)
return model.NewAppError("isUniqueToGroupNames", "app.user.save.groupname.app_error", nil, "", http.StatusInternalServerError).Wrap(err)
}
if group != nil {
return model.NewAppError("isUniqueToGroupNames", model.NoTranslation, nil, fmt.Sprintf("group name %s exists", val), http.StatusBadRequest)
return model.NewAppError("isUniqueToGroupNames", "app.user.save.username_exists.app_error", nil, fmt.Sprintf("group name %s exists", val), http.StatusBadRequest)
}
return nil
}

View File

@ -6830,6 +6830,10 @@
"id": "app.user.save.existing.app_error",
"translation": "Must call update for existing user."
},
{
"id": "app.user.save.groupname.app_error",
"translation": "Unable to determine if that username already exists"
},
{
"id": "app.user.save.username_exists.app_error",
"translation": "An account with that username already exists."