Skip to content

Commit

Permalink
Update: README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
candy12t committed Jan 13, 2024
1 parent 7dc49a9 commit ade3df8
Showing 1 changed file with 56 additions and 5 deletions.
61 changes: 56 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,64 @@
# go-deepl

Unofficial DeepL API client for Go.

## Usage

```go
package main

import (
"context"
"encoding/json"
"fmt"
"log"
"os"

"github.com/candy12t/go-deepl"
)

func main() {
authkey := os.Getenv("DEEPL_AUTH_KEY")
client := deepl.NewClient(authkey)

translatetext, err := client.TranslateText(context.Background(), []string{"Hello world"}, "JA", deepl.TranslateOption{SourceLang: "EN"})
if err != nil {
log.Fatal(err)
}
b, err := json.Marshal(translatetext)
if err != nil {
log.Fatal(err)
}
fmt.Println(string(b))
}
```

## References

- [DeepL API](https://www.deepl.com/en/docs-api)

## APIs

- [ ] translate text
- [ ] translate documents
- [ ] manage glossaries
- [x] check usage and limits
- [ ] retrieve supported languages
### Translate Text

- [x] POST /v2/translate

### Translate Documents

- [ ] POST /v2/document
- [ ] POST /v2/document/{document_id}
- [ ] POST /v2/document/{document_id}/result

### Manage Glossaries

- [x] GET /v2/glossary-language-pairs
- [x] POST /v2/glossaries
- [x] GET /v2/glossaries
- [x] GET /v2/glossaries/{glossary_id}
- [x] DELETE /v2/glossaries/{glossary_id}
- [x] GET /v2/glossaries/{glossary_id}/entries

### General

- [x] GET /v2/usage
- [x] GET /v2/languages

0 comments on commit ade3df8

Please sign in to comment.