localizer

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCookie

func CreateCookie(w http.ResponseWriter, localization string)

func ReadCookie

func ReadCookie(req *http.Request) string

Types

type Localizer

type Localizer map[string]string

func (Localizer) Get

func (loc Localizer) Get(key string) string

type LocalizerStore

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

func NewLocalizerStore

func NewLocalizerStore(files embed.FS, sharedKey, errorsKey string) LocalizerStore

func (LocalizerStore) Get

func (ls LocalizerStore) Get(key, language string) Localizer

func (LocalizerStore) GetLocalizedError

func (ls LocalizerStore) GetLocalizedError(err core.UseCaseError, req *http.Request) string

func (LocalizerStore) GetUsingRequest

func (ls LocalizerStore) GetUsingRequest(key string, req *http.Request) Localizer

func (LocalizerStore) GetUsingRequestWithoutShared

func (ls LocalizerStore) GetUsingRequestWithoutShared(key string, req *http.Request) Localizer

func (LocalizerStore) GetWithoutShared

func (ls LocalizerStore) GetWithoutShared(key, language string) Localizer

func (LocalizerStore) LoadIntoField

func (ls LocalizerStore) LoadIntoField(field **Localizer, key string, language string)

func (LocalizerStore) LoadIntoFieldUsingRequest

func (ls LocalizerStore) LoadIntoFieldUsingRequest(field **Localizer, key string, req *http.Request)

Jump to

Keyboard shortcuts

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