1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-26 20:28:40 +00:00

chore: reorganize locale of actions

This commit is contained in:
Jason Song
2022-12-22 17:29:41 +08:00
parent c326ea5c20
commit 9eafbada53
11 changed files with 68 additions and 68 deletions

View File

@@ -294,9 +294,9 @@ var (
UnitActions = Unit{ UnitActions = Unit{
TypeActions, TypeActions,
"repo.actions", "actions.actions",
"/actions", "/actions",
"repo.actions.desc", "actions.description",
7, 7,
perm.AccessModeOwner, perm.AccessModeOwner,
} }

View File

@@ -1220,12 +1220,6 @@ projects.open = Open
projects.close = Close projects.close = Close
projects.board.assigned_to = Assigned to projects.board.assigned_to = Assigned to
actions = Actions
actions.desc = Manage actions
actions.opened_by = opened %[1]s by %[2]s
actions.open_tab = %d Open
actions.closed_tab = %d Closed
issues.desc = Organize bug reports, tasks and milestones. issues.desc = Organize bug reports, tasks and milestones.
issues.filter_assignees = Filter Assignee issues.filter_assignees = Filter Assignee
issues.filter_milestones = Filter Milestone issues.filter_milestones = Filter Milestone
@@ -3014,32 +3008,6 @@ notices.desc = Description
notices.op = Op. notices.op = Op.
notices.delete_success = The system notices have been deleted. notices.delete_success = The system notices have been deleted.
runners = Runners
runners.runner_manage_panel = Runners Management
runners.new = Create new Runner
runners.new_notice = Show runner installation documentation
runners.status = Status
runners.id = ID
runners.owner_type = Type
runners.description = Description
runners.labels = Labels
runners.latest_online = Last Online Time
runners.agent_labels = Agent Labels
runners.custom_labels = Custom Labels
runners.custom_labels_helper = Custom labels are labels that are not automatically added by the agent. They are added by the administrator. Use comma separated.
runners.runner_title = Runner
runners.task_list = Recent jobs on this runner
runners.edit_runner = Edit Runner
runners.update_runner = Update Changes
runners.update_runner_success = Runner updated successfully
runners.update_runner_failed = Failed to update runner
runners.delete_runner = Delete this runner
runners.delete_runner_success = Runner deleted successfully
runners.delete_runner_failed = Failed to delete runner
runners.delete_runner_header = Confirm to delete this runner
runners.delete_runner_notice = If job is running on this runner, it will be terminated and mark as failed. It may break building workflow.
runners.delete_runner_confirm = Delete this runner
[action] [action]
create_repo = created repository <a href="%s">%s</a> create_repo = created repository <a href="%s">%s</a>
rename_repo = renamed repository from <code>%[1]s</code> to <a href="%[2]s">%[3]s</a> rename_repo = renamed repository from <code>%[1]s</code> to <a href="%[2]s">%[3]s</a>
@@ -3266,3 +3234,35 @@ deletion = Remove secret
deletion.description = Removing a secret will revoke its access to repositories. Continue? deletion.description = Removing a secret will revoke its access to repositories. Continue?
deletion.success = The secret has been removed. deletion.success = The secret has been removed.
deletion.failed = Failed to remove secret. deletion.failed = Failed to remove secret.
[actions]
actions = Actions
description = Manage actions
open_tab = %d Open
closed_tab = %d Closed
runners = Runners
runners.runner_manage_panel = Runners Management
runners.new = Create new Runner
runners.new_notice = Show runner installation documentation
runners.status = Status
runners.id = ID
runners.owner_type = Type
runners.description = Description
runners.labels = Labels
runners.latest_online = Last Online Time
runners.agent_labels = Agent Labels
runners.custom_labels = Custom Labels
runners.custom_labels_helper = Custom labels are labels that are not automatically added by the agent. They are added by the administrator. Use comma separated.
runners.runner_title = Runner
runners.task_list = Recent jobs on this runner
runners.edit_runner = Edit Runner
runners.update_runner = Update Changes
runners.update_runner_success = Runner updated successfully
runners.update_runner_failed = Failed to update runner
runners.delete_runner = Delete this runner
runners.delete_runner_success = Runner deleted successfully
runners.delete_runner_failed = Failed to delete runner
runners.delete_runner_header = Confirm to delete this runner
runners.delete_runner_notice = If job is running on this runner, it will be terminated and mark as failed. It may break building workflow.
runners.delete_runner_confirm = Delete this runner

View File

@@ -21,7 +21,7 @@ const (
// Runners show all the runners // Runners show all the runners
func Runners(ctx *context.Context) { func Runners(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.runners") ctx.Data["Title"] = ctx.Tr("actions.runners")
ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminRunners"] = true ctx.Data["PageIsAdminRunners"] = true
@@ -44,7 +44,7 @@ func Runners(ctx *context.Context) {
// EditRunner show editing runner page // EditRunner show editing runner page
func EditRunner(ctx *context.Context) { func EditRunner(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.runners.edit_runner") ctx.Data["Title"] = ctx.Tr("actions.runners.edit_runner")
ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminRunners"] = true ctx.Data["PageIsAdminRunners"] = true
@@ -58,7 +58,7 @@ func EditRunner(ctx *context.Context) {
// EditRunnerPost response for editing runner // EditRunnerPost response for editing runner
func EditRunnerPost(ctx *context.Context) { func EditRunnerPost(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("admin.runners.edit") ctx.Data["Title"] = ctx.Tr("actions.runners.edit")
ctx.Data["PageIsAdmin"] = true ctx.Data["PageIsAdmin"] = true
ctx.Data["PageIsAdminRunners"] = true ctx.Data["PageIsAdminRunners"] = true
actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"), 0, 0, actions_shared.RunnerDetailsEditPost(ctx, ctx.ParamsInt64(":runnerid"), 0, 0,

View File

@@ -44,7 +44,7 @@ func MustEnableActions(ctx *context.Context) {
} }
func List(ctx *context.Context) { func List(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.actions") ctx.Data["Title"] = ctx.Tr("actions.actions")
ctx.Data["PageIsActions"] = true ctx.Data["PageIsActions"] = true
var workflows git.Entries var workflows git.Entries

View File

@@ -136,14 +136,14 @@ func RunnerDetailsEditPost(ctx *context.Context, runnerID, ownerID, repoID int64
err = actions_model.UpdateRunner(ctx, runner, "description", "custom_labels") err = actions_model.UpdateRunner(ctx, runner, "description", "custom_labels")
if err != nil { if err != nil {
log.Warn("RunnerDetailsEditPost.UpdateRunner failed: %v, url: %s", err, ctx.Req.URL) log.Warn("RunnerDetailsEditPost.UpdateRunner failed: %v, url: %s", err, ctx.Req.URL)
ctx.Flash.Warning(ctx.Tr("admin.runners.update_runner_failed")) ctx.Flash.Warning(ctx.Tr("actions.runners.update_runner_failed"))
ctx.Redirect(redirectTo) ctx.Redirect(redirectTo)
return return
} }
log.Debug("RunnerDetailsEditPost success: %s", ctx.Req.URL) log.Debug("RunnerDetailsEditPost success: %s", ctx.Req.URL)
ctx.Flash.Success(ctx.Tr("admin.runners.update_runner_success")) ctx.Flash.Success(ctx.Tr("actions.runners.update_runner_success"))
ctx.Redirect(redirectTo) ctx.Redirect(redirectTo)
} }
@@ -155,7 +155,7 @@ func RunnerResetRegistrationToken(ctx *context.Context, ownerID, repoID int64, r
return return
} }
ctx.Flash.Success(ctx.Tr("admin.runners.reset_registration_token_success")) ctx.Flash.Success(ctx.Tr("actions.runners.reset_registration_token_success"))
ctx.Redirect(redirectTo) ctx.Redirect(redirectTo)
} }

View File

@@ -35,7 +35,7 @@
{{end}} {{end}}
{{if .EnableActions}} {{if .EnableActions}}
<a class="{{if .PageIsAdminRunners}}active {{end}} item" href="{{AppSubUrl}}/admin/runners"> <a class="{{if .PageIsAdminRunners}}active {{end}} item" href="{{AppSubUrl}}/admin/runners">
{{.locale.Tr "admin.runners"}} {{.locale.Tr "actions.runners"}}
</a> </a>
{{end}} {{end}}
<a class="{{if .PageIsAdminConfig}}active {{end}} item" href="{{AppSubUrl}}/admin/config"> <a class="{{if .PageIsAdminConfig}}active {{end}} item" href="{{AppSubUrl}}/admin/config">

View File

@@ -1,10 +1,10 @@
<div class="ui compact tiny menu"> <div class="ui compact tiny menu">
<a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open"> <a class="{{if not .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=open">
{{svg "octicon-issue-opened" 16 "mr-3"}} {{svg "octicon-issue-opened" 16 "mr-3"}}
{{.locale.Tr "repo.actions.open_tab" $.NumOpenRuns}} {{.locale.Tr "actions.open_tab" $.NumOpenRuns}}
</a> </a>
<a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=closed"> <a class="{{if .IsShowClosed}}active {{end}}item" href="{{$.Link}}?workflow={{.CurWorkflow}}&state=closed">
{{svg "octicon-issue-closed" 16 "mr-3"}} {{svg "octicon-issue-closed" 16 "mr-3"}}
{{.locale.Tr "repo.actions.closed_tab" $.NumClosedRuns}} {{.locale.Tr "actions.closed_tab" $.NumClosedRuns}}
</a> </a>
</div> </div>

View File

@@ -185,7 +185,7 @@
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}} {{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
<a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions"> <a class="{{if .PageIsActions}}active {{end}}item" href="{{.RepoLink}}/actions">
{{svg "octicon-play"}} {{.locale.Tr "repo.actions"}} {{svg "octicon-play"}} {{.locale.Tr "actions.actions"}}
{{if .Repository.NumOpenRuns}} {{if .Repository.NumOpenRuns}}
<span class="ui blue small label">{{CountFmt .Repository.NumOpenRuns}}</span> <span class="ui blue small label">{{CountFmt .Repository.NumOpenRuns}}</span>
{{end}} {{end}}

View File

@@ -436,7 +436,7 @@
{{if .EnableActions}} {{if .EnableActions}}
{{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}} {{$isActionsEnabled := .Repository.UnitEnabled $.Context $.UnitTypeActions}}
<div class="inline field"> <div class="inline field">
<label>{{.locale.Tr "repo.actions"}}</label> <label>{{.locale.Tr "actions.actions"}}</label>
{{if .UnitTypeActions.UnitGlobalDisabled}} {{if .UnitTypeActions.UnitGlobalDisabled}}
<div class="ui checkbox tooltip disabled" data-content="{{.locale.Tr "repo.unit_disabled"}}"> <div class="ui checkbox tooltip disabled" data-content="{{.locale.Tr "repo.unit_disabled"}}">
{{else}} {{else}}

View File

@@ -1,7 +1,7 @@
<div class="runner-container"> <div class="runner-container">
{{template "base/alert" .}} {{template "base/alert" .}}
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.runners.runner_title"}} #{{.Runner.ID}} {{.Runner.Name}} {{.locale.Tr "actions.runners.runner_title"}} #{{.Runner.ID}} {{.Runner.Name}}
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post"> <form class="ui form" action="{{.Link}}" method="post">
@@ -9,15 +9,15 @@
{{.CsrfTokenHtml}} {{.CsrfTokenHtml}}
<div class="runner-basic-info"> <div class="runner-basic-info">
<div class="field dib"> <div class="field dib">
<label>{{.locale.Tr "admin.runners.status"}}</label> <label>{{.locale.Tr "actions.runners.status"}}</label>
<span class="runner-status-{{if .Runner.IsOnline}}online{{else}}offline{{end}}">{{.Runner.StatusName}}</span> <span class="runner-status-{{if .Runner.IsOnline}}online{{else}}offline{{end}}">{{.Runner.StatusName}}</span>
</div> </div>
<div class="field dib"> <div class="field dib">
<label>{{.locale.Tr "admin.runners.latest_online"}}</label> <label>{{.locale.Tr "actions.runners.latest_online"}}</label>
<span>{{TimeSinceUnix .Runner.LastOnline $.locale}}</span> <span>{{TimeSinceUnix .Runner.LastOnline $.locale}}</span>
</div> </div>
<div class="field dib"> <div class="field dib">
<label>{{.locale.Tr "admin.runners.agent_labels"}}</label> <label>{{.locale.Tr "actions.runners.agent_labels"}}</label>
<span> <span>
{{range .Runner.AgentLabels}} {{range .Runner.AgentLabels}}
<span>{{.}}</span> <span>{{.}}</span>
@@ -25,7 +25,7 @@
</span> </span>
</div> </div>
<div class="field dib"> <div class="field dib">
<label>{{.locale.Tr "admin.runners.owner_type"}}</label> <label>{{.locale.Tr "actions.runners.owner_type"}}</label>
<span>{{.Runner.OwnType}}</span> <span>{{.Runner.OwnType}}</span>
</div> </div>
</div> </div>
@@ -33,27 +33,27 @@
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="field"> <div class="field">
<label for="description">{{.locale.Tr "admin.runners.description"}}</label> <label for="description">{{.locale.Tr "actions.runners.description"}}</label>
<input id="description" name="description" value="{{.Runner.Description}}"> <input id="description" name="description" value="{{.Runner.Description}}">
</div> </div>
<div class="field"> <div class="field">
<label for="custom_labels">{{.locale.Tr "admin.runners.custom_labels"}}</label> <label for="custom_labels">{{.locale.Tr "actions.runners.custom_labels"}}</label>
<input id="custom_labels" name="custom_labels" value="{{Join .Runner.CustomLabels `,`}}"> <input id="custom_labels" name="custom_labels" value="{{Join .Runner.CustomLabels `,`}}">
<p class="help">{{.locale.Tr "admin.runners.custom_labels_helper"}}</p> <p class="help">{{.locale.Tr "actions.runners.custom_labels_helper"}}</p>
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="field"> <div class="field">
<button type="submit" class="ui green button">{{.locale.Tr "admin.runners.update_runner"}}</button> <button type="submit" class="ui green button">{{.locale.Tr "actions.runners.update_runner"}}</button>
<button type="button" class="ui red button delete-button show-modal" data-modal="#runner-delete-modal"> <button type="button" class="ui red button delete-button show-modal" data-modal="#runner-delete-modal">
{{.locale.Tr "admin.runners.delete_runner"}}</button> {{.locale.Tr "actions.runners.delete_runner"}}</button>
</div> </div>
</form> </form>
</div> </div>
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.runners.task_list"}} {{.locale.Tr "actions.runners.task_list"}}
</h4> </h4>
<div class="ui attached segment"> <div class="ui attached segment">
<table class="ui very basic striped table unstackable"> <table class="ui very basic striped table unstackable">
@@ -91,7 +91,7 @@
</div> </div>
<div class="ui small modal" id="runner-delete-modal"> <div class="ui small modal" id="runner-delete-modal">
<div class="header"> <div class="header">
{{.locale.Tr "admin.runners.delete_header"}} {{.locale.Tr "actions.runners.delete_header"}}
</div> </div>
<div class="content"> <div class="content">
<div class="ui warning message text left"> <div class="ui warning message text left">
@@ -102,7 +102,7 @@
<input type="hidden" name="action" value="delete"> <input type="hidden" name="action" value="delete">
<div class="text right actions"> <div class="text right actions">
<div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div> <div class="ui cancel button">{{.locale.Tr "settings.cancel"}}</div>
<button class="ui red button">{{.locale.Tr "admin.runners.delete_confirm"}}</button> <button class="ui red button">{{.locale.Tr "actions.runners.delete_confirm"}}</button>
</div> </div>
</form> </form>
</div> </div>

View File

@@ -2,18 +2,18 @@
{{template "base/alert" .}} {{template "base/alert" .}}
<h4 class="ui top attached header"> <h4 class="ui top attached header">
{{.locale.Tr "admin.runners.runner_manage_panel"}} ({{.locale.Tr "admin.total" .Total}}) {{.locale.Tr "actions.runners.runner_manage_panel"}} ({{.locale.Tr "admin.total" .Total}})
<div class="ui right"> <div class="ui right">
<!--<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/runners/new">{{.locale.Tr "admin.runners.new"}}</a>--> <!--<a class="ui primary tiny button" href="{{AppSubUrl}}/admin/runners/new">{{.locale.Tr "actions.runners.new"}}</a>-->
<div class="ui top right pointing dropdown"> <div class="ui top right pointing dropdown">
<button class="ui button primary"> <button class="ui button primary">
{{.locale.Tr "admin.runners.new"}} {{.locale.Tr "actions.runners.new"}}
<i class="dropdown icon"></i> <i class="dropdown icon"></i>
</button> </button>
<div class="menu"> <div class="menu">
<div class="item"> <div class="item">
<a href="#">{{.locale.Tr "admin.runners.new_notice"}}</a> <a href="#">{{.locale.Tr "actions.runners.new_notice"}}</a>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<div class="header"> <div class="header">
@@ -47,13 +47,13 @@
<table class="ui very basic striped table unstackable"> <table class="ui very basic striped table unstackable">
<thead> <thead>
<tr> <tr>
<th data-sortt-asc="online" data-sortt-desc="offline">{{.locale.Tr "admin.runners.status"}}</th> <th data-sortt-asc="online" data-sortt-desc="offline">{{.locale.Tr "actions.runners.status"}}</th>
<th data-sortt-asc="alphabetically"> <th data-sortt-asc="alphabetically">
{{.locale.Tr "admin.runners.id"}} {{.locale.Tr "actions.runners.id"}}
</th> </th>
<th>{{.locale.Tr "admin.runners.owner_type"}}</th> <th>{{.locale.Tr "actions.runners.owner_type"}}</th>
<th>{{.locale.Tr "admin.runners.labels"}}</th> <th>{{.locale.Tr "actions.runners.labels"}}</th>
<th>{{.locale.Tr "admin.runners.latest_online"}}</th> <th>{{.locale.Tr "actions.runners.latest_online"}}</th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>