-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Go version
go version go1.21.4 darwin/arm64
Output of go env in your module/workspace:
GO111MODULE='on'
GOARCH='arm64'
GOBIN='/Users/xxx/go/bin'
GOCACHE='/Users/xxx/Library/Caches/go-build'
GOENV='/Users/xxx/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/xxx/go/pkg/mod'
GOOS='darwin'
GOPATH='/Users/xxx/go'
GOROOT='/opt/homebrew/opt/go/libexec'
GOSUMDB='sum.golang.google.cn'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.4'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/b1/0fd1b6hs7lz0fm_mh346lybm0000gn/T/go-build2121787907=/tmp/go-build -gno-record-gcc-switches -fno-common'What did you do?
golang.org/x/text=v0.20.0
I use catalog.Var between two %d substitutions.
lang := language.English
v := catalog.Var("var", catalog.String("value"))
message.Set(lang, "key1", v, catalog.String("%d %d\n")) // two %d
message.Set(lang, "key2", v, catalog.String("%d ${var} %d\n")) // var between two %d
message.Set(lang, "key3", v, catalog.String("%d %d ${var}\n")) // var after two %d
message.Set(lang, "key4", v, catalog.String("%[1]d ${var} %[2]d\n")) // var between two %[?]d
printer := message.NewPrinter(lang)
printer.Printf("key1", 1, 2) // 1 2
printer.Printf("key2", 1, 2) // 1 %!(EXTRA int=2)value%!(EXTRA int=2) 2
printer.Printf("key3", 1, 2) // 1 2 value
printer.Printf("key4", 1, 2) // 1 value 2What did you see happen?
1 2
1 %!(EXTRA int=2)value%!(EXTRA int=2) 2
1 2 value
1 value 2
What did you expect to see?
1 2
1 value 2
1 2 value
1 value 2
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.