Class TDeepLAPI

Unit

Declaration

type TDeepLAPI = class(TObject)

Description

This item has no description.

Hierarchy

Overview

Constants

Public ServerURLFree = 'https://api-free.deepl.com';
Public ServerURLPro = 'https://api.deepl.com';

Methods

Public class procedure Init(AServerURL: string);
Public class function TranslateTextSync(auth_key, target_lang, text: string; OptionalSettings: TJSONObject; FreeOptionalSettings: boolean; var DetectedSourceLang: string): string; overload;
Public class function TranslateTextSync(auth_key, target_lang, text: string; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true): string; overload;
Public class function TranslateTextSync(auth_key, source_lang, target_lang, text: string; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true): string; overload;
Public class procedure TranslateTextASync(auth_key, target_lang, text: string; onTextTranslatedProc: TOnTextTranslatedProc; onTextTranslatedErrorProc: TOnTextTranslatedErrorProc = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;
Public class procedure TranslateTextASync(auth_key, source_lang, target_lang, text: string; onTextTranslatedProc: TOnTextTranslatedProc; onTextTranslatedErrorProc: TOnTextTranslatedErrorProc = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;
Public class procedure TranslateTextASync(auth_key, target_lang, text: string; onTextTranslatedEvent: TOnTextTranslatedEvent; onTextTranslatedErrorEvent: TOnTextTranslatedErrorEvent = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;
Public class procedure TranslateTextASync(auth_key, source_lang, target_lang, text: string; onTextTranslatedEvent: TOnTextTranslatedEvent; onTextTranslatedErrorEvent: TOnTextTranslatedErrorEvent = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;

Description

Constants

Public ServerURLFree = 'https://api-free.deepl.com';

This item has no description.

Public ServerURLPro = 'https://api.deepl.com';

This item has no description.

Methods

Public class procedure Init(AServerURL: string);

Call to initialize DeepL API Server URL. By default the Free API Server is used.

Parameters
AServerURL
URL to the server API. Use TDeepLAPI.ServerURLPro or TDeepLAPI.ServerURLFree for official servers.
Public class function TranslateTextSync(auth_key, target_lang, text: string; OptionalSettings: TJSONObject; FreeOptionalSettings: boolean; var DetectedSourceLang: string): string; overload;

call DeepL API to translate the text from source_lang to target_lang (synchrone - current thread is freezed during process)

look at https://developers.deepl.com/api-reference/translate

Parameters
OptionalSettings
JSON object contening your optional parameters. They are passed "as it" to DeepL in request body.
Public class function TranslateTextSync(auth_key, target_lang, text: string; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true): string; overload;

This item has no description.

Public class function TranslateTextSync(auth_key, source_lang, target_lang, text: string; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true): string; overload;

This item has no description.

Public class procedure TranslateTextASync(auth_key, target_lang, text: string; onTextTranslatedProc: TOnTextTranslatedProc; onTextTranslatedErrorProc: TOnTextTranslatedErrorProc = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;

call DeepL API to translate the text from source_lang to target_lang (asynchrone - don't freeze current thread)

look at https://developers.deepl.com/api-reference/translate

Parameters
OptionalSettings
JSON object contening your optional parameters. They are passed "as it" to DeepL in request body.
Public class procedure TranslateTextASync(auth_key, source_lang, target_lang, text: string; onTextTranslatedProc: TOnTextTranslatedProc; onTextTranslatedErrorProc: TOnTextTranslatedErrorProc = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;

This item has no description.

Public class procedure TranslateTextASync(auth_key, target_lang, text: string; onTextTranslatedEvent: TOnTextTranslatedEvent; onTextTranslatedErrorEvent: TOnTextTranslatedErrorEvent = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;

call DeepL API to translate the text from source_lang to target_lang (asynchrone - don't freeze current thread)

look at https://developers.deepl.com/api-reference/translate

Parameters
OptionalSettings
JSON object contening your optional parameters. They are passed "as it" to DeepL in request body.
Public class procedure TranslateTextASync(auth_key, source_lang, target_lang, text: string; onTextTranslatedEvent: TOnTextTranslatedEvent; onTextTranslatedErrorEvent: TOnTextTranslatedErrorEvent = nil; OptionalSettings: TJSONObject = nil; FreeOptionalSettings: boolean = true); overload;

This item has no description.

DeepL API client library for Delphi (c) 2020-2026 Patrick PREMARTIN - Powered by PasDoc
Generated by PasDoc 1.0.2.