nidhal baccouri
commited on
Commit
·
bf1ba51
1
Parent(s):
97c5727
updated readme
Browse files- README.rst +20 -0
README.rst
CHANGED
|
@@ -493,6 +493,26 @@ Microsoft Translator
|
|
| 493 |
|
| 494 |
translated = MicrosoftTranslator(api_key='some-key', target='german').translate_file('path/to/file')
|
| 495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 496 |
|
| 497 |
Usage from Terminal
|
| 498 |
--------------------
|
|
|
|
| 493 |
|
| 494 |
translated = MicrosoftTranslator(api_key='some-key', target='german').translate_file('path/to/file')
|
| 495 |
|
| 496 |
+
Proxy usage
|
| 497 |
+
-------------
|
| 498 |
+
|
| 499 |
+
deep-translator provide out of the box usage of proxies. Just define your proxies config as a dictionary
|
| 500 |
+
and pass it to the corresponding translator. Below is an example using the GoogleTranslator but this feature
|
| 501 |
+
can be used with all supported translators.
|
| 502 |
+
|
| 503 |
+
.. code-block:: python
|
| 504 |
+
|
| 505 |
+
from deep_translator import GoogleTranslator
|
| 506 |
+
|
| 507 |
+
# define your proxy configs:
|
| 508 |
+
proxies_example = {
|
| 509 |
+
"https": "your https proxy", # example: 34.195.196.27:8080
|
| 510 |
+
"http": "your http proxy if available"
|
| 511 |
+
}
|
| 512 |
+
translated = GoogleTranslator(source='auto', target='de', proxies=proxies_example).translate("this package is awesome")
|
| 513 |
+
|
| 514 |
+
|
| 515 |
+
|
| 516 |
|
| 517 |
Usage from Terminal
|
| 518 |
--------------------
|