i18n

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Translator

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

func NewTranslator

func NewTranslator(defaultLang string) (*Translator, error)

NewTranslator creates a new Translator using the embedded locales.

func NewTranslatorFromFS

func NewTranslatorFromFS(localesFS fs.FS, defaultLang string) (*Translator, error)

NewTranslatorFromFS creates a new Translator from a given filesystem. This is useful for testing or loading locales from a custom location.

func (*Translator) Get

func (t *Translator) Get(lang, key string, args ...interface{}) string

Jump to

Keyboard shortcuts

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