Skip to content

Commit

Permalink
Add docs for setClient() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Stichoza committed Aug 5, 2021
1 parent 4e436b0 commit 85039e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ And use:
$tr->setTokenProvider(new MyTokenGenerator);
```

### Translation Client (Quality)

Google Translate has a parameter named `client` which defines quality of translation. First it was set to `webapp` but later google added `gtx` value which results in a better translation quality in terms of grammar and overall meaning of sentences.

You can use `->setClient()` method to switch between clients. For example if you want to use older version of translation algorithm, type `$tr->setClient('webapp')->translate('lorem ipsum...')`. Default value is `gtx`.

### Errors and Exception Handling

Static method `trans()` and non-static `translate()` and `getResponse()` will throw following Exceptions:
Expand Down

0 comments on commit 85039e0

Please sign in to comment.