TIMMsgTranslateText

Introduction

Translate text messages

Parameter details

Parameter name Parameter type Required Description
TranslateTextParam TranslateTextParam yes Param of translating text messages

Returned template

Promise<commonResult<Array<MessageTranslateTextResult>>>

{
    code: TIMResult | TIMErrCode;
    desc?: string | undefined;
    json_param?: Array< '[MessageTranslateTextResult](../../Interface/advanceMessageInterface/MessageTranslateTextResult.md)' > | undefined;
    json_params?: Array< '[MessageTranslateTextResult](../../Interface/advanceMessageInterface/MessageTranslateTextResult.md)' > | undefined; 
    user_data?: string | undefined;
}

Return value details

name type description
code TIMResultTIMErrCode Request result: Error codes. 0 means success.
desc string | undefined The description of the error. It will be empty if success.
json_param Array< 'MessageTranslateTextResult' > | undefined Return value of calling API
json_params Array< 'MessageTranslateTextResult' > | undefined Return value of calling API. Compatible field, which is returned in some cases.
user_data string | undefined ImSDK is responsible for transporting user-defined data without any processing

Code example

let param:TranslateTextParam={
    json_source_text_array:["hello","what"],
    source_language:"auto",
    target_language:"zh"
}
timRenderInstance.TIMMsgTranslateText(param);

results matching ""

    No results matching ""