From d55a0b723809f5b94acd948b924c8518014445e0 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 27 Jun 2022 22:58:46 +0200 Subject: Refactor `i18n` to `locale` (#20153) * Refactor `i18n` to `locale` - Currently we're using the `i18n` variable naming for the `locale` struct. This contains locale's specific information and cannot be used for general i18n purpose, therefore refactoring it to `locale` makes more sense. - Ref: https://github.com/go-gitea/gitea/pull/20096#discussion_r906699200 * Update routers/install/install.go --- templates/repo/diff/blob_excerpt.tmpl | 14 +++---- templates/repo/diff/box.tmpl | 62 ++++++++++++++-------------- templates/repo/diff/comment_form.tmpl | 20 ++++----- templates/repo/diff/comments.tmpl | 16 +++---- templates/repo/diff/compare.tmpl | 46 ++++++++++----------- templates/repo/diff/conversation.tmpl | 16 +++---- templates/repo/diff/image_diff.tmpl | 22 +++++----- templates/repo/diff/new_review.tmpl | 12 +++--- templates/repo/diff/options_dropdown.tmpl | 16 +++---- templates/repo/diff/section_split.tmpl | 20 ++++----- templates/repo/diff/section_unified.tmpl | 6 +-- templates/repo/diff/stats.tmpl | 2 +- templates/repo/diff/whitespace_dropdown.tmpl | 12 +++--- 13 files changed, 132 insertions(+), 132 deletions(-) (limited to 'templates/repo/diff') diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index 7ea33dcf9a..04d271a444 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -19,20 +19,20 @@ {{end}} - {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}} + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}} {{else}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}} - {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.LeftIdx}}{{end}} {{/* - */}}{{if $line.LeftIdx}}{{$inlineDiff.Content}}{{end}}{{/* + */}}{{if $line.LeftIdx}}{{$inlineDiff.Content}}{{end}}{{/* */}} - {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.RightIdx}}{{end}} {{/* - */}}{{if $line.RightIdx}}{{$inlineDiff.Content}}{{end}}{{/* + */}}{{if $line.RightIdx}}{{$inlineDiff.Content}}{{end}}{{/* */}} {{end}} @@ -63,9 +63,9 @@ {{end}} {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}} - {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} + {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} - {{$inlineDiff.Content}} + {{$inlineDiff.Content}} {{end}} {{end}} diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index fdc6db2f1a..464b1359d8 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -10,18 +10,18 @@ -

{{.i18n.Tr "repo.diff.data_not_available"}}

+

{{.locale.Tr "repo.diff.data_not_available"}}

{{else}}
- {{svg "octicon-diff" 16 "mr-2"}}{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}} + {{svg "octicon-diff" 16 "mr-2"}}{{.locale.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
{{if and .PageIsPullFiles $.SignedUserID (not .IsArchived)}} -