Localize Email Templates (#16200)

close #14822
This commit is contained in:
6543 2021-06-23 14:33:21 +02:00 committed by GitHub
parent d4ae87ea32
commit be81dc8b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 144 additions and 72 deletions

View file

@ -9,6 +9,7 @@ import (
"fmt"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/templates"
"code.gitea.io/gitea/modules/translation"
)
@ -57,12 +58,13 @@ func sendRepoTransferNotifyMailPerLang(lang string, newOwner, doer *models.User,
"Repo": repo.FullName(),
"Link": repo.HTMLURL(),
"Subject": subject,
"i18n": locale,
"Language": locale.Language(),
"Destination": destination,
// helper
"i18n": locale,
"Str2html": templates.Str2html,
}
// TODO: i18n templates?
if err := bodyTemplates.ExecuteTemplate(&content, string(mailRepoTransferNotify), data); err != nil {
return err
}