Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noborus/go-textra
(unofficial) TexTra API client library
https://github.com/noborus/go-textra
textra translate
Last synced: about 2 months ago
JSON representation
(unofficial) TexTra API client library
- Host: GitHub
- URL: https://github.com/noborus/go-textra
- Owner: noborus
- License: mit
- Created: 2021-11-29T04:02:16.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-03T11:32:34.000Z (3 months ago)
- Last Synced: 2024-11-03T12:24:16.764Z (3 months ago)
- Topics: textra, translate
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-textra
[![Go Reference](https://pkg.go.dev/badge/github.com/noborus/go-textra.svg)](https://pkg.go.dev/github.com/noborus/go-textra)
This is a library that translates with [みんなの自動翻訳(minnano-jidou-honyaku)@textra's](https://mt-auto-minhon-mlt.ucri.jgn-x.jp/) API clinet.
You need a [textra](https://mt-auto-minhon-mlt.ucri.jgn-x.jp/) account.
```go
package mainimport (
"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) // これはペンです。
}
```