Table of Contents

TTMSFNCCustomCloudTranslation.Translate Method

Translates a single text value into the target language. The request runs asynchronously; the result is delivered through the callback and the translate event.

API unit family: TMSFNCCloudTranslation Declaring type: TTMSFNCCustomCloudTranslation

Overloads

Overload 1

Translates a single text value into the target language. The request runs asynchronously; the result is delivered through the callback and the translate event.

procedure Translate(AText: string; const ALanguage: string = 'en'; ACallback: TTMSFNCCloudTranslationTranslateCallback = nil); overload; virtual;

Remarks

Requires a valid APIKey; otherwise an exception is raised.

Parameters

Name Description
AText Text to translate. Multiple values may be passed separated by a semicolon.
ALanguage Target language code. Defaults to 'en'.
ACallback Optional callback invoked when the request completes.

Overload 2

Translates a list of text values into the target language. The request runs asynchronously; the result is delivered through the callback and the translate event.

procedure Translate(ATextList: TStringList; const ALanguage: string = 'en'; ACallback: TTMSFNCCloudTranslationTranslateCallback = nil); overload; virtual;

Remarks

Requires a valid APIKey; otherwise an exception is raised.

Parameters

Name Description
ATextList List of text lines to translate.
ALanguage Target language code. Defaults to 'en'.
ACallback Optional callback invoked when the request completes.