Skip to main content

Translate

AndroidiOS
If you are using the Unreal Engine, see Unreal Engine SDK's Translate.

Translation. See TranslatorLang for the list of supported languages.

Function Definition

public static void Translate(INTLTranslatorReq req_info);

Parameter Instructions

ParametersTypeExplanation
req_infoINTLTranslatorReqTranslation request information. For details, see INTLTransltorReq.

Observers

The callback handling interface is TranslatorResultObserver.The callback data structure is TranslatorResult.

Callback ID is INTL_TRANSLATOR_TRANSLATE.

Code example

TranslatorLang contains the list of supported voice languages. For details, see TranslatorLang.

INTLTranslatorReq translatorReq.SrcLang = new INTLTranslatorReq();
// SrcLang is not required, default is auto
translatorReq.SrcLang = TranslatorLang.auto_lang;
// TranslatorLang provides the currently supported languages
translatorReq.TargetLang = TranslatorLang.en;
// Content to be translated, supports up to 5 items in the following format
translatorReq.TranslateTexts = "[\"xxx\", \"xxx\"]";
// Initiate the translation request, requires a login state
INTLAPI.Translate(translatorReq);