Description
go-i18n is a Go package and command-line tool for translating Go programs into several languages. The package looks up messages according to a set of locale preferences, using a bundle that you load translations into when the application starts, and a localiser for each set of language preferences. Plurals are supported for more than 200 languages from the Unicode Common Locale Data Repository, and the code for those rules is generated from that data. Messages can contain named variables using text/template syntax, and message files can be JSON, TOML, YAML or other formats. The goi18n command extracts the messages from i18n.Message literals in Go source into a message file, merges message files to create a translation file for a new language, and merges translated messages back in when you add or change text. The README gives step-by-step workflows for adding a new language and for translating new messages. The project is available under the MIT licence, and it has documentation, examples and an example application.…
Highlights
- Message lookup by locale preferences
- Plurals for more than 200 languages
- Named variables with text/template
- JSON, TOML and YAML message files
- goi18n extract and merge commands
Ratings & Reviews
No ratings yet
Be the first to rate Go I18n.
People also visit
NG Extract I18n Merge
Extract and merge i18n xliff translation files for angular projects
Go I18n FAQ
What is go-i18n?
A Go package and command for translating Go programs into multiple languages.
Which languages are supported?
Plurals work for more than 200 languages from the Unicode CLDR data, and you can translate into any language you add.
What file formats are supported?
Message files can be JSON, TOML, YAML or other formats.
How do I add a new language?
Create an empty message file, run goi18n merge to populate it, translate it, rename it to active, and load it into the bundle, as the README explains.
Does it find messages in my code?
Yes. goi18n extract collects the i18n.Message literals from Go source files.
What license is it under?
MIT, as the README states.
What are the best Go I18n alternatives?
Popular alternatives to Go I18n include Gotext, GT and NG Extract I18n Merge. See all Go I18n alternatives





