Break HTML blocks to individual strings (#8903)

* Modifying message and templates about mfa_change

* Modifying message and templates about password_change

* Modify message and template about password_reset

* Modify message and template about singin_change

* Modify message and template about email_info

* Modify message and template about change_username

* Modify message about change_email

* Add missing props

* Add argument

* Modify message and template about token_added

* Modify messages and template about notification_email

* Modify message and template about deactivate_email

* Fix style

* Remove unused message

* Remove br tags

* Modify message and code about invite_mail

* Add missing message
Этот коммит содержится в:
Yusuke Nemoto
2018-07-21 01:52:20 +09:00
коммит произвёл Elias Nahum
родитель 908a682fcf
Коммит 6104c37761
15 изменённых файлов: 120 добавлений и 73 удалений

Просмотреть файл

@@ -11,6 +11,7 @@ import (
"io"
"path/filepath"
"reflect"
"strings"
"sync/atomic"
"github.com/fsnotify/fsnotify"
@@ -119,7 +120,10 @@ func (t *HTMLTemplate) RenderToWriter(w io.Writer) error {
}
func TranslateAsHtml(t i18n.TranslateFunc, translationID string, args map[string]interface{}) template.HTML {
return template.HTML(t(translationID, escapeForHtml(args)))
message := t(translationID, escapeForHtml(args))
message = strings.Replace(message, "[[", "<strong>", -1)
message = strings.Replace(message, "]]", "</strong>", -1)
return template.HTML(message)
}
func escapeForHtml(arg interface{}) interface{} {