Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { LoadPath []string // from network or local, usage: https://example.com/locales/{{.Lng]}/locale.json CrossDomain bool }
type CodeOptions ¶
type I18n ¶
type I18n struct {
// contains filtered or unexported fields
}
func Init ¶
func Init(options I18nOptions) (I18n, error)
func (*I18n) ChangeLanguage ¶
type I18nOptions ¶
type I18nOptions struct { Lng []string // example: ["en-US", "fr-FR"] usage: /locale/{{.Lng}}/locale.json or https://example.com/locales/{{.Lng]}/locale.json DefaultLng string // example: "en-US" Ns string // example: "dev", , not require. usage: https://example.com/locales/{{.Ns}}/{{.Lng]}.json Backend Backend // load lngs from file or network Resources map[string]map[string]string // load lngs from local CodeOptions CodeOptions }
Click to show internal directories.
Click to hide internal directories.