String localization tools for Go
Main use for these tools is the localization of error messages.
To create suitable errors use the type
To enrich errors with context, e.g. to build kind of trace, wrap them using
%wfrom the standard library.
To localize, use the translation tools, e.g. function L10nLocalizeError, generated by the
To generate and to update the JSON input file for
The older package
message and the older commands
stringl10nextract are considered deprecated.
"github.com/hwheinzen/stringl10n/mistake" in your project's import statements.
To get the commands
$ go install github.com/hwheinzen/stringl10n/cmd/l10n@latest $ go install github.com/hwheinzen/stringl10n/cmd/l10nextract@latest`
(But maybe you like to have all sources at hand: clone the repository then.)
Some example code can be found in cmd/l10n/example.