mirror of
https://github.com/go-gitea/gitea.git
synced 2025-02-20 11:43:57 +08:00
Fix Untranslated Text on Actions Page (#33635)
Fix the problem of untranslated text on the actions page Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
748b731612
commit
ce65613690
@ -10,6 +10,7 @@ import (
|
|||||||
repo_model "code.gitea.io/gitea/models/repo"
|
repo_model "code.gitea.io/gitea/models/repo"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
"code.gitea.io/gitea/modules/container"
|
"code.gitea.io/gitea/modules/container"
|
||||||
|
"code.gitea.io/gitea/modules/translation"
|
||||||
webhook_module "code.gitea.io/gitea/modules/webhook"
|
webhook_module "code.gitea.io/gitea/modules/webhook"
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
@ -112,14 +113,14 @@ type StatusInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetStatusInfoList returns a slice of StatusInfo
|
// 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
|
// same as those in aggregateJobStatus
|
||||||
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
|
allStatus := []Status{StatusSuccess, StatusFailure, StatusWaiting, StatusRunning}
|
||||||
statusInfoList := make([]StatusInfo, 0, 4)
|
statusInfoList := make([]StatusInfo, 0, 4)
|
||||||
for _, s := range allStatus {
|
for _, s := range allStatus {
|
||||||
statusInfoList = append(statusInfoList, StatusInfo{
|
statusInfoList = append(statusInfoList, StatusInfo{
|
||||||
Status: int(s),
|
Status: int(s),
|
||||||
DisplayedStatus: s.String(),
|
DisplayedStatus: s.LocaleString(lang),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return statusInfoList
|
return statusInfoList
|
||||||
|
@ -306,7 +306,7 @@ func prepareWorkflowList(ctx *context.Context, workflows []Workflow) {
|
|||||||
}
|
}
|
||||||
ctx.Data["Actors"] = shared_user.MakeSelfOnTop(ctx.Doer, actors)
|
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 := context.NewPagination(int(total), opts.PageSize, opts.Page, 5)
|
||||||
pager.AddParamFromRequest(ctx.Req)
|
pager.AddParamFromRequest(ctx.Req)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user