Awesome
mstranslator
The "mstranslator" is a Micrsoft Translator Service client which written by Golang.
What is Microsoft Translator
Microsoft Translator is a cloud based automatic translation service. (Refer here for more detail).
Here is another site for Microsoft Translator API.
Installation
go get github.com/kkdai/mstranslator
How to use it
Sign-up for Microsoft Translator API (see here for more detail) and get your developer credentials. Use the client ID and secret to instantiate a translator as shown below.
package main
import (
"fmt"
"log"
ms "github.com/kkdai/mstranslator"
)
func main() {
msClient := ms.NewClient("YourClientID", "YourClientSecret")
//Translate "Hello World" from English to France.
translation, err := msClient.Translate("Hello World!", "en", "de")
if err != nil {
log.Panicf("Error : %s", err.Error())
}
fmt.Println(translation) //Hallo Welt!
}
Check example for more detail.
Example on mstranslator
Implemented APIs
- Detect
- DetectArray
- GetLanguageNames
- GetLanguagesForTranslate
- GetLanguagesForSpeak
- GetTranslations
- Translate
- TransformText
- Speak
Unimplement APIs (Yet)
Contribute
Please open up an issue on GitHub before you put a lot efforts on pull request.
The code submitting to PR must be filtered with gofmt
Inspired
This project is inspired by https://github.com/st3v/translator.
Project52
It is one of my project 52.
License
This package is licensed under MIT license. See LICENSE for details.