Skip to content
/ i18n Public

A Go internationalization library that provides template integration and message extraction capabilities. This library offers a simple way to add i18n support to Go applications using Go templates, with automatic message extraction and integration with Go's standard `golang.org/x/text` package.

License

Notifications You must be signed in to change notification settings

gowool/i18n

Repository files navigation

I18N

Go Reference Go Report Card codecov License

A Go internationalization library that provides template integration and message extraction capabilities. This library offers a simple way to add i18n support to Go applications using Go templates, with automatic message extraction and integration with Go's standard golang.org/x/text package.

Installation

go get github.com/gowool/i18n

# install tool
go get -tool github.com/gowool/i18n/cmd/i18n
go get -tool golang.org/x/text/cmd/gotext

Extractor

package locales

//go:generate go tool i18n extract --dir ./themes --pkg locales --out locales/messages.json --gofile locales/gotext_stub.go --ext .html --ext .gohtml
//go:generate go tool gotext -srclang=en-US update -out=catalog.go -lang=en-US,it-IT,fr-FR,de-DE github.com/dummy/example/locales
go generate ./...

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Go internationalization library that provides template integration and message extraction capabilities. This library offers a simple way to add i18n support to Go applications using Go templates, with automatic message extraction and integration with Go's standard `golang.org/x/text` package.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages