aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/pulls
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-06-27 22:58:46 +0200
committerGitHub <noreply@github.com>2022-06-27 15:58:46 -0500
commitd55a0b723809f5b94acd948b924c8518014445e0 (patch)
tree0ef9ea54f30769ca1d16ce20e551bd7a078f7f5e /templates/repo/pulls
parentb551bc2a089d3310dde5706d1b9702f112fe3ea0 (diff)
downloadgitea-d55a0b723809f5b94acd948b924c8518014445e0.tar.gz
gitea-d55a0b723809f5b94acd948b924c8518014445e0.zip
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
Diffstat (limited to 'templates/repo/pulls')
-rw-r--r--templates/repo/pulls/commits.tmpl2
-rw-r--r--templates/repo/pulls/files.tmpl2
-rw-r--r--templates/repo/pulls/fork.tmpl20
-rw-r--r--templates/repo/pulls/status.tmpl16
-rw-r--r--templates/repo/pulls/tab_menu.tmpl6
5 files changed, 23 insertions, 23 deletions
diff --git a/templates/repo/pulls/commits.tmpl b/templates/repo/pulls/commits.tmpl
index 7152e345c3..64f377d7a4 100644
--- a/templates/repo/pulls/commits.tmpl
+++ b/templates/repo/pulls/commits.tmpl
@@ -5,7 +5,7 @@
<div class="navbar">
{{template "repo/issue/navbar" .}}
<div class="ui right">
- <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | PathEscapeSegments}}...{{.PullRequestCtx.HeadInfoSubURL}}">{{.i18n.Tr "repo.pulls.new"}}</a>
+ <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | PathEscapeSegments}}...{{.PullRequestCtx.HeadInfoSubURL}}">{{.locale.Tr "repo.pulls.new"}}</a>
</div>
</div>
<div class="ui divider"></div>
diff --git a/templates/repo/pulls/files.tmpl b/templates/repo/pulls/files.tmpl
index ede487d31b..9b24000002 100644
--- a/templates/repo/pulls/files.tmpl
+++ b/templates/repo/pulls/files.tmpl
@@ -9,7 +9,7 @@
<div class="navbar">
{{template "repo/issue/navbar" .}}
<div class="ui right">
- <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | PathEscapeSegments}}...{{.PullRequestCtx.HeadInfoSubURL}}">{{.i18n.Tr "repo.pulls.new"}}</a>
+ <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | PathEscapeSegments}}...{{.PullRequestCtx.HeadInfoSubURL}}">{{.locale.Tr "repo.pulls.new"}}</a>
</div>
</div>
<div class="ui divider"></div>
diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl
index f5ca0e4769..0172e1b708 100644
--- a/templates/repo/pulls/fork.tmpl
+++ b/templates/repo/pulls/fork.tmpl
@@ -5,12 +5,12 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
- {{.i18n.Tr "new_fork"}}
+ {{.locale.Tr "new_fork"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<div class="inline required field {{if .Err_Owner}}error{{end}}">
- <label>{{.i18n.Tr "repo.owner"}}</label>
+ <label>{{.locale.Tr "repo.owner"}}</label>
<div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
@@ -36,32 +36,32 @@
</div>
<div class="inline field">
- <label>{{.i18n.Tr "repo.fork_from"}}</label>
+ <label>{{.locale.Tr "repo.fork_from"}}</label>
<a href="{{.ForkRepo.Link}}">{{.ForkRepo.FullName}}</a>
</div>
<div class="inline required field {{if .Err_RepoName}}error{{end}}">
- <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
+ <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label>
<input id="repo_name" name="repo_name" value="{{.repo_name}}" required>
</div>
<div class="inline field">
- <label>{{.i18n.Tr "repo.visibility"}}</label>
+ <label>{{.locale.Tr "repo.visibility"}}</label>
<div class="ui read-only checkbox">
<input type="checkbox" {{if .IsPrivate}}checked{{end}}>
- <label>{{.i18n.Tr "repo.visibility_helper" | Safe}}</label>
+ <label>{{.locale.Tr "repo.visibility_helper" | Safe}}</label>
</div>
- <span class="help">{{.i18n.Tr "repo.fork_visibility_helper"}}</span>
+ <span class="help">{{.locale.Tr "repo.fork_visibility_helper"}}</span>
</div>
<div class="inline field {{if .Err_Description}}error{{end}}">
- <label for="description">{{.i18n.Tr "repo.repo_desc"}}</label>
+ <label for="description">{{.locale.Tr "repo.repo_desc"}}</label>
<textarea id="description" name="description">{{.description}}</textarea>
</div>
<div class="inline field">
<label></label>
<button class="ui green button">
- {{.i18n.Tr "repo.fork_repo"}}
+ {{.locale.Tr "repo.fork_repo"}}
</button>
- <a class="ui button" href="{{.ForkRepo.Link}}">{{.i18n.Tr "cancel"}}</a>
+ <a class="ui button" href="{{.ForkRepo.Link}}">{{.locale.Tr "cancel"}}</a>
</div>
</div>
</form>
diff --git a/templates/repo/pulls/status.tmpl b/templates/repo/pulls/status.tmpl
index f029d5cb6c..b68802cd56 100644
--- a/templates/repo/pulls/status.tmpl
+++ b/templates/repo/pulls/status.tmpl
@@ -2,17 +2,17 @@
{{if not $.Issue.PullRequest.HasMerged}}
<div class="ui top attached header">
{{if eq .LatestCommitStatus.State "pending"}}
- {{$.i18n.Tr "repo.pulls.status_checking"}}
+ {{$.locale.Tr "repo.pulls.status_checking"}}
{{else if eq .LatestCommitStatus.State "success"}}
- {{$.i18n.Tr "repo.pulls.status_checks_success"}}
+ {{$.locale.Tr "repo.pulls.status_checks_success"}}
{{else if eq .LatestCommitStatus.State "warning"}}
- {{$.i18n.Tr "repo.pulls.status_checks_warning"}}
+ {{$.locale.Tr "repo.pulls.status_checks_warning"}}
{{else if eq .LatestCommitStatus.State "failure"}}
- {{$.i18n.Tr "repo.pulls.status_checks_failure"}}
+ {{$.locale.Tr "repo.pulls.status_checks_failure"}}
{{else if eq .LatestCommitStatus.State "error"}}
- {{$.i18n.Tr "repo.pulls.status_checks_error"}}
+ {{$.locale.Tr "repo.pulls.status_checks_error"}}
{{else}}
- {{$.i18n.Tr "repo.pulls.status_checking"}}
+ {{$.locale.Tr "repo.pulls.status_checking"}}
{{end}}
</div>
{{end}}
@@ -23,9 +23,9 @@
<span class="ui">{{.Context}} <span class="text grey">{{.Description}}</span></span>
<div class="ui right">
{{if $.is_context_required}}
- {{if (call $.is_context_required .Context)}}<div class="ui label">{{$.i18n.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
+ {{if (call $.is_context_required .Context)}}<div class="ui label">{{$.locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}}
{{end}}
- <span class="ui">{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.i18n.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
+ <span class="ui">{{if .TargetURL}}<a href="{{.TargetURL}}">{{$.locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span>
</div>
</div>
{{end}}
diff --git a/templates/repo/pulls/tab_menu.tmpl b/templates/repo/pulls/tab_menu.tmpl
index 376c754f9e..f6554c676d 100644
--- a/templates/repo/pulls/tab_menu.tmpl
+++ b/templates/repo/pulls/tab_menu.tmpl
@@ -1,17 +1,17 @@
<div class="ui top attached pull tabular stackable menu">
<a class="item {{if .PageIsPullConversation}}active{{end}}" href="{{.Issue.Link}}">
{{svg "octicon-comment-discussion"}}
- {{$.i18n.Tr "repo.pulls.tab_conversation"}}
+ {{$.locale.Tr "repo.pulls.tab_conversation"}}
<span class="ui {{if not .Issue.NumComments}}gray{{else}}primary{{end}} small label">{{.Issue.NumComments}}</span>
</a>
<a class="item {{if .PageIsPullCommits}}active{{end}}" {{if .NumCommits}}href="{{.Issue.Link}}/commits"{{end}}>
{{svg "octicon-git-commit"}}
- {{$.i18n.Tr "repo.pulls.tab_commits"}}
+ {{$.locale.Tr "repo.pulls.tab_commits"}}
<span class="ui {{if not .NumCommits}}gray{{else}}primary{{end}} small label">{{if .NumCommits}}{{.NumCommits}}{{else}}N/A{{end}}</span>
</a>
<a class="item {{if .PageIsPullFiles}}active{{end}}" {{if .NumFiles}}href="{{.Issue.Link}}/files"{{end}}>
{{svg "octicon-diff"}}
- {{$.i18n.Tr "repo.pulls.tab_files"}}
+ {{$.locale.Tr "repo.pulls.tab_files"}}
<span class="ui {{if not .NumFiles}}gray{{else}}primary{{end}} small label">{{if .NumFiles}}{{.NumFiles}}{{else}}N/A{{end}}</span>
</a>
</div>