transtools

package
v0.0.181 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ExpectedDataFile = "data/glossary/expected.csv"

File name for expected translation elements

View Source
const ReplaceDataFile = "data/glossary/suggestions.csv"

File name for suggested translation elements

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiClient

type ApiClient interface {
	Translate(sourceText string) (*string, error)
}

ApiClient is an interface for translation API clients

func NewDeepLClient

func NewDeepLClient(authKey string) ApiClient

func NewGlossaryClient

func NewGlossaryClient(projectID, glossaryID string) ApiClient

NewGoogleClient creates a Google Translation API that uses a glossary.

func NewGoogleClient

func NewGoogleClient() ApiClient

NewGoogleClient creates a Google Translation API that does not use a glossary.

type MT

type MT struct {
	DetectedSourceLanguage, Text string
}

type Note added in v0.0.88

type Note struct {
	FoundCN              string
	ExpectedEN           []string
	FoundEN, Replacement string
}

type Processor

type Processor interface {
	Suggest(source, translation string) Results
}

func NewProcessor

func NewProcessor(eReader, rReader io.Reader) Processor

type Results

type Results struct {
	Replacement string
	Notes       []Note
}

type TrResult

type TrResult struct {
	Translations []MT
}

Jump to

Keyboard shortcuts

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