diff options
author | Kerwin Bryant <kerwin612@qq.com> | 2025-02-18 19:29:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-18 11:29:08 +0000 |
commit | ce65613690e4564d9961f847ebd6eb2137f0c885 (patch) | |
tree | 02e46ee3fb26f3540b7ff0a55947b84c0a850b1e | |
parent | 748b731612191fdf597300fc1b8a1d423bae1e09 (diff) | |
download | gitea-ce65613690e4564d9961f847ebd6eb2137f0c885.tar.gz gitea-ce65613690e4564d9961f847ebd6eb2137f0c885.zip |
Fix Untranslated Text on Actions Page (#33635)
Fix the problem of untranslated text on the actions page
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
-rw-r--r-- | models/actions/run_list.go | 5 | ||||
-rw-r--r-- | routers/web/repo/actions/actions.go | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/models/actions/run_list.go b/models/actions/run_list.go index 4046c7d369..b9b9324e07 100644 --- a/models/actions/run_list.go +++ b/models/actions/run_list.go @@ -10,6 +10,7 @@ import ( repo_model "code.gitea.io/gitea/models/repo" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/container" + "code.gitea.io/gitea/modules/translation" webhook_module "code.gitea.io/gitea/modules/webhook" "xorm.io/builder" @@ -112,14 +113,14 @@ type StatusInfo struct { } // GetStatusInfoList returns a slice of StatusInfo -func GetStatusInfoList(ctx context.Context) []StatusInfo { +func GetStatusInfoList(ctx context.Context, lang translation.Locale) []StatusInfo { // same as those in aggregateJobStatus allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning} statusInfoList := make([]StatusInfo, 0, 4) for _, s := range allStatus { statusInfoList = append(statusInfoList, StatusInfo{ Status: int(s), - DisplayedStatus: s.String(), + DisplayedStatus: s.LocaleString(lang), }) } return statusInfoList diff --git a/routers/web/repo/actions/actions.go b/routers/web/repo/actions/actions.go index 9a5b3398d7..d07d195713 100644 --- a/routers/web/repo/actions/actions.go +++ b/routers/web/repo/actions/actions.go @@ -306,7 +306,7 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) { } ctx.Data["Actors"] = shared_user.MakeSelfOnTop(ctx.Doer, actors) - ctx.Data["StatusInfoList"] = actions_model.GetStatusInfoList(ctx) + ctx.Data["StatusInfoList"] = actions_model.GetStatusInfoList(ctx, ctx.Locale) pager := context.NewPagination(int(total), opts.PageSize, opts.Page, 5) pager.AddParamFromRequest(ctx.Req) |