localization

package
v1.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalizationService

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

func NewLocalizationService

func NewLocalizationService() *LocalizationService

func (*LocalizationService) GetLocalizer

func (ls *LocalizationService) GetLocalizer(lang string) *i18n.Localizer

func (*LocalizationService) GetLocalizerFromRequest

func (ls *LocalizationService) GetLocalizerFromRequest(r *http.Request) *i18n.Localizer

type SimpleLocalizer

type SimpleLocalizer struct {
	Localizer *i18n.Localizer
}

SimpleLocalizer wraps i18n.Localizer with a more convenient API

func GetLocalizer

func GetLocalizer(r *http.Request) *SimpleLocalizer

GetLocalizer creates a localizer based on the request's Accept-Language header or forcedLanguage option

func (*SimpleLocalizer) GetLang

func (sl *SimpleLocalizer) GetLang() string

Get the language that is used by the localizer by retrieving a well-known string that is required to be present

func (*SimpleLocalizer) T

func (sl *SimpleLocalizer) T(messageID string) string

T provides a concise way to localize messages

Jump to

Keyboard shortcuts

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