Open kalbasit opened 3 years ago
Change https://golang.org/cl/356314 mentions this issue: x/text: translate messages formatted via non-printf methods
Translations are only done for format strings or substitutions in %m
. So this is intentional.
In my opinion, also translating strings for Print
variants is undesirable. But even if it is, this would now be a backwards incompatible change.
To print without a message, one can use p.Printf("%m", str)
.
When using the message printer, I can translate fine with the Printf variants (Sprintf, Fprintf, Printf) but I don't get the translation for the Print variants (Sprint, Fprint, Print).
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The following code is also available on the playground: https://play.golang.org/p/FHjZ3a8ug51
What did you expect to see?
What did you see instead?
@kaskavalci mentioned this problem in https://github.com/golang/go/issues/26767#issuecomment-446170489
cc @mpvl