Skip to content

Commit

Permalink
Add remaining Translate samples. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored Sep 1, 2016
1 parent 0262821 commit 3e62941
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
30 changes: 18 additions & 12 deletions packages/google-cloud-translate/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,28 @@ __Usage:__ `node translate --help`

```
Commands:
detect <text> Detect the language of the provided text
list List available translation languages.
translate <text> Translate the provided text to the target language.
detect <input..> Detect the language of the provided text or texts
list [target] List available translation languages. To return language names in a language other than
English, specify a target language.
translate <toLang> <input..> Translate the provided text or texts to the target language, optionally specifying the
source language.
Options:
--apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment
variable. [string]
--help Show help [boolean]
--apiKey, -k Your Translate API key. Defaults to the value of the TRANSLATE_API_KEY environment variable. [string]
--help Show help [boolean]
Examples:
node translate detect -k your-key "Hello world!" Detect the language of "Hello world!".
node translate list -k your-key List available translation languages.
node translate translate -k your-key --to ru "Good Translate "Good morning!" to Russian,
morning!" auto-detecting English.
node translate translate -k your-key --to ru Translate "Good morning!" to Russian from
--from en "Good morning!" English.
node translate detect "Hello world!" Detect the language of "Hello world!".
node translate detect -k your-api-key "Hello world!" Detect the language of "Hello world!" and "Goodbye",
"Goodbye" supplying the API key inline..
node translate list -k your-api-key List available translation languages with names in
English, supplying the API key inline..
node translate list es List available translation languages with names in
Spanish.
node translate translate ru "Good morning!" Translate "Good morning!" to Russian, auto-detecting the
source language.
node translate translate ru "Good morning!" -f en -k Translate "Good morning!" to Russian from English,
your-api-key supplying the API key inline.
For more information, see https://cloud.google.com/translate/docs
```
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-translate/samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"system-test": "mocha -R spec -t 120000 --require intelli-espower-loader ../system-test/_setup.js system-test/*.test.js"
},
"dependencies": {
"@google-cloud/translate": "^0.1.1",
"@google-cloud/translate": "^0.2.0",
"iso-639-1": "^1.2.1",
"yargs": "^5.0.0"
},
Expand Down

0 comments on commit 3e62941

Please sign in to comment.