Client library for the DeepL Pro API.
go get github.com/bounoable/deepl
See the examples.
import (
"github.com/bounoable/deepl"
)
client := deepl.New("your-auth-key")
translated, sourceLang, err := client.Translate(
context.TODO(),
"Hello, world",
deepl.Chinese,
)
if err != nil {
log.Fatal(err)
}
log.Println(fmt.Sprintf("source language: %s", sourceLang))
log.Println(translated)
You can test the library against the real DeepL API by running the following command.
CAUTION: Runnning these tests will add to your usage and therefore will be billed!
make e2e-test authKey=YOUR_AUTH_KEY