locales
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
I18N
Usage
In the source code, use the functioni18n.Tr("message", ...args) to get a localized string. This tool parses thesource using thego/ast package to generate theen locale using these messages.
Updating messages to reflect code changes
The following command updates the locales present in the source code to reflect addition/removal of messages.
task i18n:updateSyncing the catalog with transifex
Environment variables
Set the following environment variables according to the project
| Variable | Description |
|---|---|
| TRANSIFEX_PROJECT | Name of the transifex project |
| TRANSIFEX_RESOURCE | Name of the transifex translation resource |
| TRANSIFEX_API_KEY | API Key to access the transifex project |
Push
task i18n:pushPull
task i18n:pull
Documentation¶
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcFromJavaToGoSyntax¶
FromJavaToGoSyntax convert a translation string made for Java to a one suitable for golang (printf-style).The conversion transforms java placeholders like "{0}","{1}","{2}",etc... with the equivalent for golang"%[1]v","%[2]v","%[3]v",etc...A pair of adjacent single-quote characters "'" (U+0027) is replaced with one only.
Types¶
This section is empty.