Skip to content

Commit ce65613

Browse files
Fix Untranslated Text on Actions Page (#33635)
Fix the problem of untranslated text on the actions page Co-authored-by: wxiaoguang <[email protected]>
1 parent 748b731 commit ce65613

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

models/actions/run_list.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
repo_model "code.gitea.io/gitea/models/repo"
1111
user_model "code.gitea.io/gitea/models/user"
1212
"code.gitea.io/gitea/modules/container"
13+
"code.gitea.io/gitea/modules/translation"
1314
webhook_module "code.gitea.io/gitea/modules/webhook"
1415

1516
"xorm.io/builder"
@@ -112,14 +113,14 @@ type StatusInfo struct {
112113
}
113114

114115
// GetStatusInfoList returns a slice of StatusInfo
115-
func GetStatusInfoList(ctx context.Context) []StatusInfo {
116+
func GetStatusInfoList(ctx context.Context, lang translation.Locale) []StatusInfo {
116117
// same as those in aggregateJobStatus
117118
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
118119
statusInfoList := make([]StatusInfo, 0, 4)
119120
for _, s := range allStatus {
120121
statusInfoList = append(statusInfoList, StatusInfo{
121122
Status: int(s),
122-
DisplayedStatus: s.String(),
123+
DisplayedStatus: s.LocaleString(lang),
123124
})
124125
}
125126
return statusInfoList

routers/web/repo/actions/actions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) {
306306
}
307307
ctx.Data["Actors"] = shared_user.MakeSelfOnTop(ctx.Doer, actors)
308308

309-
ctx.Data["StatusInfoList"] = actions_model.GetStatusInfoList(ctx)
309+
ctx.Data["StatusInfoList"] = actions_model.GetStatusInfoList(ctx, ctx.Locale)
310310

311311
pager := context.NewPagination(int(total), opts.PageSize, opts.Page, 5)
312312
pager.AddParamFromRequest(ctx.Req)

0 commit comments

Comments
 (0)