Categorygithub.com/noborus/go-textra
repositorypackage
0.0.0-20230113031853-3e16094015e2
Repository: https://github.com/noborus/go-textra.git
Documentation: pkg.go.dev

# README

go-textra

Go Reference

This is a library that translates with みんなの自動翻訳(minnano-jidou-honyaku)@textra's API clinet.

You need a textra account.

package main

import (
	"fmt"
	"log"

	"github.com/noborus/go-textra"
)

var config = textra.Config{
	ClientID:     "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // API key
	ClientSecret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",  // API secret
	Name:         "UserID", // UserID
}

func main() {
	cli,err := textra.New(config)
	if err != nil {
		log.Fatal(err)
	}

	ja, err := cli.Translate(textra.GENERAL_EN_JA, "This is a pen.")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(ja) // これはペンです。
}