Send feedback
Class v2.Translate (6.2.7)
Stay organized with collections
Save and categorize content based on your preferences.
Version 6.2.7 keyboard_arrow_down
Inheritance
Service
>
v2.Translate
Package
@google-cloud/translate!
Constructors
(constructor)(options)
constructor ( options ?: TranslateConfig );
Parameter
Name Description options
TranslateConfig
Properties
key
Property Value
options
options : TranslateConfig ;
Property Value
Type Description TranslateConfig
Methods
detect(input)
detect ( input : string ) : Promise <[ DetectResult , Metadata ]>;
Parameter
Name Description input
string
Returns
Type Description Promise <[DetectResult , Metadata ]>
detect(input)
detect ( input : string []) : Promise <[ DetectResult [], Metadata ]>;
Parameter
Name Description input
string[]
Returns
Type Description Promise <[DetectResult [], Metadata ]>
detect(input, callback)
detect ( input : string , callback : DetectCallback<DetectResult> ) : void ;
Parameters
Name Description input
string
callback
DetectCallback <DetectResult >
Returns
detect(input, callback)
detect ( input : string [], callback : DetectCallback<DetectResult []>) : void ;
Parameters
Name Description input
string[]
callback
DetectCallback <DetectResult []>
Returns
getLanguages(target)
getLanguages ( target ?: string ) : Promise <[ LanguageResult [], Metadata ]>;
Parameter
Name Description target
string
Returns
Type Description Promise <[LanguageResult [], Metadata ]>
getLanguages(target, callback)
getLanguages ( target : string , callback : GetLanguagesCallback ) : void ;
Parameters
Name Description target
string
callback
GetLanguagesCallback
Returns
getLanguages(callback)
getLanguages ( callback : GetLanguagesCallback ) : void ;
Parameter
Name Description callback
GetLanguagesCallback
Returns
request(reqOpts, callback)
request ( reqOpts : DecorateRequestOptions , callback : BodyResponseCallback ) : void ;
A custom request implementation. Requests to this API may optionally use an API key for an application, not a bearer token from a service account. This means it is possible to skip the makeAuthenticatedRequest
portion of the typical request lifecycle, and manually authenticate the request here.
Parameters
Name Description reqOpts
DecorateRequestOptions
Request options that are passed to request
.
callback
BodyResponseCallback
The callback function passed to request
.
Returns
translate(input, options)
translate ( input : string , options : TranslateRequest ) : Promise <[ string , Metadata ]>;
Parameters
Name Description input
string
options
TranslateRequest
Returns
Type Description Promise <[string, Metadata ]>
translate(input, options)
translate ( input : string [], options : TranslateRequest ) : Promise <[ string [], Metadata ]>;
Parameters
Name Description input
string[]
options
TranslateRequest
Returns
Type Description Promise <[string[], Metadata ]>
translate(input, to)
translate ( input : string , to : string ) : Promise <[ string , Metadata ]>;
Parameters
Name Description input
string
to
string
Returns
Type Description Promise <[string, Metadata ]>
translate(input, to)
translate ( input : string [], to : string ) : Promise <[ string [], Metadata ]>;
Parameters
Name Description input
string[]
to
string
Returns
Type Description Promise <[string[], Metadata ]>
translate(input, options, callback)
translate ( input : string , options : TranslateRequest , callback : TranslateCallback<string> ) : void ;
Parameters
Name Description input
string
options
TranslateRequest
callback
TranslateCallback <string>
Returns
translate(input, to, callback)
translate ( input : string , to : string , callback : TranslateCallback<string> ) : void ;
Parameters
Name Description input
string
to
string
callback
TranslateCallback <string>
Returns
translate(input, options, callback)
translate ( input : string [], options : TranslateRequest , callback : TranslateCallback<string []>) : void ;
Parameters
Name Description input
string[]
options
TranslateRequest
callback
TranslateCallback <string[]>
Returns
translate(input, to, callback)
translate ( input : string [], to : string , callback : TranslateCallback<string []>) : void ;
Parameters
Name Description input
string[]
to
string
callback
TranslateCallback <string[]>
Returns
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-06 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-06 UTC."],[],[]]