go-i18n: github.com/nicksnyder/go-i18n/v2/goi18n Files

Command goi18n

Command goi18n manages message files used by the i18n package.

go get -u github.com/nicksnyder/go-i18n/v2/goi18n
goi18n -help

Use `goi18n extract` to create a message file that contains the messages defined in your Go source files.

# en.toml
[PersonCats]
description = "The number of cats a person has"
one = "{{.Name}} has {{.Count}} cat."
other = "{{.Name}} has {{.Count}} cats."

Use `goi18n merge` to create message files for translation.

# translate.es.toml
[PersonCats]
description = "The number of cats a person has"
hash = "sha1-f937a0e05e19bfe6cd70937c980eaf1f9832f091"
one = "{{.Name}} has {{.Count}} cat."
other = "{{.Name}} has {{.Count}} cats."

Use `goi18n merge` to merge translated message files with your existing message files.

# active.es.toml
[PersonCats]
description = "The number of cats a person has"
hash = "sha1-f937a0e05e19bfe6cd70937c980eaf1f9832f091"
one = "{{.Name}} tiene {{.Count}} gato."
other = "{{.Name}} tiene {{.Count}} gatos."

Load the active messages into your bundle.

bundle.RegisterUnmarshalFunc("toml", toml.Unmarshal)
bundle.MustLoadMessageFile("active.es.toml")

Package Files

extract_command.go main.go marshal.go merge_command.go

Package main imports 19 packages (graph). Updated 2020-05-21. Refresh now. Tools for package owners.