Skip to content

Commit

Permalink
Fix Untranslated Text on Actions Page (#33635)
Browse files Browse the repository at this point in the history
Fix the problem of untranslated text on the actions page

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
  • Loading branch information
kerwin612 and wxiaoguang authored Feb 18, 2025
1 parent 748b731 commit ce65613
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions models/actions/run_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion routers/web/repo/actions/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ce65613

Please sign in to comment.