Remove duplicated i18n words

This commit is contained in:
Gucheng Wang
2023-01-06 20:24:14 +08:00
parent a6e9084973
commit 57028c2059
12 changed files with 16 additions and 32 deletions

View File

@ -247,7 +247,7 @@ func (c *ApiController) Login() {
}
user = object.GetUserByFields(form.Organization, form.Username)
if user == nil {
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s/%s doesn't exist"), form.Organization, form.Username))
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s doesn't exist"), util.GetId(form.Organization, form.Username)))
return
}
checkResult = object.CheckSigninCode(user, checkDest, form.Code, c.GetAcceptLanguage())
@ -468,13 +468,13 @@ func (c *ApiController) Login() {
record2.User = user.Name
util.SafeGoroutine(func() { object.AddRecord(record2) })
} else if provider.Category == "SAML" {
resp = &Response{Status: "error", Msg: c.T("general:The user doesn't exist")}
resp = &Response{Status: "error", Msg: fmt.Sprintf(c.T("general:The user: %s doesn't exist"), util.GetId(application.Organization, userInfo.Id))}
}
// resp = &Response{Status: "ok", Msg: "", Data: res}
} else { // form.Method != "signup"
userId := c.GetSessionUsername()
if userId == "" {
c.ResponseError(c.T("general:The user doesn't exist"), userInfo)
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s doesn't exist"), util.GetId(application.Organization, userInfo.Id)), userInfo)
return
}

View File

@ -363,7 +363,7 @@ func (c *ApiController) GetEmailAndPhone() {
user := object.GetUserByFields(form.Organization, form.Username)
if user == nil {
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s/%s doesn't exist"), form.Organization, form.Username))
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s doesn't exist"), util.GetId(form.Organization, form.Username)))
return
}

View File

@ -101,7 +101,7 @@ func (c *ApiController) WebAuthnSigninBegin() {
userName := c.Input().Get("name")
user := object.GetUserByFields(userOwner, userName)
if user == nil {
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s/%s doesn't exist"), userOwner, userName))
c.ResponseError(fmt.Sprintf(c.T("general:The user: %s doesn't exist"), util.GetId(userOwner, userName)))
return
}
if len(user.WebauthnCredentials) == 0 {

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "Please login first",
"The user doesn't exist": "The user doesn't exist",
"The user: %s doesn't exist": "The user: %s doesn't exist",
"The user: %s/%s doesn't exist": "The user: %s/%s doesn't exist"
"The user: %s doesn't exist": "The user: %s doesn't exist"
},
"ldap": {
"Ldap server exist": "Ldap server exist",

View File

@ -65,9 +65,7 @@
},
"general": {
"Please login first": "请先登录",
"The user doesn't exist": "用户不存在",
"The user: %s doesn't exist": "用户: %s 不存在",
"The user: %s/%s doesn't exist": "用户: %s/%s 不存在"
"The user: %s doesn't exist": "用户: %s 不存在"
},
"ldap": {
"Ldap server exist": "LDAP服务器已存在",
@ -125,8 +123,8 @@
"Failed to import users": "导入用户失败"
},
"util": {
"No application is found for userId: %s": "找不到该用户的应用程序 %s",
"No provider for category: %s is found for application: %s": "找不到该用户的应用程序 %s",
"No application is found for userId: %s": "未找到用户: %s 的应用",
"No provider for category: %s is found for application: %s": "未找到类别为: %s 的提供商来满足应用: %s",
"The provider: %s is not found": "未找到提供商: %s"
},
"verification": {

View File

@ -229,7 +229,7 @@ func checkLdapUserPassword(user *User, password string, lang string) (*User, str
func CheckUserPassword(organization string, username string, password string, lang string) (*User, string) {
user := GetUserByFields(organization, username)
if user == nil || user.IsDeleted == true {
return nil, i18n.Translate(lang, "general:The user doesn't exist")
return nil, fmt.Sprintf(i18n.Translate(lang, "general:The user: %s doesn't exist"), util.GetId(organization, username))
}
if user.IsForbidden {