fix: translate error messages and comments to English for consistency

This commit is contained in:
Laisky.Cai
2025-01-27 03:34:27 +00:00
parent 59dba5bef3
commit d5fa98f2e0
25 changed files with 197 additions and 186 deletions

View File

@@ -2,6 +2,7 @@ package model
import (
"fmt"
"github.com/pkg/errors"
"github.com/songquanpeng/one-api/common"
"github.com/songquanpeng/one-api/common/helper"
@@ -80,7 +81,7 @@ func Redeem(key string, userId int) (quota int64, err error) {
return err
})
if err != nil {
return 0, errors.New("Redeem失败," + err.Error())
return 0, errors.New("Redeem failed, " + err.Error())
}
RecordLog(userId, LogTypeTopup, fmt.Sprintf("Recharge %s through redemption code", common.LogQuota(redemption.Quota)))
return redemption.Quota, nil

View File

@@ -72,7 +72,7 @@ func ValidateUserToken(key string) (token *Token, err error) {
return nil, errors.Wrap(err, "failed to get token by key")
}
if token.Status == TokenStatusExhausted {
return nil, fmt.Errorf("API Keys %s#%dQuota已用尽", token.Name, token.Id)
return nil, fmt.Errorf("API Key %s (#%d) quota has been exhausted", token.Name, token.Id)
} else if token.Status == TokenStatusExpired {
return nil, errors.New("The token has expired")
}