Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Name() string Translate(text string, source string, pivot string) (backend.TranslationResponse, error) Usage() (backend.UsageResponse, error) }
Backend is the interface that wraps the translation backend methods.
func SelectBackend ¶
SelectBackend returns the translation service implementation to use.
type Diff ¶
Diff is the interface that wraps the pretty print of the difference between the original text and the double translated text.
type T2 ¶
type T2 struct {
// contains filtered or unexported fields
}
T2 is the main struct of the package.
func (T2) Translate ¶
Translate is the main function of the package. It translates the text from the source language to the pivot language, then back to the source language. It then prints the diff between the original text and the double translated text. If the copyToClipboard flag is set, it also copies the double translated text to the clipboard.