translator

package
v0.0.0-...-990f775 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 4 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 interface {
	TranslateFunction(language string) TranslatorFunc
}

func New

func New(fileSystem fs.FS, defaultLanguage language.Tag, languages ...language.Tag) (Translator, error)

Initialization of the translation.

You can get your language Tag with using "golang.org/x/text/language" library like: language.English

type TranslatorFunc

type TranslatorFunc func(string) string

type TranslatorPack

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

func (*TranslatorPack) TranslateFunction

func (translator *TranslatorPack) TranslateFunction(language string) TranslatorFunc

Returns a function based on passed language tag.

You can get your language string code with using "golang.org/x/text/language" library like: language.English.String()

Jump to

Keyboard shortcuts

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