i18n

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyBundle = errors.New("empty bundle")
)

Functions

func LoadBundle

func LoadBundle(provider providers.FileProvider) (bundle *i18n.Bundle, err error)

Types

type LocalizationContext

type LocalizationContext struct {
	Bundle         *i18n.Bundle
	AcceptLanguage string
	Logger         log.Logger
}

func (*LocalizationContext) LangBy

func (this *LocalizationContext) LangBy(id string) language.Tag

func (*LocalizationContext) Message

func (this *LocalizationContext) Message(id string) string

func (*LocalizationContext) MessageOrDefault

func (this *LocalizationContext) MessageOrDefault(fallbackId string, id string) string

Jump to

Keyboard shortcuts

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