Skip to content

Commit 75a1028

Browse files
authored
Bring ML APIs up to standard. (#346)
1 parent 729b8a4 commit 75a1028

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

packages/google-cloud-translate/samples/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ __Usage:__ `node translate.js --help`
3333

3434
```
3535
Commands:
36-
detect <input..> Detects the language of one or more strings.
37-
list [target] Lists available translation languages. To return language names in a
38-
language other than English, specify a target language.
39-
translate <toLang> <input..> Translates one or more strings into the target language.
40-
translate-with-model <toLang> <model> <input..> Translates one or more strings into the target language using the
41-
specified model.
36+
detect <text..> Detects the language of one or more strings.
37+
list [target] Lists available translation languages. To language names in a language
38+
other than English, specify a target language.
39+
translate <toLang> <text..> Translates one or more strings into the target language.
40+
translate-with-model <toLang> <model> <text..> Translates one or more strings into the target language using the
41+
specified model.
4242
4343
Options:
4444
--help Show help [boolean]

packages/google-cloud-translate/samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"dependencies": {
1111
"@google-cloud/translate": "0.8.0",
12-
"yargs": "6.6.0"
12+
"yargs": "7.0.2"
1313
},
1414
"engines": {
1515
"node": ">=4.3.2"

packages/google-cloud-translate/samples/quickstart.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@ translateClient.translate(text, target)
3939

4040
console.log(`Text: ${text}`);
4141
console.log(`Translation: ${translation}`);
42+
})
43+
.catch((err) => {
44+
console.error('ERROR:', err);
4245
});
4346
// [END translate_quickstart]

0 commit comments

Comments
 (0)