From 93bd4351bfb4a2f5f37ecb80d50496d044240e00 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 25 Sep 2023 20:42:40 +0800 Subject: Fix more "locale" usages (#27259) --- templates/shared/actions/runner_edit.tmpl | 10 +++++----- templates/shared/actions/runner_list.tmpl | 6 +++--- templates/shared/issuelist.tmpl | 2 +- templates/shared/searchbottom.tmpl | 2 +- templates/shared/user/profile_big_avatar.tmpl | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'templates/shared') 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 @@
- {{.Runner.StatusLocaleName $.locale}} + {{.Runner.StatusLocaleName ctx.Locale}}
- {{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} + {{if .Runner.LastOnline}}{{TimeSinceUnix .Runner.LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}}
@@ -25,7 +25,7 @@
- {{.Runner.BelongsToOwnerType.LocaleString $.locale}} + {{.Runner.BelongsToOwnerType.LocaleString ctx.Locale}}
@@ -64,13 +64,13 @@ {{range .Tasks}} {{.ID}} - {{.Status.LocaleString $.locale}} + {{.Status.LocaleString ctx.Locale}} {{.GetRepoName}} {{ShortSha .CommitSHA}} {{if .IsStopped}} - {{TimeSinceUnix .Stopped $.locale}} + {{TimeSinceUnix .Stopped ctx.Locale}} {{else}}-{{end}} {{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}} - {{.StatusLocaleName $.locale}} + {{.StatusLocaleName ctx.Locale}} {{.ID}}

{{.Name}}

{{if .Version}}{{.Version}}{{else}}{{ctx.Locale.Tr "unknown"}}{{end}} - {{.BelongsToOwnerType.LocaleString $.locale}} + {{.BelongsToOwnerType.LocaleString ctx.Locale}} {{range .AgentLabels}}{{.}}{{end}} - {{if .LastOnline}}{{TimeSinceUnix .LastOnline $.locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} + {{if .LastOnline}}{{TimeSinceUnix .LastOnline ctx.Locale}}{{else}}{{ctx.Locale.Tr "never"}}{{end}} {{if .Editable $.RunnerOwnerID $.RunnerRepoID}} {{svg "octicon-pencil"}} 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}} - {{$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 @@
{{if not .result.UpdatedUnix.IsZero}} - {{ctx.Locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix .root.locale) | Safe}} + {{ctx.Locale.Tr "explore.code_last_indexed_at" (TimeSinceUnix .result.UpdatedUnix ctx.Locale) | Safe}} {{end}}
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}}{{.ContextUser.FullName}}{{end}} {{.ContextUser.Name}}
- {{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}} · {{.NumFollowing}} {{.locale.Tr "user.following"}} + {{svg "octicon-person" 18 "gt-mr-2"}}{{.NumFollowers}} {{ctx.Locale.Tr "user.followers"}} · {{.NumFollowing}} {{ctx.Locale.Tr "user.following"}} {{if .EnableFeed}} {{svg "octicon-rss" 18}} {{end}} -- cgit v1.2.3