Documentation
¶
Index ¶
- type Bundle
- func (b *Bundle) DefaultLanguage() language.Tag
- func (b *Bundle) LoadMessageFromBytes(s []byte, tag language.Tag, umn typ.UnmarshalFunc) error
- func (b *Bundle) LoadMessageFromDir(dir string, umn typ.UnmarshalFunc) error
- func (b *Bundle) LoadMessageFromFile(filename string, umn typ.UnmarshalFunc) error
- func (b *Bundle) LoadMessageFromFsEntries(entries []fs.DirEntry, umn typ.UnmarshalFunc) error
- func (b *Bundle) LoadMessageFromString(s string, tag language.Tag, umn typ.UnmarshalFunc) error
- func (b *Bundle) Locales() []*locale
- func (b *Bundle) ParseMessageFromBytes(rf []byte, umn typ.UnmarshalFunc) (map[string]string, error)
- type Localization
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bundle ¶
type Bundle struct {
// contains filtered or unexported fields
}
func (*Bundle) DefaultLanguage ¶
func (*Bundle) LoadMessageFromBytes ¶
func (*Bundle) LoadMessageFromDir ¶
func (b *Bundle) LoadMessageFromDir(dir string, umn typ.UnmarshalFunc) error
func (*Bundle) LoadMessageFromFile ¶
func (b *Bundle) LoadMessageFromFile(filename string, umn typ.UnmarshalFunc) error
func (*Bundle) LoadMessageFromFsEntries ¶
func (*Bundle) LoadMessageFromString ¶
func (*Bundle) ParseMessageFromBytes ¶
type Localization ¶
type Localization struct {
// contains filtered or unexported fields
}
func NewLocalization ¶
func NewLocalization(bundle *Bundle, fallbackLangs ...string) *Localization
func (*Localization) Localize ¶
func (l *Localization) Localize(key string, variables ...map[string]interface{}) string
func (*Localization) With ¶
func (l *Localization) With(lang string) *Localization
func (*Localization) WithRequest ¶
func (l *Localization) WithRequest(r *http.Request) *Localization
func (*Localization) WithTag ¶
func (l *Localization) WithTag(tag language.Tag) *Localization
Click to show internal directories.
Click to hide internal directories.