Skip to content

noborus/go-textra

Repository files navigation

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) // これはペンです。
}

About

(unofficial) TexTra API client library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages