chore: reorganize locale of actions

This commit is contained in:
Jason Song 2022-12-22 17:29:41 +08:00
parent c326ea5c20
commit 9eafbada53
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5
11 changed files with 68 additions and 68 deletions

View File

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

View File

@ -1220,12 +1220,6 @@ projects.open = Open
projects.close = Close
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.filter_assignees = Filter Assignee
issues.filter_milestones = Filter Milestone
@ -3014,32 +3008,6 @@ notices.desc = Description
notices.op = Op.
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]
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>
@ -3266,3 +3234,35 @@ deletion = Remove secret
deletion.description = Removing a secret will revoke its access to repositories. Continue?
deletion.success = The secret has been removed.
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
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["PageIsAdminRunners"] = true
@ -44,7 +44,7 @@ func Runners(ctx *context.Context) {
// EditRunner show editing runner page
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["PageIsAdminRunners"] = true
@ -58,7 +58,7 @@ func EditRunner(ctx *context.Context) {
// EditRunnerPost response for editing runner
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["PageIsAdminRunners"] = true
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) {
ctx.Data["Title"] = ctx.Tr("repo.actions")
ctx.Data["Title"] = ctx.Tr("actions.actions")
ctx.Data["PageIsActions"] = true
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")
if err != nil {
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)
return
}
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)
}
@ -155,7 +155,7 @@ func RunnerResetRegistrationToken(ctx *context.Context, ownerID, repoID int64, r
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)
}

View File

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

View File

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

View File

@ -185,7 +185,7 @@
{{if and .EnableActions (not .UnitActionsGlobalDisabled) (.Permission.CanRead $.UnitTypeActions)}}
<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}}
<span class="ui blue small label">{{CountFmt .Repository.NumOpenRuns}}</span>
{{end}}

View File

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

View File

@ -1,7 +1,7 @@
<div class="runner-container">
{{template "base/alert" .}}
<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>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
@ -9,15 +9,15 @@
{{.CsrfTokenHtml}}
<div class="runner-basic-info">
<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>
</div>
<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>
</div>
<div class="field dib">
<label>{{.locale.Tr "admin.runners.agent_labels"}}</label>
<label>{{.locale.Tr "actions.runners.agent_labels"}}</label>
<span>
{{range .Runner.AgentLabels}}
<span>{{.}}</span>
@ -25,7 +25,7 @@
</span>
</div>
<div class="field dib">
<label>{{.locale.Tr "admin.runners.owner_type"}}</label>
<label>{{.locale.Tr "actions.runners.owner_type"}}</label>
<span>{{.Runner.OwnType}}</span>
</div>
</div>
@ -33,27 +33,27 @@
<div class="ui divider"></div>
<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}}">
</div>
<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 `,`}}">
<p class="help">{{.locale.Tr "admin.runners.custom_labels_helper"}}</p>
<p class="help">{{.locale.Tr "actions.runners.custom_labels_helper"}}</p>
</div>
<div class="ui divider"></div>
<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">
{{.locale.Tr "admin.runners.delete_runner"}}</button>
{{.locale.Tr "actions.runners.delete_runner"}}</button>
</div>
</form>
</div>
<h4 class="ui top attached header">
{{.locale.Tr "admin.runners.task_list"}}
{{.locale.Tr "actions.runners.task_list"}}
</h4>
<div class="ui attached segment">
<table class="ui very basic striped table unstackable">
@ -91,7 +91,7 @@
</div>
<div class="ui small modal" id="runner-delete-modal">
<div class="header">
{{.locale.Tr "admin.runners.delete_header"}}
{{.locale.Tr "actions.runners.delete_header"}}
</div>
<div class="content">
<div class="ui warning message text left">
@ -102,7 +102,7 @@
<input type="hidden" name="action" value="delete">
<div class="text right actions">
<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>
</form>
</div>

View File

@ -2,18 +2,18 @@
{{template "base/alert" .}}
<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">
<!--<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">
<button class="ui button primary">
{{.locale.Tr "admin.runners.new"}}
{{.locale.Tr "actions.runners.new"}}
<i class="dropdown icon"></i>
</button>
<div class="menu">
<div class="item">
<a href="#">{{.locale.Tr "admin.runners.new_notice"}}</a>
<a href="#">{{.locale.Tr "actions.runners.new_notice"}}</a>
</div>
<div class="divider"></div>
<div class="header">
@ -47,13 +47,13 @@
<table class="ui very basic striped table unstackable">
<thead>
<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">
{{.locale.Tr "admin.runners.id"}}
{{.locale.Tr "actions.runners.id"}}
</th>
<th>{{.locale.Tr "admin.runners.owner_type"}}</th>
<th>{{.locale.Tr "admin.runners.labels"}}</th>
<th>{{.locale.Tr "admin.runners.latest_online"}}</th>
<th>{{.locale.Tr "actions.runners.owner_type"}}</th>
<th>{{.locale.Tr "actions.runners.labels"}}</th>
<th>{{.locale.Tr "actions.runners.latest_online"}}</th>
<th></th>
</tr>
</thead>