mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 19:05:12 +00:00
21 lines
356 B
Go
Executable File
21 lines
356 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/translate"
|
|
)
|
|
|
|
// TextRequest is the basic edition request
|
|
func main() {
|
|
translateService := translate.NewTranslateService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := translateService.Text(&translate.TextRequest{
|
|
Format: "text",
|
|
Model: "nmt",
|
|
Source: "en",
|
|
Target: "zh",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|