locale

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLocalizer

func ContextWithLocalizer(parent context.Context, l *i18n.Localizer) context.Context

ContextWithLocalizer adds localizer into context as a value. Use LocalizerFromContext to recover it later.

func LocalizeError

func LocalizeError(err error, lc *i18n.Localizer) string

func LocalizerFromContext

func LocalizerFromContext(ctx context.Context) (l *i18n.Localizer, ok bool)

LocalizerFromContext raises request-scoped localizer from context. Returns `<nil>, false` if there is no localizer in context.

Types

type Localizable

type Localizable interface {
	Localize(*i18n.Localizer) (string, error)
}

Jump to

Keyboard shortcuts

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