- Notifications
You must be signed in to change notification settings - Fork2
SnakeSel/libretranslate
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
LibreTranslate is an Open Source Machine Translation
API Docs |Self-Hosted
go get -u github.com/snakesel/libretranslatepackage mainimport ("fmt" tr"github.com/snakesel/libretranslate")funcmain() {translate:=tr.New(tr.Config{Url:"https://libretranslate.com",Key:"XXX", })// you can use "auto" for source language// so, translator will detect languagetrtext,err:=translate.Translate("Hello, World!","auto","ru")iferr==nil {fmt.Println(trtext) }else {fmt.Println(err.Error()) }// Detect the language of the textconf,lang,err:=translate.Detect("Nächster Stil")iferr==nil {fmt.Printf("%s (%f)\n",lang,conf) }else {fmt.Println(err.Error()) }}
About
LibreTranslate in golang
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.