i18n

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Locales = NewLocaleStore()

Functions

This section is empty.

Types

type Locale

type Locale struct {
	Code     string
	Name     string
	Messages map[string]string
}

func (*Locale) Tr

func (l *Locale) Tr(key string, args ...any) template.HTML

type LocaleStore

type LocaleStore struct {
	Locales map[string]*Locale
}

func NewLocaleStore

func NewLocaleStore() *LocaleStore

NewLocaleStore creates a new LocaleStore

func (*LocaleStore) GetLocale

func (store *LocaleStore) GetLocale(lang string) (*Locale, error)

func (*LocaleStore) HasLocale

func (store *LocaleStore) HasLocale(lang string) bool

func (*LocaleStore) LoadAll

func (store *LocaleStore) LoadAll() error

func (*LocaleStore) MatchTag

func (store *LocaleStore) MatchTag(langs []language.Tag) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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