Skip to content

Google translate API for unlimited and free translations, gtranslate generates the necessary token to use the Google Translate API for free

License

Notifications You must be signed in to change notification settings

bregydoc/gtranslate

Repository files navigation

gtranslate build

Google Translate API for unlimited and free translations 📢. This project was inspired by google-translate-api and google-translate-token.

Install

go get github.com/bregydoc/gtranslate

Use

gtranslate.Translate("I'm alive", language.English, language.Spanish)
gtranslate.TranslateWithParams("I'm alive", gtranslate.TranslateWithParams{From: "en", To: "es"})

Example

package main

import (
	"fmt"

	"github.com/bregydoc/gtranslate"
)

func main() {
	text := "Hello World"
	translated, err := gtranslate.TranslateWithParams(
		text,
		gtranslate.TranslationParams{
			From: "en",
			To:   "ja",
		},
	)
	if err != nil {
		panic(err)
	}

	fmt.Printf("en: %s | ja: %s \n", text, translated)
	// en: Hello World | ja: こんにちは世界
}

About

Google translate API for unlimited and free translations, gtranslate generates the necessary token to use the Google Translate API for free

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages