TTMSFNCCloudTranslation Class
Cloud translation component that translates text, detects the language of text and lists the languages supported by a selectable provider (Google, Microsoft or DeepL). Surfaces the connection settings, events and result collections at design time.
API unit family: TMSFNCCloudTranslation
Inherits from: TTMSFNCCustomCloudTranslation
Syntax
TTMSFNCCloudTranslation = class(TTMSFNCCustomCloudTranslation)
Remarks
Assign an APIKey and pick a provider through Service, then call the translate, detect or supported-languages methods inherited from the base class.
Properties
| Name | Description |
|---|---|
| APIKey | Authentication key used to connect to the selected translation service. (inherited from TTMSFNCCustomCloudTranslation) |
| Detections | Detections returned by the most recent detect request. (inherited from TTMSFNCCustomCloudTranslation) |
| Service | Translation service provider used by the component. Defaults to the Google service. (inherited from TTMSFNCCustomCloudTranslation) |
| ServiceEndPoint | Service endpoint URL used for requests. Applies to providers, such as Microsoft Translator, that allow a custom endpoint. (inherited from TTMSFNCCustomCloudTranslation) |
| ServiceRegion | Service region used for requests. Applies to providers, such as Microsoft Translator, that require a region. Leave empty when not used. (inherited from TTMSFNCCustomCloudTranslation) |
| SupportedLanguages | List of languages supported by the selected service, filled by a supported-languages request. (inherited from TTMSFNCCustomCloudTranslation) |
| TranslationInstance | Active translation service instance backing the component. (inherited from TTMSFNCCustomCloudTranslation) |
| TranslationProperties | Connection properties (API key, endpoint and region) supplied to the active service instance. (inherited from TTMSFNCCustomCloudTranslation) |
| TranslationRequests | History of translate and detect operations performed by the component. (inherited from TTMSFNCCustomCloudTranslation) |
| Translations | Translations returned by the most recent translate request. (inherited from TTMSFNCCustomCloudTranslation) |
Methods
| Name | Description |
|---|---|
| Detect | Detects the source language of a single text value. The request runs asynchronously; the result is delivered through the callback and the detect event. (inherited from TTMSFNCCustomCloudTranslation) |
| GetSupportedLanguages | Requests the list of languages supported by the selected service. The request runs asynchronously; the result is delivered through the callback and the supported-languages event. (inherited from TTMSFNCCustomCloudTranslation) |
| Translate | Translates a single text value into the target language. The request runs asynchronously; the result is delivered through the callback and the translate event. (inherited from TTMSFNCCustomCloudTranslation) |
Events
| Name | Description |
|---|---|
| OnDetect | Fires when a language-detection request completes, exposing the request object that holds the returned detections. (inherited from TTMSFNCCustomCloudTranslation) |
| OnGetSupportedLanguages | Fires when a supported-languages request completes, exposing the list of languages returned by the service. (inherited from TTMSFNCCustomCloudTranslation) |
| OnTranslate | Fires when a translate request completes, exposing the request object that holds the returned translations. (inherited from TTMSFNCCustomCloudTranslation) |