Documentation
¶
Overview ¶
Package localization provides experimental locale helpers for templates.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Default is the fallback Localizer used when no localizer is configured. Default = Localizer(defaultLocalizer{locale: "en_US"}) )
Functions ¶
func Locale ¶
func Locale(ctx ...*partial.RenderContext) string
Locale returns the configured locale for a render context.
go-doc:sig func() string
Types ¶
type Localizer ¶
type Localizer interface {
GetLocale() string
}
Localizer provides the active locale for a render.
func FromContext ¶
FromContext returns the configured Localizer or Default.
func LocalizerValue ¶
func LocalizerValue(ctx ...*partial.RenderContext) Localizer
LocalizerValue returns the configured localizer for a render context.
go-doc:sig func() github.com/donseba/go-partial/exp/localization.Localizer
Click to show internal directories.
Click to hide internal directories.