Skip to content

Go

Example of a request using the go programming language.

go
package main

import (
    translate "github.com/OwO-Network/DeepLX/translate"
	
)
// tag handling can pass empty strings
func main() {
	result, err := translate.TranslateByDeepLX(sourceLang, targetLang, translateText, tagHandling, proxyURL)
	if err != nil {
		log.Fatalf("Translation failed: %s", err)
	}
}

Demo

go
package main

import (
    translate "github.com/OwO-Network/DeepLX/translate"
	
)

func main() {
	result, err := translate.TranslateByDeepLX("ZH", "EN", "Hello World", "html", "socks://127.0.0.1:1080")
	if err != nil {
		log.Fatalf("Translation failed: %s", err)
	}
}

Released under the MIT License.