go-i18n is a Go package and command-line tool that helps translate Go programs into multiple languages.
The tool addresses the challenge of managing translations across many languages by providing two complementary components. The package offers runtime message lookup based on locale preferences through a Bundle that loads translations and a Localizer that retrieves messages for specific language preferences. The command-line tool automates the translation workflow: it extracts message literals from Go source code, merges them into language-specific files for translation, and manages updates when new messages are added to the program. The tool supports pluralized strings for over 200 languages using rules from the Unicode Common Locale Data Repository, handles named variables in messages through Go's text/template syntax, and works with any message file format including JSON, TOML, and YAML.
Developers should choose this tool if they are building Go applications that need to support multiple languages and want an integrated workflow from code to translated output. It suits projects of any size that want to avoid manual translation file management. The tool is particularly valuable for handling pluralization rules correctly across diverse languages without requiring custom logic.
The project maintains automated code generation from CLDR data to ensure plural rules stay current with Unicode standards. Test coverage is tracked and publicly reported. The example application and comprehensive test suite demonstrate real-world usage patterns and edge cases.