Skip to content

Commit

Permalink
fix(region): 补充部分翻译 (#20730)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito authored Jul 7, 2024
1 parent 28e3224 commit 3b5f8df
Show file tree
Hide file tree
Showing 9 changed files with 4,636 additions and 4,208 deletions.
8,216 changes: 4,168 additions & 4,048 deletions locales/locales.go

Large diffs are not rendered by default.

612 changes: 461 additions & 151 deletions locales/zh-CN/messages.gotext.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/apigateway/handler/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func (mh *MiscHandler) getDownloadsHandler(ctx context.Context, w http.ResponseW
params := appctx.AppContextParams(ctx)
template, ok := params["<template_id>"]
if !ok || len(template) == 0 {
httperrors.InvalidInputError(ctx, w, "template_id")
httperrors.MissingParameterError(ctx, w, "template_id")
return
}

Expand Down
4 changes: 1 addition & 3 deletions pkg/apihelper/apihelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import (
)

const (
ErrSync = errors.Error("sync error")

MinSyncIntervalSeconds = 10
MinRunDelayMilliseconds = 100
)
Expand Down Expand Up @@ -170,7 +168,7 @@ func (h *APIHelper) doSync(ctx context.Context) (changed bool, err error) {
if err != nil {
log.Errorf("unable to EventNotify: %s", err)
}
return false, errors.Wrap(ErrSync, "incorrect")
return false, errors.Errorf("sync error")
}
changed = r.Changed
return changed, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/appsrv/appsrv.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ func (app *Application) defaultHandle(w http.ResponseWriter, r *http.Request, ri
}
} else if !isCors {
ctx := appctx.WithRequestLang(context.TODO(), r)
httperrors.NotFoundError(ctx, w, "Handler not found")
httperrors.NotFoundError(ctx, w, "Handler %s not found", "/"+strings.Join(segs, "/"))
}
return nil, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudcommon/db/history_data_clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func historyDataCleanHandler(ctx context.Context, w http.ResponseWriter, r *http
}
input, err := appsrv.FetchJSON(r)
if err != nil {
httperrors.InputParameterError(ctx, w, "FetchJSON")
httperrors.InputParameterError(ctx, w, "invalid input json")
return
}
date := time.Now().AddDate(0, -1, 0)
Expand Down
2 changes: 1 addition & 1 deletion pkg/compute/hostdrivers/jdcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (self *SJDcloudHostDriver) GetProvider() string {
// ValidateResetDisk 仅可用状态的云硬盘支持恢复
// 卸载硬盘需要停止云主机
func (self *SJDcloudHostDriver) ValidateResetDisk(ctx context.Context, userCred mcclient.TokenCredential, disk *models.SDisk, snapshot *models.SSnapshot, guests []models.SGuest, input *api.DiskResetInput) (*api.DiskResetInput, error) {
return nil, httperrors.NewNotSupportedError("not supported")
return nil, httperrors.NewNotSupportedError("not supported resize disk")
}

// ValidateDiskSize
Expand Down
2 changes: 1 addition & 1 deletion pkg/compute/hostdrivers/qcloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (self *SQcloudHostDriver) ValidateDiskSize(storage *models.SStorage, sizeGb
func (self *SQcloudHostDriver) ValidateResetDisk(ctx context.Context, userCred mcclient.TokenCredential, disk *models.SDisk, snapshot *models.SSnapshot, guests []models.SGuest, input *api.DiskResetInput) (*api.DiskResetInput, error) {
for _, guest := range guests {
if !utils.IsInStringArray(guest.Status, []string{api.VM_RUNNING, api.VM_READY}) {
return nil, httperrors.NewBadGatewayError("Qcloud reset disk required guest status is running or read")
return nil, httperrors.NewBadGatewayError("Qcloud reset disk required guest status is running or ready")
}
}
return input, nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/compute/hostdrivers/volcengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (self *SVolcengineHostDriver) ValidateDiskSize(storage *models.SStorage, si
func (self *SVolcengineHostDriver) ValidateResetDisk(ctx context.Context, userCred mcclient.TokenCredential, disk *models.SDisk, snapshot *models.SSnapshot, guests []models.SGuest, input *api.DiskResetInput) (*api.DiskResetInput, error) {
for _, guest := range guests {
if !utils.IsInStringArray(guest.Status, []string{api.VM_RUNNING, api.VM_READY}) {
return nil, httperrors.NewBadGatewayError("Volcengine reset disk required guest status is running or read")
return nil, httperrors.NewBadGatewayError("Volcengine reset disk required guest status is running or ready")
}
}
return input, nil
Expand Down

0 comments on commit 3b5f8df

Please sign in to comment.