translate

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTranslator = &errorTranslator{errors.New("translate: unknown translator")}

Functions

func Register added in v1.2.7

func Register[T any, P translator[T]](translator P)

Register registers a translator to package.

Types

type Translator added in v1.2.8

type Translator interface {
	Translate(text, from, to string) (string, error)
}

func New added in v1.2.8

func New(name string, unmarshal func(any) error) Translator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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