locale

package
v1.0.41 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(l *Localizer) func(next http.Handler) http.Handler

DEPRECATED

func Set

DEPRECATED

Types

type Locale

type Locale struct {
	Tag language.Tag
	// contains filtered or unexported fields
}

func Get

func Get(c context.Context) *Locale

DEPRECATED

func (*Locale) LanguageName

func (l *Locale) LanguageName(code string) string

func (*Locale) T

func (l *Locale) T(key string, args ...any) string

func (*Locale) TS

func (l *Locale) TS(scope, key string, args ...any) string

func (*Locale) Translate

func (l *Locale) Translate(key string, args ...any) string

func (*Locale) TranslateScope

func (l *Locale) TranslateScope(scope, key string, args ...any) string

type Localizer

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

func NewLocalizer

func NewLocalizer(langs ...string) *Localizer

func (*Localizer) DefaultLocale

func (l *Localizer) DefaultLocale() *Locale

func (*Localizer) GetLocale

func (l *Localizer) GetLocale(langs ...string) *Locale

func (*Localizer) Locales

func (l *Localizer) Locales() []*Locale

Jump to

Keyboard shortcuts

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