Skip to main content

Translation Callback Information (TranslatorResult)

Data Structure

INTLTranslatorResult: Inherits from INTLBaseResult, and contains basic information

translatorResp Text Translation

ParametersTypeExplanation
translatorRespStringProcessing results returned by the translation service, text translation needs to be handled independently by the Project side. See translatorResp for details

Code Example:

{
"debugInfo":null,
"message":"Success",
"result":[
{
"id":"xxxx",
"output":"xxx",
"text":"xxx"
}
],
"retCode":"0"
}

translatorResp

retCodemessageExplanation
0SuccessSuccess
1001ParamsErrorParameter Error
1002ServiceInternalErrorInternal Service Error
1003PermissionErrorPermission error, the entered appId may not exist or the token is invalid
1007rate limit reachedDaily PV or QPM exceeded limit

asrRsp Speech-to-Text

ParametersTypeDescription
asrRspstringProcessing results returned by the Service, ASR speech-to-text translation must be handled independently by the Project side. See asr_rsp for details

Example code:

{
"message": "",
"result": {
"voiceTextStr": "Dude, what's going on with the map?"
},
"retCode": 0,
"traceId": ""
}

asr_rsp

NameTypeDescription
traceIdstringA unique request id can be set to track requests
messagestringtranslator result message
resultlist of result objectobject
retCodestringThe Service return code, possible values are: "0" - success, "1001" - parameter error, "1002" - internal Service error

result

ParametersTypeDescription
voiceTextStrstringASR speech-to-text result