deeplx

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 8 Imported by: 2

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, err := deeplx.Translate("Hello", "EN", "ZH")
	if err != nil {
		fmt.Printf("Error: %v\n", err)
		return
	}
	fmt.Println(result)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Translate

func Translate(text, sourceLang, targetLang string) (string, error)

Types

type RequestParams

type RequestParams struct {
	Text       string `json:"text"`
	SourceLang string `json:"source_lang"`
	TargetLang string `json:"target_lang"`
}

Jump to

Keyboard shortcuts

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