diff options
author | delvh <dev.lh@web.de> | 2023-09-25 10:56:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-25 08:56:50 +0000 |
commit | 7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (patch) | |
tree | cfcc4836ba1bb71518742f2aaf980f1f34248468 /templates/repo/activity.tmpl | |
parent | e6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff) | |
download | gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip |
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/repo/activity.tmpl')
-rw-r--r-- | templates/repo/activity.tmpl | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/templates/repo/activity.tmpl b/templates/repo/activity.tmpl index 444f21e779..252ca0264d 100644 --- a/templates/repo/activity.tmpl +++ b/templates/repo/activity.tmpl @@ -7,24 +7,24 @@ <!-- Period --> <div class="ui floating dropdown jump filter"> <div class="ui basic compact button"> - {{.locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong> + {{ctx.Locale.Tr "repo.activity.period.filter_label"}} <strong>{{.PeriodText}}</strong> {{svg "octicon-triangle-down" 14 "dropdown icon"}} </div> <div class="menu"> - <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{.locale.Tr "repo.activity.period.daily"}}</a> - <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{.locale.Tr "repo.activity.period.halfweekly"}}</a> - <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{.locale.Tr "repo.activity.period.weekly"}}</a> - <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{.locale.Tr "repo.activity.period.monthly"}}</a> - <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{.locale.Tr "repo.activity.period.quarterly"}}</a> - <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{.locale.Tr "repo.activity.period.semiyearly"}}</a> - <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{.locale.Tr "repo.activity.period.yearly"}}</a> + <a class="{{if eq .Period "daily"}}active {{end}}item" href="{{$.RepoLink}}/activity/daily">{{ctx.Locale.Tr "repo.activity.period.daily"}}</a> + <a class="{{if eq .Period "halfweekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/halfweekly">{{ctx.Locale.Tr "repo.activity.period.halfweekly"}}</a> + <a class="{{if eq .Period "weekly"}}active {{end}}item" href="{{$.RepoLink}}/activity/weekly">{{ctx.Locale.Tr "repo.activity.period.weekly"}}</a> + <a class="{{if eq .Period "monthly"}}active {{end}}item" href="{{$.RepoLink}}/activity/monthly">{{ctx.Locale.Tr "repo.activity.period.monthly"}}</a> + <a class="{{if eq .Period "quarterly"}}active {{end}}item" href="{{$.RepoLink}}/activity/quarterly">{{ctx.Locale.Tr "repo.activity.period.quarterly"}}</a> + <a class="{{if eq .Period "semiyearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/semiyearly">{{ctx.Locale.Tr "repo.activity.period.semiyearly"}}</a> + <a class="{{if eq .Period "yearly"}}active {{end}}item" href="{{$.RepoLink}}/activity/yearly">{{ctx.Locale.Tr "repo.activity.period.yearly"}}</a> </div> </div> </h2> <div class="divider"></div> {{if (or (.Permission.CanRead $.UnitTypeIssues) (.Permission.CanRead $.UnitTypePullRequests))}} - <h4 class="ui top attached header">{{.locale.Tr "repo.activity.overview"}}</h4> + <h4 class="ui top attached header">{{ctx.Locale.Tr "repo.activity.overview"}}</h4> <div class="ui attached segment two column grid"> {{if .Permission.CanRead $.UnitTypePullRequests}} <div class="column"> @@ -38,7 +38,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} + {{ctx.Locale.TrN .Activity.ActivePRCount "repo.activity.active_prs_count_1" "repo.activity.active_prs_count_n" .Activity.ActivePRCount | Safe}} </div> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} @@ -53,7 +53,7 @@ <a class="table-cell tiny background light grey"></a> </div> {{end}} - {{.locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} + {{ctx.Locale.TrN .Activity.ActiveIssueCount "repo.activity.active_issues_count_1" "repo.activity.active_issues_count_n" .Activity.ActiveIssueCount | Safe}} </div> {{end}} </div> @@ -61,21 +61,21 @@ {{if .Permission.CanRead $.UnitTypePullRequests}} <a href="#merged-pull-requests" class="ui attached segment text center"> <span class="text purple">{{svg "octicon-git-pull-request"}}</span> <strong>{{.Activity.MergedPRCount}}</strong><br> - {{.locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} + {{ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.merged_prs_count_1" "repo.activity.merged_prs_count_n"}} </a> <a href="#proposed-pull-requests" class="ui attached segment text center"> <span class="text green">{{svg "octicon-git-branch"}}</span> <strong>{{.Activity.OpenedPRCount}}</strong><br> - {{.locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} + {{ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.opened_prs_count_1" "repo.activity.opened_prs_count_n"}} </a> {{end}} {{if .Permission.CanRead $.UnitTypeIssues}} <a href="#closed-issues" class="ui attached segment text center"> <span class="text red">{{svg "octicon-issue-closed"}}</span> <strong>{{.Activity.ClosedIssueCount}}</strong><br> - {{.locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} + {{ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.closed_issues_count_1" "repo.activity.closed_issues_count_n"}} </a> <a href="#new-issues" class="ui attached segment text center"> <span class="text green">{{svg "octicon-issue-opened"}}</span> <strong>{{.Activity.OpenedIssueCount}}</strong><br> - {{.locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}} + {{ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.new_issues_count_1" "repo.activity.new_issues_count_n"}} </a> {{end}} </div> @@ -84,26 +84,26 @@ {{if .Permission.CanRead $.UnitTypeCode}} {{if eq .Activity.Code.CommitCountInAllBranches 0}} <div class="ui center aligned segment"> - <h4 class="ui header">{{.locale.Tr "repo.activity.no_git_activity"}}</h4> + <h4 class="ui header">{{ctx.Locale.Tr "repo.activity.no_git_activity"}}</h4> </div> {{end}} {{if gt .Activity.Code.CommitCountInAllBranches 0}} <div class="ui attached segment horizontal segments"> <div class="ui attached segment text"> - {{.locale.Tr "repo.activity.git_stats_exclude_merges"}} - <strong>{{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong> - {{.locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} - <strong>{{.locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} - <strong>{{.locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong> - {{.locale.Tr "repo.activity.git_stats_push_to_all_branches"}} - {{.locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} - <strong>{{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong> - {{.locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} - {{.locale.Tr "repo.activity.git_stats_additions"}} - <strong class="text green">{{.locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong> - {{.locale.Tr "repo.activity.git_stats_and_deletions"}} - <strong class="text red">{{.locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>. + {{ctx.Locale.Tr "repo.activity.git_stats_exclude_merges"}} + <strong>{{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_author_1" "repo.activity.git_stats_author_n" .Activity.Code.AuthorCount}}</strong> + {{ctx.Locale.TrN .Activity.Code.AuthorCount "repo.activity.git_stats_pushed_1" "repo.activity.git_stats_pushed_n"}} + <strong>{{ctx.Locale.TrN .Activity.Code.CommitCount "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCount}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_branch" .Repository.DefaultBranch}} + <strong>{{ctx.Locale.TrN .Activity.Code.CommitCountInAllBranches "repo.activity.git_stats_commit_1" "repo.activity.git_stats_commit_n" .Activity.Code.CommitCountInAllBranches}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_push_to_all_branches"}} + {{ctx.Locale.Tr "repo.activity.git_stats_on_default_branch" .Repository.DefaultBranch}} + <strong>{{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_file_1" "repo.activity.git_stats_file_n" .Activity.Code.ChangedFiles}}</strong> + {{ctx.Locale.TrN .Activity.Code.ChangedFiles "repo.activity.git_stats_files_changed_1" "repo.activity.git_stats_files_changed_n"}} + {{ctx.Locale.Tr "repo.activity.git_stats_additions"}} + <strong class="text green">{{ctx.Locale.TrN .Activity.Code.Additions "repo.activity.git_stats_addition_1" "repo.activity.git_stats_addition_n" .Activity.Code.Additions}}</strong> + {{ctx.Locale.Tr "repo.activity.git_stats_and_deletions"}} + <strong class="text red">{{ctx.Locale.TrN .Activity.Code.Deletions "repo.activity.git_stats_deletion_1" "repo.activity.git_stats_deletion_n" .Activity.Code.Deletions}}</strong>. </div> <div class="ui attached segment"> <div id="repo-activity-top-authors-chart"></div> @@ -115,15 +115,15 @@ {{if gt .Activity.PublishedReleaseCount 0}} <h4 class="divider divider-text gt-normal-case" id="published-releases"> {{svg "octicon-tag" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.releases_published_by" - (.locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount) - (.locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.releases_published_by" + (ctx.Locale.TrN .Activity.PublishedReleaseCount "repo.activity.title.releases_1" "repo.activity.title.releases_n" .Activity.PublishedReleaseCount) + (ctx.Locale.TrN .Activity.PublishedReleaseAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.PublishedReleaseAuthorCount) }} </h4> <div class="list"> {{range .Activity.PublishedReleases}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.published_release_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.published_release_label"}}</span> {{.TagName}} {{if not .IsTag}} <a class="title" href="{{$.RepoLink}}/src/{{.TagName | PathEscapeSegments}}">{{.Title | RenderEmoji $.Context}}</a> @@ -137,15 +137,15 @@ {{if gt .Activity.MergedPRCount 0}} <h4 class="divider divider-text gt-normal-case" id="merged-pull-requests"> {{svg "octicon-git-pull-request" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.prs_merged_by" - (.locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount) - (.locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.prs_merged_by" + (ctx.Locale.TrN .Activity.MergedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.MergedPRCount) + (ctx.Locale.TrN .Activity.MergedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.MergedPRAuthorCount) }} </h4> <div class="list"> {{range .Activity.MergedPRs}} <p class="desc"> - <span class="ui purple label">{{$.locale.Tr "repo.activity.merged_prs_label"}}</span> + <span class="ui purple label">{{ctx.Locale.Tr "repo.activity.merged_prs_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .MergedUnix $.locale}} </p> @@ -156,15 +156,15 @@ {{if gt .Activity.OpenedPRCount 0}} <h4 class="divider divider-text gt-normal-case" id="proposed-pull-requests"> {{svg "octicon-git-branch" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.prs_opened_by" - (.locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount) - (.locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.prs_opened_by" + (ctx.Locale.TrN .Activity.OpenedPRCount "repo.activity.title.prs_1" "repo.activity.title.prs_n" .Activity.OpenedPRCount) + (ctx.Locale.TrN .Activity.OpenedPRAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedPRAuthorCount) }} </h4> <div class="list"> {{range .Activity.OpenedPRs}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.opened_prs_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.opened_prs_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Issue.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .Issue.CreatedUnix $.locale}} </p> @@ -175,15 +175,15 @@ {{if gt .Activity.ClosedIssueCount 0}} <h4 class="divider divider-text gt-normal-case" id="closed-issues"> {{svg "octicon-issue-closed" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.issues_closed_from" - (.locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount) - (.locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.issues_closed_from" + (ctx.Locale.TrN .Activity.ClosedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.ClosedIssueCount) + (ctx.Locale.TrN .Activity.ClosedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.ClosedIssueAuthorCount) }} </h4> <div class="list"> {{range .Activity.ClosedIssues}} <p class="desc"> - <span class="ui red label">{{$.locale.Tr "repo.activity.closed_issue_label"}}</span> + <span class="ui red label">{{ctx.Locale.Tr "repo.activity.closed_issue_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .ClosedUnix $.locale}} </p> @@ -194,15 +194,15 @@ {{if gt .Activity.OpenedIssueCount 0}} <h4 class="divider divider-text gt-normal-case" id="new-issues"> {{svg "octicon-issue-opened" 16 "gt-mr-3"}} - {{.locale.Tr "repo.activity.title.issues_created_by" - (.locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount) - (.locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount) + {{ctx.Locale.Tr "repo.activity.title.issues_created_by" + (ctx.Locale.TrN .Activity.OpenedIssueCount "repo.activity.title.issues_1" "repo.activity.title.issues_n" .Activity.OpenedIssueCount) + (ctx.Locale.TrN .Activity.OpenedIssueAuthorCount "repo.activity.title.user_1" "repo.activity.title.user_n" .Activity.OpenedIssueAuthorCount) }} </h4> <div class="list"> {{range .Activity.OpenedIssues}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.new_issue_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.new_issue_label"}}</span> #{{.Index}} <a class="title" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> {{TimeSinceUnix .CreatedUnix $.locale}} </p> @@ -211,14 +211,14 @@ {{end}} {{if gt .Activity.UnresolvedIssueCount 0}} - <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{.locale.Tr "repo.activity.unresolved_conv_desc"}}"> + <h4 class="divider divider-text gt-normal-case" id="unresolved-conversations" data-tooltip-content="{{ctx.Locale.Tr "repo.activity.unresolved_conv_desc"}}"> {{svg "octicon-comment-discussion" 16 "gt-mr-3"}} - {{.locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} + {{ctx.Locale.TrN .Activity.UnresolvedIssueCount "repo.activity.title.unresolved_conv_1" "repo.activity.title.unresolved_conv_n" .Activity.UnresolvedIssueCount}} </h4> <div class="list"> {{range .Activity.UnresolvedIssues}} <p class="desc"> - <span class="ui green label">{{$.locale.Tr "repo.activity.unresolved_conv_label"}}</span> + <span class="ui green label">{{ctx.Locale.Tr "repo.activity.unresolved_conv_label"}}</span> #{{.Index}} {{if .IsPull}} <a class="title" href="{{$.RepoLink}}/pulls/{{.Index}}">{{.Title | RenderEmoji $.Context}}</a> |