mirror of
https://github.com/go-gitea/gitea
synced 2025-07-27 20:58:36 +00:00
Always use ctx.Locale.Tr
inside templates (#27231)
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user