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/issue/view_content.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/issue/view_content.tmpl')
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 5450df0a7a..8dd6dfc7d3 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -28,10 +28,10 @@ {{.Issue.OriginalAuthor}} </span> <span class="text grey muted-links"> - {{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} </span> <span class="text migrate"> - {{if .Repository.OriginalURL}} ({{$.locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} + {{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" (.Repository.OriginalURL|Escape) (.Repository.GetOriginalURLHostname|Escape) | Safe}}){{end}} </span> {{else}} <a class="inline-timeline-avatar" href="{{.Issue.Poster.HomeLink}}"> @@ -39,7 +39,7 @@ </a> <span class="text grey muted-links"> {{template "shared/user/authorlink" .Issue.Poster}} - {{.locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} + {{ctx.Locale.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} </span> {{end}} </div> @@ -56,7 +56,7 @@ {{if .Issue.RenderedContent}} {{.Issue.RenderedContent|Str2html}} {{else}} - <span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> {{end}} </div> <div id="issue-{{.Issue.ID}}-raw" class="raw-content gt-hidden">{{.Issue.Content}}</div> @@ -92,21 +92,21 @@ <div class="text right"> {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .DisableStatusChange)}} {{if .Issue.IsClosed}} - <button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{.locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen"> - {{.locale.Tr "repo.issues.reopen_issue"}} + <button id="status-button" class="ui primary basic button" tabindex="6" data-status="{{ctx.Locale.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.locale.Tr "repo.issues.reopen_comment_issue"}}" name="status" value="reopen"> + {{ctx.Locale.Tr "repo.issues.reopen_issue"}} </button> {{else}} {{$closeTranslationKey := "repo.issues.close"}} {{if .Issue.IsPull}} {{$closeTranslationKey = "repo.pulls.close"}} {{end}} - <button id="status-button" class="ui red basic button" tabindex="6" data-status="{{.locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close"> - {{.locale.Tr $closeTranslationKey}} + <button id="status-button" class="ui red basic button" tabindex="6" data-status="{{ctx.Locale.Tr $closeTranslationKey}}" data-status-and-comment="{{.locale.Tr "repo.issues.close_comment_issue"}}" name="status" value="close"> + {{ctx.Locale.Tr $closeTranslationKey}} </button> {{end}} {{end}} <button class="ui primary button" tabindex="5"> - {{.locale.Tr "repo.issues.create_comment"}} + {{ctx.Locale.Tr "repo.issues.create_comment"}} </button> </div> </div> @@ -116,9 +116,9 @@ {{else if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} {{end}} </div> {{end}} @@ -126,14 +126,14 @@ {{if .Repository.IsArchived}} <div class="ui warning message gt-text-center"> {{if .Issue.IsPull}} - {{.locale.Tr "repo.archive.pull.nocomment"}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} {{else}} - {{.locale.Tr "repo.archive.issue.nocomment"}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} {{end}} </div> {{else}} <div class="ui warning message"> - {{.locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}} + {{ctx.Locale.Tr "repo.issues.sign_in_require_desc" (.SignInLink|Escape) | Safe}} </div> {{end}} {{end}}{{/* end if: .IsSigned */}} @@ -162,8 +162,8 @@ <div class="field"> <div class="text right edit"> - <button class="ui basic cancel button" tabindex="3">{{.locale.Tr "repo.issues.cancel"}}</button> - <button class="ui primary save button" tabindex="2">{{.locale.Tr "repo.issues.save"}}</button> + <button class="ui basic cancel button" tabindex="3">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> + <button class="ui primary save button" tabindex="2">{{ctx.Locale.Tr "repo.issues.save"}}</button> </div> </div> </div> @@ -172,16 +172,16 @@ {{template "repo/issue/view_content/reference_issue_dialog" .}} <div class="gt-hidden" id="no-content"> - <span class="no-content">{{.locale.Tr "repo.issues.no_content"}}</span> + <span class="no-content">{{ctx.Locale.Tr "repo.issues.no_content"}}</span> </div> <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.branch.delete" .HeadTarget}} + {{ctx.Locale.Tr "repo.branch.delete" .HeadTarget}} </div> <div class="content"> - <p>{{.locale.Tr "repo.branch.delete_desc" | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.branch.delete_desc" | Str2html}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> |