Skip to content

Commit 12488d3

Browse files
kerwin612wxiaoguang
authored andcommitted
Fix Untranslated Text on Actions Page (go-gitea#33635)
Fix the problem of untranslated text on the actions page Co-authored-by: wxiaoguang <[email protected]> (cherry picked from commit ce65613)
1 parent e09ea82 commit 12488d3

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
@@ -240,7 +240,7 @@ func List(ctx *context.Context) {
240240
}
241241
ctx.Data["Actors"] = repo.MakeSelfOnTop(ctx.Doer, actors)
242242

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

245245
pager := context.NewPagination(int(total), opts.PageSize, opts.Page, 5)
246246
pager.SetDefaultParams(ctx)

0 commit comments

Comments
 (0)