Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ContextKey any = &contextKey{}
Functions ¶
Types ¶
type LangType ¶
type LangType struct {
Lang, Name string // these fields are used directly in templates: {{range .AllLangs}}{{.Lang}}{{.Name}}{{end}}
}
LangType represents a lang type
type Locale ¶
type Locale interface { Language() string Tr(string, ...any) string TrN(cnt any, key1, keyN string, args ...any) string PrettyNumber(v any) string }
Locale represents an interface to translation
type MockLocale ¶
type MockLocale struct{}
MockLocale provides a mocked locale without any translations
func (MockLocale) Language ¶
func (l MockLocale) Language() string
func (MockLocale) PrettyNumber ¶
func (l MockLocale) PrettyNumber(v any) string
func (MockLocale) Tr ¶
func (l MockLocale) Tr(s string, _ ...interface{}) string
func (MockLocale) TrN ¶
func (l MockLocale) TrN(_cnt interface{}, key1, _keyN string, _args ...interface{}) string
Click to show internal directories.
Click to hide internal directories.