Skip to content

Commit cf28856

Browse files
committed
issue_default
1 parent 148b466 commit cf28856

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

options/locale/locale_en-US.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,20 @@ register_success = Registration successful
340340
issue_assigned.pull = @%[1]s assigned you to the pull request <a href="@%[2]s">#@%[3]d</a> in repository %[4]s.
341341
issue_assigned.issue = @%[1]s assigned you to the issue <a href="@%[2]s">#@%[3]d</a> in repository %[4]s.
342342
343+
issue.x_mentioned_you = <b>@%s</b> mentioned you:
344+
issue.action.force_push = <b>%[1]s</b> force-pushed the <b>%[2]s</b> from <a href="%[3]s"><b>%[4]s</b></a> to <a href="%[5]s"><b>%[6]s</b></a>.
345+
issue.action.push_1 = <b>@%[1]s</b> pushed 1 commit to %[2]s
346+
issue.action.push_n = <b>@%[1]s</b> pushed %[3]d commits to %s: %[2]s
347+
issue.action.close = Closed #%[2]d.
348+
issue.action.reopen = Reopened #%[2]d.
349+
issue.action.merge = Merged #%[2]d into #%[3]s.
350+
issue.action.approve = <b>@%[1]s</b> approved this pull request.
351+
issue.action.reject = <b>@%[1]s</b> requested changes on this pull request.
352+
issue.action.review = <b>@%[1]s</b> commented on this pull request.
353+
issue.action.review_dismissed = <b>@%[1]s</b> dismissed last review from %[2]s for this pull request.
354+
issue.action.new = Created #%[2]d.
355+
issue.in_tree_path = In %s:
356+
343357
release.new.subject = %s in %s released
344358
345359
repo.transfer.subject_to = %s would like to transfer "%s" to %s

templates/mail/issue/default.tmpl

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,51 @@
1616
</head>
1717

1818
<body>
19-
{{if .IsMention}}<p><b>@{{.Doer.Name}}</b> mentioned you:</p>{{end}}
19+
{{if .IsMention}}<p>{{.i18n.Tr "mail.issue.x_mentioned_you" .Doer.Name | Str2html}}</p>{{end}}
2020
{{if eq .ActionName "push"}}
2121
<p>
22-
<b>{{.Doer.Name}}</b>
2322
{{if .Comment.IsForcePush}}
24-
{{ $oldCommitLink:= printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.OldCommit}}
25-
{{ $newCommitLink:= printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.NewCommit}}
26-
force-pushed the <b>{{.Comment.Issue.PullRequest.HeadBranch}}</b> from
27-
<a href="{{$oldCommitLink}}"><b>{{ShortSha .Comment.OldCommit}}</b></a>
28-
to
29-
<a href="{{$newCommitLink}}"><b>{{ShortSha .Comment.NewCommit}}</b></a>.
23+
{{$oldCommitLink := printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.OldCommit}}
24+
{{$oldShortSha := ShortSha .Comment.OldCommit}}
25+
{{$newCommitLink := printf "%s%s/%s/commit/%s" AppUrl .Comment.Issue.PullRequest.BaseRepo.OwnerName .Comment.Issue.PullRequest.BaseRepo.Name .Comment.NewCommit}}
26+
{{$newShortSha := ShortSha .Comment.NewCommit}}
27+
{{.i18n.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $oldShortSha $newCommitLink $newShortSha | Str2html}}
3028
{{else}}
3129
{{if eq .Comment.Commits.Len 1}}
32-
{{printf "pushed 1 commit to %s:" .Comment.Issue.PullRequest.HeadBranch}}
30+
{{.i18n.Tr "mail.issue.action.push_1" .Doer.Name .Comment.Issue.PullRequest.HeadBranch | Str2html}}
3331
{{else}}
34-
{{printf "pushed %d commits to %s:" .Comment.Commits.Len .Comment.Issue.PullRequest.HeadBranch}}
32+
{{.i18n.Tr "mail.issue.action.push_1" .Doer.Name .Comment.Issue.PullRequest.HeadBranch .Comment.Commits.Len | Str2html}}
3533
{{end}}
3634
{{end}}
3735
</p>
3836
{{end}}
3937
<p>
4038
{{if eq .ActionName "close"}}
41-
Closed #{{.Issue.Index}}.
39+
{{.i18n.Tr "mail.issue.action.close" .Doer.Name .Issue.Index | Str2html}}
4240
{{else if eq .ActionName "reopen"}}
43-
Reopened #{{.Issue.Index}}.
41+
{{.i18n.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index | Str2html}}
4442
{{else if eq .ActionName "merge"}}
45-
Merged #{{.Issue.Index}} into {{.Issue.PullRequest.BaseBranch}}.
43+
{{.i18n.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch | Str2html}}
4644
{{else if eq .ActionName "approve"}}
47-
<b>@{{.Doer.Name}}</b> approved this pull request.
45+
{{.i18n.Tr "mail.issue.action.approve" .Doer.Name | Str2html}}
4846
{{else if eq .ActionName "reject"}}
49-
<b>@{{.Doer.Name}}</b> requested changes on this pull request.
47+
{{.i18n.Tr "mail.issue.action.reject" .Doer.Name | Str2html}}
5048
{{else if eq .ActionName "review"}}
51-
<b>@{{.Doer.Name}}</b> commented on this pull request.
49+
{{.i18n.Tr "mail.issue.action.review" .Doer.Name | Str2html}}
5250
{{else if eq .ActionName "review_dismissed"}}
53-
<b>@{{.Doer.Name}}</b> dismissed last review from {{.Comment.Review.Reviewer.Name}} for this pull request.
51+
{{.i18n.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name | Str2html}}
5452
{{end}}
5553

5654
{{- if eq .Body ""}}
5755
{{if eq .ActionName "new"}}
58-
Created #{{.Issue.Index}}.
56+
{{.i18n.Tr "mail.issue.action.new" .Doer.Name .Issue.Index | Str2html}}
5957
{{end}}
6058
{{else}}
6159
{{.Body | Str2html}}
6260
{{end -}}
6361
{{- range .ReviewComments}}
6462
<hr>
65-
In {{.TreePath}}:
63+
{{.i18n.Tr "mail.issue.in_tree_path" .TreePath}}
6664
<div class="review">
6765
<pre>{{.Patch}}</pre>
6866
<div>{{.RenderedContent | Safe}}</div>

0 commit comments

Comments
 (0)