deeplx

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 15 Imported by: 3

README

deeplx

A Go library used for unlimited DeepL translation

Installation

Install it with the go get command:

go get github.com/xiaoxuan6/deeplx

Usage

Then, you can create a new DeepL translation client and use it for translation:

import (
	"fmt"
	"github.com/xiaoxuan6/deeplx"
)

func main() {
	result := deeplx.Translate("Hello", "EN", "ZH")
	fmt.Println(result)
}

[!WARNING]
并发控制在1000以内

Concurrent control within 1000

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response added in v0.0.4

type Response struct {
	Code int64  `json:"code"`
	Data string `json:"data"`
	Msg  string `json:"msg"`
}

func Translate

func Translate(text, sourceLang, targetLang string) *Response

func TranslateByDeeplx added in v0.1.2

func TranslateByDeeplx(text, sourceLang, targetLang, proxyUrl string) *Response

func TranslateWithProxyUrl added in v0.2.0

func TranslateWithProxyUrl(text, sourceLang, targetLang string, isProxyUrl bool) *Response

Jump to

Keyboard shortcuts

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