Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
Eliot Whalan 2017-05-09 10:17:35 +10:00
révision 4703035de9

Voir le fichier

@ -2,6 +2,7 @@ package languages
import ( import (
"github.com/nicksnyder/go-i18n/i18n" "github.com/nicksnyder/go-i18n/i18n"
"fmt"
"html/template" "html/template"
"net/http" "net/http"
) )
@ -9,8 +10,8 @@ import (
func SetTranslation(tmpl *template.Template, language string, languages ...string) { func SetTranslation(tmpl *template.Template, language string, languages ...string) {
T, _ := i18n.Tfunc(language, languages...) T, _ := i18n.Tfunc(language, languages...)
tmpl.Funcs(map[string]interface{}{ tmpl.Funcs(map[string]interface{}{
"T": func(str string) template.HTML { "T": func(str string, args ...interface{}) template.HTML {
return template.HTML(T(str)) return template.HTML(fmt.Sprintf(T(str), args...))
}, },
}) })
} }