ii18n
ii18n copied to clipboard
II18N - Go i18n library.
II18N
Go i18n library.
Download & Install
go get github.com/syyongx/ii18n
Quick Start
import github.com/syyongx/ii18n
func main() {
config := map[string]Config{
"app": Config{
SourceNewFunc: NewJSONSource,
OriginalLang: "en-US",
BasePath: "./testdata",
FileMap: map[string]string{
"app": "app.json",
"error": "error.json",
},
},
}
NewI18N(config)
message := T("app", "hello", nil, "zh-CN")
}
Apis
NewI18N(config map[string]Config) *I18N
T(category string, message string, params map[string]string, lang string) string
LICENSE
II18N source code is licensed under the MIT Licence.