gi18n

package
v0.0.0-...-8506bae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	I18N = newI18n()
)

Functions

func Init

func Init(cfg gcore.Config) (err error)

func SetBinData

func SetBinData(data map[string]string)

Types

type I18n

type I18n struct {
	// contains filtered or unexported fields
}

func (*I18n) Add

func (this *I18n) Add(lang string, data map[string]string)

func (*I18n) Clone

func (this *I18n) Clone(lang string) gcore.I18n

func (*I18n) Lang

func (this *I18n) Lang(lang string)

func (*I18n) Languages

func (this *I18n) Languages() (languages []string, err error)

func (*I18n) LanguagesT

func (this *I18n) LanguagesT() (languages []language.Tag, err error)

func (*I18n) MatchAcceptLanguageT

func (this *I18n) MatchAcceptLanguageT(r *http.Request) (tag language.Tag, err error)

func (*I18n) MatchT

func (this *I18n) MatchT(languages []language.Tag) (t language.Tag, err error)

func (*I18n) ParseAcceptLanguage

func (this *I18n) ParseAcceptLanguage(r *http.Request) (strs []string, err error)

func (*I18n) ParseAcceptLanguageStr

func (this *I18n) ParseAcceptLanguageStr(s string) (str string, err error)

func (*I18n) ParseAcceptLanguageStrT

func (this *I18n) ParseAcceptLanguageStrT(s string) (t language.Tag, err error)

func (*I18n) ParseAcceptLanguageT

func (this *I18n) ParseAcceptLanguageT(r *http.Request) (tags []language.Tag, err error)

func (*I18n) String

func (this *I18n) String(lang string)

func (*I18n) Tr

func (this *I18n) Tr(lang, key string, defaultMessage ...string) string

func (*I18n) TrLangs

func (this *I18n) TrLangs(langs []string, key string, defaultMessage ...string) string

func (*I18n) TrV

func (this *I18n) TrV(lang, key string, defaultMessage ...string) template.HTML

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL