Skip to content

This library provides a simple API client function for DeepL

License

Notifications You must be signed in to change notification settings

gamramstone-dev/deepl-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deepl-go

This library provides a simple API client function for Deepl.

Usage

  1. Install package
    > go get github.com/DaikiYamakawa/deepl-go
  2. We should register valid API key in the environment variable.
    > export DEEPL_API_KEY=xxx-xxx-xxx
  3. We can call deepl library in our code.
     package main
    
     import (
         "context"
         "fmt"
    
         "github.com/DaikiYamakawa/deepl-go"
     )
    
     func main() {
         cli, err := deepl.New("https://api.deepl.com", nil)
         if err != nil {
             fmt.Printf("Failed to create client:\n   %+v\n", err)
         }
         translateResponse, err := cli.TranslateSentence(context.Background(), "Hello", "EN", "JA")
         if err != nil {
             fmt.Printf("Failed to translate text:\n   %+v\n", err)
         } else {
             fmt.Printf("%+v\n", translateResponse)
         }
     }
    &{Translations:[{DetectedSourceLanguage:EN Text:こんにちは}]}

About

This library provides a simple API client function for DeepL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%