mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-08 09:43:42 +08:00
fix: translate error messages and comments to English for consistency
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(#%d)Quota已用尽", 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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user