i18n

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 10 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PT

func PT(req *http.Request, module ModuleKey, prefix string, key string, args ...string) (r string)

func T

func T(req *http.Request, module ModuleKey, key string, args ...string) (r string)

Types

type Builder

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

func New

func New() *Builder

func (*Builder) EnsureLanguage

func (b *Builder) EnsureLanguage(in http.Handler) (out http.Handler)

func (*Builder) GetCookieName

func (b *Builder) GetCookieName() string

func (*Builder) GetCurrentLangFromCookie

func (b *Builder) GetCurrentLangFromCookie(r *http.Request) (lang string)

func (*Builder) GetQueryName

func (b *Builder) GetQueryName() string

func (*Builder) GetSupportLanguages

func (b *Builder) GetSupportLanguages() []language.Tag

func (*Builder) GetSupportLanguagesFromRequest

func (b *Builder) GetSupportLanguagesFromRequest(R *http.Request) []language.Tag

func (*Builder) GetSupportLanguagesFromRequestFunc

func (b *Builder) GetSupportLanguagesFromRequestFunc(v func(R *http.Request) []language.Tag) (r *Builder)

func (*Builder) RegisterForModule

func (b *Builder) RegisterForModule(lang language.Tag, module ModuleKey, msg Messages) (r *Builder)

func (*Builder) SupportLanguages

func (b *Builder) SupportLanguages(vs ...language.Tag) (r *Builder)

type DynaBuilder

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

func DynaNew

func DynaNew() (r *DynaBuilder)

func (*DynaBuilder) HaveMissingKeys

func (d *DynaBuilder) HaveMissingKeys() bool

func (*DynaBuilder) Language

func (d *DynaBuilder) Language(lang string) (r *DynaBuilder)

func (*DynaBuilder) PrettyMissingKeys

func (d *DynaBuilder) PrettyMissingKeys() string

type Messages

type Messages interface {
}

func MustGetModuleMessages

func MustGetModuleMessages(r *http.Request, module ModuleKey, defaultMessages Messages) Messages

type ModuleKey

type ModuleKey string

Directories

Path Synopsis
csv

Jump to

Keyboard shortcuts

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