localizer

package
Version: v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindMessageFiles added in v1.1.0

func FindMessageFiles(folderPath string) ([]string, error)

Types

type Localizer

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

func New

func New(defaultLanguage language.Tag, messageFiles ...string) *Localizer

func NewWithBundle

func NewWithBundle(bundle *i18n.Bundle) *Localizer

func WithLanguage

func WithLanguage(l *Localizer, langs ...string) *Localizer

func (*Localizer) Languages added in v1.0.8

func (l *Localizer) Languages() []string

func (*Localizer) Localize

func (l *Localizer) Localize(id string, args ...interface{}) (string, error)

func (*Localizer) LocalizeOr

func (l *Localizer) LocalizeOr(id, fallback string, args ...interface{}) string

func (*Localizer) MustLocalize

func (l *Localizer) MustLocalize(id string, args ...interface{}) string

func (*Localizer) PrimaryLanguage added in v1.0.8

func (l *Localizer) PrimaryLanguage() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL