File tree Expand file tree Collapse file tree
packages/google-cloud-translate/samples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ __Usage:__ `node translate.js --help`
3333
3434```
3535Commands:
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
4343Options:
4444 --help Show help [boolean]
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff 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]
You can’t perform that action at this time.
0 commit comments