Represents options for translating text.

interface TranslateOptions {
    from?: string;
    to?: string;
    timeout?: number;
    retry?: number;
    raw?: boolean;
}

Hierarchy (view full)

Properties

from?: string

The language name/ISO 639-1 code to translate from. If none is given, it will auto-detect the source language

to?: string

The language name/ISO 639-1 code to translate to. If none is given, it will translate to English

timeout?: number

Timeout duration for the translation request in milliseconds (default: 30000)

retry?: number

Retry attempts for the translation request in case of failure (default: 0)

raw?: boolean