summaryrefslogtreecommitdiffstats
path: root/templates/mail/issue
diff options
context:
space:
mode:
Diffstat (limited to 'templates/mail/issue')
-rw-r--r--templates/mail/issue/assigned.tmpl12
-rw-r--r--templates/mail/issue/default.tmpl44
2 files changed, 33 insertions, 23 deletions
diff --git a/templates/mail/issue/assigned.tmpl b/templates/mail/issue/assigned.tmpl
index 5b0d2526f1..61e4a44f02 100644
--- a/templates/mail/issue/assigned.tmpl
+++ b/templates/mail/issue/assigned.tmpl
@@ -8,13 +8,21 @@
<title>{{.Subject}}</title>
</head>
+{{$repo_url := printf "<a href='%s'>%s</a>" .Release.Repo.HTMLURL .Release.Repo.FullName}}
+{{$link := printf "<a href='%s'>#%d</a>" .Link .Issue.Index}}
<body>
- <p>@{{.Doer.Name}} assigned you to the {{if .IsPull}}pull request{{else}}issue{{end}} <a href="{{.Link}}">#{{.Issue.Index}}</a> in repository {{.Repo}}.</p>
+ <p>
+ {{if .IsPull}}
+ {{.i18n.Tr "mail.issue_assigned.pull" .Doer.Name $link $repo_url | Str2html}}
+ {{else}}
+ {{.i18n.Tr "mail.issue_assigned.issue" .Doer.Name $link $repo_url | Str2html}}
+ {{end}}
+ </p>
<div class="footer">
<p>
---
<br>
- <a href="{{.Link}}">View it on {{AppName}}</a>.
+ <a href="{{.Link}}">{{.i18n.Tr "mail.view_it_on" AppName}}</a>.
</p>
</div>
</body>
diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl
index 02832c7e4d..61fe02037c 100644
--- a/templates/mail/issue/default.tmpl
+++ b/templates/mail/issue/default.tmpl
@@ -16,55 +16,57 @@
</head>
<body>
- {{if .IsMention}}<p><b>@{{.Doer.Name}}</b> mentioned you:</p>{{end}}
+ {{if .IsMention}}<p>{{.i18n.Tr "mail.issue.x_mentioned_you" .Doer.Name | Str2html}}</p>{{end}}
{{if eq .ActionName "push"}}
<p>
- <b>{{.Doer.Name}}</b>
{{if .Comment.IsForcePush}}
- {{ $oldCommitLink:= printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.OldCommit}}
- {{ $newCommitLink:= printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.NewCommit}}
- force-pushed the <b>{{.Comment.Issue.PullRequest.HeadBranch}}</b> from
- <a href="{{$oldCommitLink}}"><b>{{ShortSha .Comment.OldCommit}}</b></a>
- to
- <a href="{{$newCommitLink}}"><b>{{ShortSha .Comment.NewCommit}}</b></a>.
+ {{$oldCommitUrl := printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.OldCommit}}
+ {{$oldShortSha := ShortSha .Comment.OldCommit}}
+ {{$oldCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" $oldCommitUrl $oldShortSha}}
+
+ {{$newCommitUrl := printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.NewCommit}}
+ {{$newShortSha := ShortSha .Comment.NewCommit}}
+ {{$newCommitLink := printf "<a href='%[1]s'><b>%[2]s</b></a>" $newCommitUrl $newShortSha}}
+
+ {{.i18n.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink | Str2html}}
{{else}}
{{if eq .Comment.Commits.Len 1}}
- {{printf "pushed 1 commit to %s:" .Comment.Issue.PullRequest.HeadBranch}}
+ {{.i18n.Tr "mail.issue.action.push_1" .Doer.Name .Comment.Issue.PullRequest.HeadBranch | Str2html}}
{{else}}
- {{printf "pushed %d commits to %s:" .Comment.Commits.Len .Comment.Issue.PullRequest.HeadBranch}}
+ {{.i18n.Tr "mail.issue.action.push_1" .Doer.Name .Comment.Issue.PullRequest.HeadBranch .Comment.Commits.Len | Str2html}}
{{end}}
{{end}}
</p>
{{end}}
<p>
{{if eq .ActionName "close"}}
- Closed #{{.Issue.Index}}.
+ {{.i18n.Tr "mail.issue.action.close" .Doer.Name .Issue.Index | Str2html}}
{{else if eq .ActionName "reopen"}}
- Reopened #{{.Issue.Index}}.
+ {{.i18n.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index | Str2html}}
{{else if eq .ActionName "merge"}}
- Merged #{{.Issue.Index}} into {{.Issue.PullRequest.BaseBranch}}.
+ {{.i18n.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch | Str2html}}
{{else if eq .ActionName "approve"}}
- <b>@{{.Doer.Name}}</b> approved this pull request.
+ {{.i18n.Tr "mail.issue.action.approve" .Doer.Name | Str2html}}
{{else if eq .ActionName "reject"}}
- <b>@{{.Doer.Name}}</b> requested changes on this pull request.
+ {{.i18n.Tr "mail.issue.action.reject" .Doer.Name | Str2html}}
{{else if eq .ActionName "review"}}
- <b>@{{.Doer.Name}}</b> commented on this pull request.
+ {{.i18n.Tr "mail.issue.action.review" .Doer.Name | Str2html}}
{{else if eq .ActionName "review_dismissed"}}
- <b>@{{.Doer.Name}}</b> dismissed last review from {{.Comment.Review.Reviewer.Name}} for this pull request.
+ {{.i18n.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name | Str2html}}
{{else if eq .ActionName "ready_for_review"}}
- <b>@{{.Doer.Name}}</b> marked this pull request ready for review.
+ {{.i18n.Tr "mail.issue.action.ready_for_review" .Doer.Name | Str2html}}
{{end}}
{{- if eq .Body ""}}
{{if eq .ActionName "new"}}
- Created #{{.Issue.Index}}.
+ {{.i18n.Tr "mail.issue.action.new" .Doer.Name .Issue.Index | Str2html}}
{{end}}
{{else}}
{{.Body | Str2html}}
{{end -}}
{{- range .ReviewComments}}
<hr>
- In {{.TreePath}}:
+ {{.i18n.Tr "mail.issue.in_tree_path" .TreePath}}
<div class="review">
<pre>{{.Patch}}</pre>
<div>{{.RenderedContent | Safe}}</div>
@@ -87,7 +89,7 @@
<p>
---
<br>
- <a href="{{.Link}}">View it on {{AppName}}</a>.
+ <a href="{{.Link}}">{{.i18n.Tr "mail.view_it_on" AppName}}</a>.
</p>
</div>
</body>