Translation Callback Information (TranslatorResult)
Data Structure
FINTLTranslatorResult: Inherited from FINTLBaseResult, contains basic information
caution
- The translation callback returns
"Invalid param, openid or token empty", which is caused by not passing in openid or token.Login again and obtain the correct openid and token from the authResult login state, then pass them into the interface. - The translation callback returns
"msg":"invalid config","ret:91002", which is caused by missing backend configuration. You can contact the Player Network Assistant for individual configuration.
translatorResp Text Translation
| Parameters | Type | Explanation |
|---|---|---|
| translatorResp | string | Processing results returned by the translation service, which need to be handled independently by the game side. See translatorResp for details |
Code Example:
{
"debugInfo":null,
"message":"Success",
"result":[
{
"id":"xxxx",
"output":"xxx",
"text":"xxx"
}
],
"retCode":"0"
}
translatorResp
| retCode | message | Explanation |
|---|---|---|
| 0 | Success | Success |
| 1001 | ParamsError | Parameter Error |
| 1002 | ServiceInternalError | Internal Service Error |
| 1003 | PermissionError | Permission error, the entered appId may not exist or the token is invalid |
| 1007 | rate limit reached | Daily PV or QPM exceeded limit |
asrRsp Speech-to-Text
| Parameter | Type | Description |
|---|---|---|
| asrRsp | string | Processing result returned by the translation service. The ASR speech-to-text translation needs to be handled on 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
| Name | Type | Description |
|---|---|---|
| traceId | string | A unique request ID can be set for tracking requests. |
| message | string | translator result message |
| result | list of result object | object |
| retCode | string | The Service return code. Valid values include: "0" - success, "1001" - parameter error, "1002" - internal Service error. |
result
| Parameter | Type | Description |
|---|---|---|
| voiceTextStr | string | ASR speech text result |