summaryrefslogtreecommitdiffstats
path: root/services/mailer/mail_release.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-06-23 14:33:21 +0200
committerGitHub <noreply@github.com>2021-06-23 14:33:21 +0200
commitbe81dc8b20b86c87031cd1d2d7c9a2fe82f52ba8 (patch)
treeef1705f5c1dd04e8e1810af127aa5bd1afaed478 /services/mailer/mail_release.go
parentd4ae87ea32aaef458da48404b8c7bc11d0165852 (diff)
downloadgitea-be81dc8b20b86c87031cd1d2d7c9a2fe82f52ba8.tar.gz
gitea-be81dc8b20b86c87031cd1d2d7c9a2fe82f52ba8.zip
Localize Email Templates (#16200)
close #14822
Diffstat (limited to 'services/mailer/mail_release.go')
-rw-r--r--services/mailer/mail_release.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/mailer/mail_release.go b/services/mailer/mail_release.go
index 1e12fe13ac..ff008be1d8 100644
--- a/services/mailer/mail_release.go
+++ b/services/mailer/mail_release.go
@@ -13,6 +13,7 @@ import (
"code.gitea.io/gitea/modules/markup"
"code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/translation"
)
@@ -63,13 +64,14 @@ func mailNewRelease(lang string, tos []string, rel *models.Release) {
mailMeta := map[string]interface{}{
"Release": rel,
"Subject": subject,
- "i18n": locale,
"Language": locale.Language(),
+ // helper
+ "i18n": locale,
+ "Str2html": templates.Str2html,
}
var mailBody bytes.Buffer
- // TODO: i18n templates?
if err := bodyTemplates.ExecuteTemplate(&mailBody, string(tplNewReleaseMail), mailMeta); err != nil {
log.Error("ExecuteTemplate [%s]: %v", string(tplNewReleaseMail)+"/body", err)
return