Go I18n (toml)
Go i18n uses TOML (or JSON or YAML) files to store translation messages for Go applications. The go-i18n library provides a message bundle system where messages are defined with an ID, a description, and one or more translation form strings. TOML is the most common format used with go-i18n due to its readability in the Go ecosystem.
Go i18n TOML files contain message entries where each entry has an id field (the stable key), a description field (translator context), and one or more translation fields. For pluralised messages, separate one and other fields — and additional forms for complex languages — define the plural variants. The go-i18n library generates a Go source file from active message files, providing type-safe access to translated strings.
Best practice: write a clear description for every message ID — go-i18n's message format has first-class description support and these are essential translator context. Use the goi18n merge command to generate a new TOML file containing only untranslated messages, which can then be sent for translation without re-translating existing content. Language Monster supports Go i18n TOML format and preserves the message ID, description, and plural form structure through translation.
