#Support for Other Languages in Go

6 messages · Page 1 of 1 (latest)

tall badger
#

So I'm starting a Go project, but I want multilingual support.
I see that go has i18n: https://github.com/nicksnyder/go-i18n, but I'm unsure of how I'd actually have this applied at compile time? How do Go programs usually do multilingual support?

#

correction, not necessarily at compile time, but just applied... in general

#

probably set by locale?

autumn plaza
#

I usually just create a map[string]string, that stores the translations (or load from a embed json file if you want do lazy loading).

And then if the message is not complex, I'll just simply fmt.Sprintf it.

tall badger
#

thanks