ytrwrap is a wrapper for Yandex.Translate API. Free API key is required to use machine translation service. Supports more than 90 languages and can translate separate words or complete texts. API consists of 3 simple methods: Languages, Translate, Detect.
Usage example
package main
import (
"fmt"
"github.com/rogozhka/ytrwrap"
)
func main() {
tr := ytrwrap.NewYandexTranslate("<your-api-key")
src := "the pony eat grass"
out, err := tr.Translate(src, ytrwrap.FR, nil)
if err != nil {
panic(err)
}
fmt.Printf("%s", out)
//
// le poney, manger de l'herbe
//
}
Contribution
Welcome feedback Issues and PR.
Licence
Released under the MIT License.