refactor: update UI text and error messages to English for better accessibility

This commit is contained in:
Laisky.Cai
2025-01-19 12:59:58 +00:00
parent 76ba80d406
commit 13b1b165bd
62 changed files with 805 additions and 805 deletions

View File

@@ -30,16 +30,16 @@ func Distribute() func(c *gin.Context) {
if ok {
id, err := strconv.Atoi(channelId.(string))
if err != nil {
abortWithMessage(c, http.StatusBadRequest, "无效的渠道 Id")
abortWithMessage(c, http.StatusBadRequest, "None效的Channel Id")
return
}
channel, err = model.GetChannelById(id, true)
if err != nil {
abortWithMessage(c, http.StatusBadRequest, "无效的渠道 Id")
abortWithMessage(c, http.StatusBadRequest, "None效的Channel Id")
return
}
if channel.Status != model.ChannelStatusEnabled {
abortWithMessage(c, http.StatusForbidden, "该渠道已被禁用")
abortWithMessage(c, http.StatusForbidden, "The channel has been disabled")
return
}
} else {
@@ -47,10 +47,10 @@ func Distribute() func(c *gin.Context) {
var err error
channel, err = model.CacheGetRandomSatisfiedChannel(userGroup, requestModel, false)
if err != nil {
message := fmt.Sprintf("当前分组 %s 下对于模型 %s 无可用渠道", userGroup, requestModel)
message := fmt.Sprintf("当前Group %s 下对于Model %s No available channels", userGroup, requestModel)
if channel != nil {
logger.SysError(fmt.Sprintf("渠道不存在:%d", channel.Id))
message = "数据库一致性已被破坏,请联系管理员"
logger.SysError(fmt.Sprintf("Channel does not exist: %d", channel.Id))
message = "Database consistency has been broken, please contact the administrator"
}
abortWithMessage(c, http.StatusServiceUnavailable, message)
return