diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 442ae17a9..0ead1dfd6 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -350,7 +350,7 @@ issue_assigned.issue = @%[1]s assigned you to the issue %[2]s in repository %[3] issue.x_mentioned_you = @%s mentioned you: issue.action.force_push = %[1]s force-pushed the %[2]s from %[3]s to %[4]s. -issue.action.push_1 = @%[1]s pushed 1 commit to %[2]s +issue.action.push_1 = @%[1]s pushed %[3]d commit to %[2]s issue.action.push_n = @%[1]s pushed %[3]d commits to %[2]s issue.action.close = @%[1]s closed #%[2]d. issue.action.reopen = @%[1]s reopened #%[2]d. diff --git a/services/mailer/mail.go b/services/mailer/mail.go index 7494d04f2..14512d7d6 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -72,6 +72,7 @@ func sendUserMail(language string, u *models.User, tpl base.TplName, code, subje // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var content bytes.Buffer @@ -110,6 +111,7 @@ func SendActivateEmailMail(u *models.User, email *models.EmailAddress) { // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var content bytes.Buffer @@ -136,6 +138,7 @@ func SendRegisterNotifyMail(u *models.User) { // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var content bytes.Buffer @@ -165,6 +168,7 @@ func SendCollaboratorMail(u, doer *models.User, repo *models.Repository) { // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var content bytes.Buffer @@ -248,6 +252,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var mailSubject bytes.Buffer diff --git a/services/mailer/mail_release.go b/services/mailer/mail_release.go index ff008be1d..f92d3a78f 100644 --- a/services/mailer/mail_release.go +++ b/services/mailer/mail_release.go @@ -68,6 +68,7 @@ func mailNewRelease(lang string, tos []string, rel *models.Release) { // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } var mailBody bytes.Buffer diff --git a/services/mailer/mail_repo.go b/services/mailer/mail_repo.go index 5ef67b7c6..4e629ee5c 100644 --- a/services/mailer/mail_repo.go +++ b/services/mailer/mail_repo.go @@ -63,6 +63,7 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *models.User, // helper "i18n": locale, "Str2html": templates.Str2html, + "TrN": templates.TrN, } if err := bodyTemplates.ExecuteTemplate(&content, string(mailRepoTransferNotify), data); err != nil { diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl index f7257f6e6..071acdcbc 100644 --- a/templates/mail/issue/default.tmpl +++ b/templates/mail/issue/default.tmpl @@ -30,11 +30,7 @@ {{.i18n.Tr "mail.issue.action.force_push" .Doer.Name .Comment.Issue.PullRequest.HeadBranch $oldCommitLink $newCommitLink | Str2html}} {{else}} - {{if eq .Comment.Commits.Len 1}} - {{.i18n.Tr "mail.issue.action.push_1" .Doer.Name .Comment.Issue.PullRequest.HeadBranch | Str2html}} - {{else}} - {{.i18n.Tr "mail.issue.action.push_n" .Doer.Name .Comment.Issue.PullRequest.HeadBranch .Comment.Commits.Len | Str2html}} - {{end}} + {{.i18n.Tr (TrN .i18n.Lang .Comment.Commits.Len "mail.issue.action.push_1" "mail.issue.action.push_n") .Doer.Name .Comment.Issue.PullRequest.HeadBranch .Comment.Commits.Len | Str2html}} {{end}}

{{end}}