syyongx / ii18n

II18N - Go i18n library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

II18N

GoDoc Go Report Card MIT licensed

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.

About

II18N - Go i18n library.

License:MIT License


Languages

Language:Go 100.0%