Backport ctx locale refactoring manually (#27231) (#27259) (#27260)

Backport #27231 #27259 manually

---------

Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
wxiaoguang
2023-09-25 21:15:51 +08:00
committed by GitHub
parent 2774a2afc6
commit 597b04fe2f
314 changed files with 3888 additions and 3889 deletions

View File

@@ -12,30 +12,30 @@
</a>
<span class="label-list">
{{if .IsArchived}}
<span class="ui basic label">{{$.locale.Tr "repo.desc.archived"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.archived"}}</span>
{{end}}
{{if .IsTemplate}}
{{if .IsPrivate}}
<span class="ui basic label">{{$.locale.Tr "repo.desc.private_template"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private_template"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{$.locale.Tr "repo.desc.internal_template"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal_template"}}</span>
{{end}}
{{end}}
{{else}}
{{if .IsPrivate}}
<span class="ui basic label">{{$.locale.Tr "repo.desc.private"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.private"}}</span>
{{else}}
{{if .Owner.Visibility.IsPrivate}}
<span class="ui basic label">{{$.locale.Tr "repo.desc.internal"}}</span>
<span class="ui basic label">{{ctx.Locale.Tr "repo.desc.internal"}}</span>
{{end}}
{{end}}
{{end}}
</span>
{{if .IsFork}}
<span data-tooltip-content="{{$.locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
<span data-tooltip-content="{{ctx.Locale.Tr "repo.fork"}}">{{svg "octicon-repo-forked"}}</span>
{{else if .IsMirror}}
<span data-tooltip-content="{{$.locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
<span data-tooltip-content="{{ctx.Locale.Tr "mirror"}}">{{svg "octicon-mirror"}}</span>
{{end}}
</div>
<div class="flex-item-trailing">
@@ -61,12 +61,12 @@
{{end}}
</div>
{{end}}
<div class="flex-item-body">{{$.locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix $.locale}}</div>
<div class="flex-item-body">{{ctx.Locale.Tr "org.repo_updated"}} {{TimeSinceUnix .UpdatedUnix ctx.Locale}}</div>
</div>
</div>
{{else}}
<div>
{{$.locale.Tr "explore.repo_no_results"}}
{{ctx.Locale.Tr "explore.repo_no_results"}}
</div>
{{end}}
</div>