trans

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FORMATTER_HTML  = "html"
	FORMATTER_JSON  = "json"
	FORMATTER_PLAIN = "plain"
)
View Source
const (
	TRANSLATOR_BING               = "bing"
	TRANSLATOR_GOOGLE             = "google"
	TRANSLATOR_DEEPL_API          = "deepl-api"
	TRANSLATOR_LIBRETRANSLATE_API = "libretranslate-api"
)

Variables

This section is empty.

Functions

func Format

func Format(res res.Res, format string) string

func Translate

func Translate(text string, source string, target string, specifiedTranslators []string, c conf.Conf) res.Res

Types

type Formatter

type Formatter struct {
	Code string
}

func (*Formatter) Format

func (f *Formatter) Format(res res.Res) string

type Translator

type Translator struct {
	Code string
	Conf conf.ConfTranslator
}

func (*Translator) Name

func (t *Translator) Name() string

func (*Translator) TranslateText

func (t *Translator) TranslateText(text string, source string, target string) res.ResTranslator

Jump to

Keyboard shortcuts

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