https://github.com/syyongx/ii18n
II18N - Go i18n library.
https://github.com/syyongx/ii18n
go i18n
Last synced: 11 months ago
JSON representation
II18N - Go i18n library.
- Host: GitHub
- URL: https://github.com/syyongx/ii18n
- Owner: syyongx
- License: mit
- Created: 2018-06-21T05:33:21.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T07:23:10.000Z (about 7 years ago)
- Last Synced: 2025-06-05T22:09:13.938Z (about 1 year ago)
- Topics: go, i18n
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 20
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# II18N
[](https://godoc.org/github.com/syyongx/ii18n)
[](https://goreportcard.com/report/github.com/syyongx/ii18n)
[![MIT licensed][3]][4]
[3]: https://img.shields.io/badge/license-MIT-blue.svg
[4]: LICENSE
Go i18n library.
## Download & Install
```shell
go get github.com/syyongx/ii18n
```
## Quick Start
```go
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
```go
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](https://github.com/syyongx/ii18n/blob/master/LICENSE) Licence.