logic

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaiduAPPID     = 20170721000065581
	BaiduSecretKey = "3GuX90c4M8MdTwIW8D3X"
	BaiduServerUrl = "https://fanyi-api.baidu.com/api/trans/vip/translate"

	GoogleServerUrl = "https://translation.googleapis.com/language/translate/v2"
	GoogleSecretkey = "AIzaSyAPbH8kU7NYbVk_hOQsL2IwRE45A_9Mtyk"
)

Variables

This section is empty.

Functions

func Translate

func Translate(respon *httputils.Respon, languageID uint32, content string)

Types

type BaiduResult

type BaiduResult struct {
	Error_code   string
	Error_msg    string
	From         string
	To           string
	Trans_result []*BaiduTransResult
}

type BaiduTransResult

type BaiduTransResult struct {
	Src string
	Dst string
}

type GoogleError

type GoogleError struct {
	Code    int
	Message string
}

type GoogleResult

type GoogleResult struct {
	Data  *GoogleTranslations
	Error *GoogleError
}

type GoogleTranslationItem

type GoogleTranslationItem struct {
	TranslatedText         string
	DetectedSourceLanguage string
}

type GoogleTranslations

type GoogleTranslations struct {
	Translations []*GoogleTranslationItem
}

type TransResult

type TransResult struct {
	Text     string
	Language string
}

Jump to

Keyboard shortcuts

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