From cd6a4bbd58e1684048cfa98b4306af1c4553b1de Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Wed, 13 Jul 2022 15:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=91=E8=84=91=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=81=9C=E6=AD=A2=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- options/locale/locale_en-US.ini | 5 ++++- options/locale/locale_zh-CN.ini | 6 +++++- routers/repo/cloudbrain.go | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index fb2c88f95..eed2c03bf 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -3122,7 +3122,10 @@ INFERENCE = INFERENCE BENCHMARK = BENCHMARK brain_area = Brain Area -Delete_failed=Fail to delete, please try again later. +Delete_failed=Fail to delete the job, please try again later. Not_Stopped=The job is not stopped, can not be deleted. +Already_stopped=The job is already stopped. +Stopped_failed=Fail to stop the job, please try again later. +Stopped_success_update_status_fail=Succeed in stopping th job, but failed to update the job status and duration time. error.dataset_select = dataset select error:the count exceed the limit or has same name diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index 92ddfa35c..b5a3836c0 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -3136,7 +3136,11 @@ INFERENCE = 推理任务 BENCHMARK = 评测任务 brain_area = 脑区 -Delete_failed=删除失败,请稍后再试。 +Delete_failed=任务删除失败,请稍后再试。 Not_Stopped=任务还未终止,不能删除。 +Already_stopped=任务已停止。 +Stopped_failed=任务停止失败,请稍后再试。 +Stopped_success_update_status_fail=任务停止成功,状态及运行时间更新失败。 + error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集 diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 5276b233e..a7f152ab8 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -1069,7 +1069,7 @@ func CloudBrainStop(ctx *context.Context) { if task.Status == string(models.JobStopped) || task.Status == string(models.JobFailed) || task.Status == string(models.JobSucceeded) { log.Error("the job(%s) has been stopped", task.JobName, ctx.Data["msgID"]) resultCode = "-1" - errorMsg = "system error" + errorMsg = "cloudbrain.Already_stopped" break } @@ -1077,7 +1077,7 @@ func CloudBrainStop(ctx *context.Context) { if err != nil { log.Error("StopJob(%s) failed:%v", task.JobName, err, ctx.Data["msgID"]) resultCode = "-1" - errorMsg = "system error" + errorMsg = "cloudbrain.Stopped_failed" break } @@ -1090,7 +1090,7 @@ func CloudBrainStop(ctx *context.Context) { if err != nil { log.Error("UpdateJob(%s) failed:%v", task.JobName, err, ctx.Data["msgID"]) resultCode = "-1" - errorMsg = "system error" + errorMsg = "cloudbrain.Stopped_success_update_status_fail" break } @@ -1100,7 +1100,7 @@ func CloudBrainStop(ctx *context.Context) { ctx.JSON(200, map[string]interface{}{ "result_code": resultCode, - "error_msg": errorMsg, + "error_msg": ctx.Tr(errorMsg), "status": status, "id": ID, "StatusOK": 0,