diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-09-25 20:42:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 20:42:40 +0800 |
commit | 93bd4351bfb4a2f5f37ecb80d50496d044240e00 (patch) | |
tree | 4443b001284cf4f4f6932b909b9b70317b2428f7 /templates/shared | |
parent | 7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (diff) | |
download | gitea-93bd4351bfb4a2f5f37ecb80d50496d044240e00.tar.gz gitea-93bd4351bfb4a2f5f37ecb80d50496d044240e00.zip |
Fix more "locale" usages (#27259)
Diffstat (limited to 'templates/shared')
-rw-r--r-- | templates/shared/actions/runner_edit.tmpl | 10 | ||||
-rw-r--r-- | templates/shared/actions/runner_list.tmpl | 6 | ||||
-rw-r--r-- | templates/shared/issuelist.tmpl | 2 | ||||
-rw-r--r-- | templates/shared/searchbottom.tmpl | 2 | ||||
-rw-r--r-- | templates/shared/user/profile_big_avatar.tmpl | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl index 36e8a06b3d..c10901501d 100644 --- a/templates/shared/actions/runner_edit.tmpl +++ b/templates/shared/actions/runner_edit.tmpl @@ -9,11 +9,11 @@ <div class="runner-basic-info"> <div class="field gt-dib gt-mr-4"> <label>{{ctx.Locale.Tr "actions.runners.status"}}</label> - <span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName $.locale}}</span> + <span class="ui {{if .Runner.IsOnline}}green{{else}}basic{{end}} label">{{.Runner.StatusLocaleName ctx.Locale}}</span> </div> <div class="field gt-dib gt-mr-4"> <label>{{ctx.Locale.Tr "actions.runners.last_online"}}</label> - <span>{{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span> + <span>{{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</span> </div> <div class="field gt-dib gt-mr-4"> <label>{{ctx.Locale.Tr "actions.runners.labels"}}</label> @@ -25,7 +25,7 @@ </div> <div class="field gt-dib gt-mr-4"> <label>{{ctx.Locale.Tr "actions.runners.owner_type"}}</label> - <span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString $.locale}}</span> + <span data-tooltip-content="{{.Runner.BelongsToOwnerName}}">{{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}</span> </div> </div> @@ -64,13 +64,13 @@ {{range .Tasks}} <tr> <td><a href="{{.GetRunLink}}" target="_blank">{{.ID}}</a></td> - <td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString $.locale}}</span></td> + <td><span class="ui label task-status-{{.Status.String}}">{{.Status.LocaleString ctx.Locale}}</span></td> <td><a href="{{.GetRepoLink}}" target="_blank">{{.GetRepoName}}</a></td> <td> <strong><a href="{{.GetCommitLink}}" target="_blank">{{ShortSha .CommitSHA}}</a></strong> </td> <td>{{if .IsStopped}} - <span>{{TimeSinceUnix .Stopped $.locale}}</span> + <span>{{TimeSinceUnix .Stopped ctx.Locale}}</span> {{else}}-{{end}}</td> </tr> {{end}} diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl index dc81c76ee2..589edbc957 100644 --- a/templates/shared/actions/runner_list.tmpl +++ b/templates/shared/actions/runner_list.tmpl @@ -68,16 +68,16 @@ {{range .Runners}} <tr> <td> - <span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName $.locale}}</span> + <span class="ui {{if .IsOnline}}green{{else}}basic{{end}} label">{{.StatusLocaleName ctx.Locale}}</span> </td> <td>{{.ID}}</td> <td><p data-tooltip-content="{{.Description}}">{{.Name}}</p></td> <td>{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}}</td> - <td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString $.locale}}</span></td> + <td><span data-tooltip-content="{{.BelongsToOwnerName}}">{{.BelongsToOwnerType.LocaleString ctx.Locale}}</span></td> <td class="runner-tags"> {{range .AgentLabels}}<span class="ui label">{{.}}</span>{{end}} </td> - <td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td> + <td>{{if .LastOnline}}{{TimeSinceUnix .LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}</td> <td class="runner-ops"> {{if .Editable $.RunnerOwnerID $.RunnerRepoID}} <a href="{{$.Link}}/{{.ID}}">{{svg "octicon-pencil"}}</a> diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl index dea4b8b5ee..834de64fc5 100644 --- a/templates/shared/issuelist.tmpl +++ b/templates/shared/issuelist.tmpl @@ -60,7 +60,7 @@ #{{.Index}} {{end}} </a> - {{$timeStr := TimeSinceUnix .GetLastEventTimestamp $.locale}} + {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} {{if .OriginalAuthor}} {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr (.OriginalAuthor|Escape) | Safe}} {{else if gt .Poster.ID 0}} diff --git a/templates/shared/searchbottom.tmpl b/templates/shared/searchbottom.tmpl index eda3c3bdc4..55b6cb2909 100644 --- a/templates/shared/searchbottom.tmpl +++ b/templates/shared/searchbottom.tmpl @@ -6,7 +6,7 @@ </div> <div class="gt-mr-4"> {{if not .result.UpdatedUnix.IsZero}} - <span class="ui grey text">{{ctx.Locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix .root.locale) | Safe}}</span> + <span class="ui grey text">{{ctx.Locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix ctx.Locale) | Safe}}</span> {{end}} </div> </div> diff --git a/templates/shared/user/profile_big_avatar.tmpl b/templates/shared/user/profile_big_avatar.tmpl index f6031b9c93..598c194f19 100644 --- a/templates/shared/user/profile_big_avatar.tmpl +++ b/templates/shared/user/profile_big_avatar.tmpl @@ -15,7 +15,7 @@ {{if .ContextUser.FullName}}<span class="header text center">{{.ContextUser.FullName}}</span>{{end}} <span class="username text center">{{.ContextUser.Name}}</span> <div class="gt-mt-3"> - <a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{.locale.Tr "user.following"}}</a> + <a class="muted" href="{{.ContextUser.HomeLink}}?tab=followers">{{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}}</a> · <a class="muted" href="{{.ContextUser.HomeLink}}?tab=following">{{.NumFollowing}} {{ctx.Locale.Tr "user.following"}}</a> {{if .EnableFeed}} <a href="{{.ContextUser.HomeLink}}.rss"><i class="ui text grey gt-ml-3" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">{{svg "octicon-rss" 18}}</i></a> {{end}} |