https://github.com/yuangwei/go-i18next
I18next for go support.
https://github.com/yuangwei/go-i18next
cldr go i18n i18next icu-messageformat translation
Last synced: 12 months ago
JSON representation
I18next for go support.
- Host: GitHub
- URL: https://github.com/yuangwei/go-i18next
- Owner: yuangwei
- License: mit
- Created: 2022-05-11T07:37:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-20T11:01:12.000Z (over 1 year ago)
- Last Synced: 2025-08-11T12:47:01.856Z (12 months ago)
- Topics: cldr, go, i18n, i18next, icu-messageformat, translation
- Language: Go
- Homepage:
- Size: 24.4 KB
- Stars: 15
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
go-i18next
---
go-i18next is a port of [i18next](https://www.i18next.com/) in Go.
## Installation
```shell
$ go get -u https://github.com/yuangwei/go-18next
```
## Usage
```go
import "github.com/yuangwei/go-18next"
var i18n i18next.I18n
func main() {
i18n = i18next.Init(i18next.I18nOptions{
Lng: []string{"en", "cn"},
DefaultLng: "en",
Ns: "json",
Backend: i18next.Backend{
LoadPath: []string{"./examples/datas/{{.Ns}}/{{.Lng}}/home.json"},
},
})
text, err := i18n.T("title", struct {
Name string
}{Name: "Mike"})
fmt.Println(val) // Hello, Mike
}
```
## License
go-i18next is available under the MIT license. See the [LICENSE](LICENSE) file for more info.