-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I23d89dea6f658a7aec592290a5af0643f654a7de
- Loading branch information
Jon Wayne Parrott
committed
Oct 12, 2016
1 parent
6d2f208
commit 4d326a8
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/> | ||
|
||
# Google Translate API Python Samples | ||
|
||
With the [Google Translate API][translate_docs], you can dynamically translate | ||
text between thousands of language pairs. | ||
|
||
[translate_docs]: https://cloud.google.com/translate/docs/ | ||
|
||
## Table of Contents | ||
|
||
* [Setup](#setup) | ||
* [Samples](#samples) | ||
* [Translate](#translate) | ||
|
||
## Setup | ||
|
||
Install dependencies: | ||
|
||
virtualenv env | ||
source env/bin/activate | ||
pip install -r requirements.txt | ||
|
||
## Samples | ||
|
||
### Translate | ||
|
||
View the [documentation][translate_docs] or the [source code][translate_code]. | ||
|
||
__Usage:__ `python snippets.py --help` | ||
|
||
``` | ||
usage: snippets.py [-h] | ||
api_key | ||
{detect-language,list-languages,list-languages-with-target,translate-text} | ||
... | ||
This application demonstrates how to perform basic operations with the | ||
Google Cloud Translate API | ||
For more information, the documentation at | ||
https://cloud.google.com/translate/docs. | ||
positional arguments: | ||
api_key Your API key. | ||
{detect-language,list-languages,list-languages-with-target,translate-text} | ||
detect-language Detects the text's language. | ||
list-languages Lists all available langauges. | ||
list-languages-with-target | ||
Lists all available langauges and localizes them to | ||
the target language. Target must be an ISO 639-1 | ||
language code. | ||
translate-text Translates text into the target language. Target must | ||
be an ISO 639-1 language code. | ||
optional arguments: | ||
-h, --help show this help message and exit | ||
``` | ||
|
||
[translate_docs]: https://cloud.google.com/translate/docs | ||
[translate_code]: snippets.py |