Skip to content

Commit e2505fb

Browse files
authored
Merge pull request #97 from frzsombor/readme-patch-1
Main readme fixes and updates
2 parents 60adf74 + 7478691 commit e2505fb

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

README.md

+15-12
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,19 @@ $tr->getResponse($word); // Returns raw array of translated data.
6868

6969
### Advanced Configuration
7070

71-
This package uses [Guzzle](https://github.com/guzzle/guzzle) for HTTP requests. You can pass an associative array of [guzzle client configuration options](http://guzzle.readthedocs.org/en/5.3/clients.html#creating-a-client) as a third parameter to `TranslateClient` constructor.
71+
This package uses [Guzzle](https://github.com/guzzle/guzzle) for HTTP requests. You can pass an associative array of [guzzle client configuration options](http://docs.guzzlephp.org/en/latest/request-options.html) as a third parameter to `TranslateClient` constructor.
7272

7373
You can configure proxy, user-agent, default headers, connection timeout and so on using this options.
7474

7575
```php
7676
$tr = new TranslateClient(null, 'en', [
77-
'defaults' => [
78-
'timeout' => 10,
79-
'proxy' => [
80-
'http' => 'tcp://localhost:8125',
81-
'https' => 'tcp://localhost:9124'
82-
],
83-
'headers' => [
84-
'User-Agent' => 'Foo/5.0 Lorem Ipsum Browser'
85-
]
77+
'timeout' => 10,
78+
'proxy' => [
79+
'http' => 'tcp://localhost:8125',
80+
'https' => 'tcp://localhost:9124'
81+
],
82+
'headers' => [
83+
'User-Agent' => 'Foo/5.0 Lorem Ipsum Browser'
8684
]
8785
]);
8886
```
@@ -143,9 +141,14 @@ Both static and non-static `translate()` methods will throw following Exceptions
143141

144142
In addition `translate()` method will return boolean `FALSE` if there is no translation available.
145143

144+
### Known limitations
145+
146+
- `503 Service Unavailable` response:
147+
If you are getting this error, it is most likely that Google has banned your external IP address and/or [requires you to solve a CAPTCHA](https://github.com/Stichoza/google-translate-php/issues/18). This is not a bug in this package. Google has become stricter, and it seems like they keep lowering the number of allowed requests per IP per a certain amount of time. Try sending less requests to stay under the radar, or change your IP frequently ([for example using proxies](#advanced-configuration)). Please note that once an IP is banned, even if it's only temporary, the ban can last from a few minutes to more than 12-24 hours, as each case is different.
148+
- `413 Request Entity Too Large` response:
149+
This error means that your input string is too long. Google only allows a maximum of 5000 characters to be translated at once. If you want to translate a longer text, you can split it to shorter parts, and translate them one-by-one.
150+
146151
## Disclaimer
147152

148153
This package is developed for educational purposes only. Do not depend on this package as it may break anytime as it is based on crawling the Google Translate website. Consider buying [Official Google Translate API](https://cloud.google.com/translate/) for other types of usage.
149154

150-
Also, Google might ban your server IP or [require to solve CAPTCHA](https://github.com/Stichoza/google-translate-php/issues/18) if you send unusual traffic (large amount of data/requests).
151-

0 commit comments

Comments
 (0)