Hi!
I am trying to more easily add text into my go html templates, that I
can translate at a later stage.
So I tried adding the following in my handler
```go
p := i18nPrinter(c) // *message.Printer, uses golang's i18n library
c.HTML(http.StatusOK, "my-template.tmpl", gin.H{
"p": p,
})
```
And then within my-template, I do the following to print a specific string.
```gohtml
<p>{{ .p.Sprintf "Hello world" }}</p>
```
And then to generate translations:
```sh
$ go generate i18n/i18n.go
```
I would expect "Hello world" to show up as a list of items that need
translations, however, it seems not to.
It'd be nice if I could add the Sprintf statements directly within the
go templates, as that would lower the indirection needed.
Is there a way to accomplish that? Or is it unsupported?
Sincerely,
--
Marc
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/golang-nuts/874j406cn7.fsf%40mccd.space.