mirror of
https://github.com/watn3y/steamsalty.git
synced 2025-10-25 17:51:04 +02:00
Some checks failed
Build and Push to Docker Hub on push to any branch / docker (push) Has been cancelled
35 lines
703 B
Go
35 lines
703 B
Go
package deepl
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type translateResponse struct {
|
|
Translations []struct {
|
|
DetectedSourceLanguage string `json:"detected_source_language"`
|
|
Text string `json:"text"`
|
|
} `json:"translations"`
|
|
}
|
|
|
|
type translateRequest struct {
|
|
Text []string `json:"text"`
|
|
TargetLang string `json:"target_lang"`
|
|
}
|
|
|
|
type languagesResponse []struct {
|
|
Language string `json:"language"`
|
|
Name string `json:"name"`
|
|
SupportsFormality bool `json:"supports_formality"` //unused
|
|
}
|
|
|
|
|
|
type apiClient struct {
|
|
authKey string
|
|
baseURL string
|
|
httpClient *http.Client
|
|
}
|
|
|
|
const (
|
|
baseURLPro = "https://api.deepl.com/v2"
|
|
baseURLFree = "https://api-free.deepl.com/v2"
|
|
)
|