Translate Image

Translator

The Translator class is the core component of the lara-sdk, designed for translating text. It must be initialized with authentication credentials.

// Sdk available soon
import {Credentials, Translator} from "@translated/lara";

const LARA_ACCESS_KEY_ID: string = "your-access-key-id";
const LARA_ACCESS_KEY_SECRET: string = "your-access-key-secret";

// Initialization of the Translator class
const credentials = new Credentials(LARA_ACCESS_KEY_ID, LARA_ACCESS_KEY_SECRET)
const lara: Translator = new Translator(credentials);
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon

Translate

Translates image from a source language to a target language. It supports context-aware translations and adaptation to specific translation memories, it returns a translated image.

Request

// Sdk available soon
const res  = await lara.images.translate('path/to/image.jpg', 'en-US', 'it-IT', {
        adaptTo: ['mem_1_id', 'mem_2_id'],
        glossaries: ['gls_1_id', 'gls_2_id'],
        instructions: ['Be formal'],
        style: 'fluid'
});
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon

Here follows the basic fields for the translate method:

Field

Type

Required

Default

Description

file / imagePath

File / String

Yes


The input image/the path to input image to translate.

source

String

No

Autodetected

The source language code (e.g., "en-EN" for English). If not specified, the system will attempt to detect it automatically.

target

String

Yes


The target language code (e.g., "it-IT" for Italian). This specifies the language you want the text translated into.

options

ImageTranslationOptions

No


See the table below for details.

Several options are available to customize the behavior of the translate method:

Field

Type

Required

Default

Description

adaptTo

String[]

No

Default is all Memories on your account

A list of translation memory IDs for adapting the translation.

glossaries

String[]

No


A list of glossary IDs.

noTrace

Boolean

No

False

If set to True, source content and its translation will not be saved on our system. (AKA Incognito mode)

style

String

No

faithful

The style to apply to the translation. Available values: faithful fluid creative

textRemoval

String

No

inpainting

Customize how the original text is removed from the image.
Available values: inpainting (20 centesimi) overlay (15 centesimi)


Translate text image

Translates the text inside an image from a source language to a target language. It supports context-aware translations and adaptation to specific translation memories, it returns the original and the translated text.

Request

// Sdk available soon
const res  = await lara.images.translate_text('path/to/image.jpg', 'en-US', 'it-IT', {
        adaptTo: ['mem_1_id', 'mem_2_id'],
        glossaries: ['gls_1_id', 'gls_2_id'],
        instructions: ['Be formal'],
        style: 'fluid'
});
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon

Here follows the basic fields for the translateText method:

Field

Type

Required

Default

Description

file / imagePath

File / String

Yes


The input image/the path to input image to translate.

source

String

No

Autodetected

The source language code (e.g., "en-EN" for English). If not specified, the system will attempt to detect it automatically.

target

String

Yes


The target language code (e.g., "it-IT" for Italian). This specifies the language you want the text translated into.

options

ImageTextTranslationOptions

No


See the table below for details.

Several options are available to customize the behavior of the translateText method:

Field

Type

Required

Default

Description

adaptTo

String[]

No

Default is all Memories on your account

A list of translation memory IDs for adapting the translation.

glossaries

String[]

No


A list of glossary IDs.

noTrace

Boolean

No

False

If set to True, source content and its translation will not be saved on our system. (AKA Incognito mode)

style

String

No

faithful

The style to apply to the translation. Available values: faithful fluid creative

Response

// Sdk available soon
TextResult(
    translation=[
        Paragraphs(text="Hello, how are you?",translation = "Ciao, come stai?"),
        Paragraphs(text="What a wonderful day",translation = "Che giornata meravigliosa.")
    ]
)
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon
// Sdk available soon

Supported languages

  • Acehnese: ace-ID
  • Afrikaans: af-ZA
  • Albanian: sq-AL
  • Arabic: ar-SA
  • Azerbaijani: az-AZ
  • Basque: eu-ES
  • Bosnian: bs-BA
  • Bulgarian: bg-BG
  • Catalan: ca-ES
  • Chinese (Simplified): zh-CN
  • Chinese (Traditional): zh-TW
  • Chinese (Traditional, Hong Kong): zh-HK
  • Croatian: hr-HR
  • Czech: cs-CZ
  • Danish: da-DK
  • Dutch: nl-NL
  • Dutch (Belgium): nl-BE
  • English (Australia): en-AU
  • English (Canada): en-CA
  • English (Ireland): en-IE
  • English (United Kingdom): en-GB
  • English (United States): en-US
  • Estonian: et-EE
  • Filipino: fil-PH
  • Finnish: fi-FI
  • French: fr-FR
  • French (Canada): fr-CA
  • Galician: gl-ES
  • German: de-DE
  • Greek: el-GR
  • Hebrew: he-IL
  • Hindi: hi-IN
  • Hungarian: hu-HU
  • Icelandic: is-IS
  • Indonesian: id-ID
  • Irish: ga-IE
  • Italian: it-IT
  • Japanese: ja-JP
  • Javanese: jv-ID
  • Kazakh: kk-KZ
  • Korean: ko-KR
  • Latvian: lv-LV
  • Lithuanian: lt-LT
  • Macedonian: mk-MK
  • Malay: ms-MY
  • Maltese: mt-MT
  • Marathi: mr-IN
  • Mongolian: mn-MN
  • Nepali: ne-NP
  • Persian: fa-IR
  • Polish: pl-PL
  • Portuguese (Brazil): pt-BR
  • Portuguese (Portugal): pt-PT
  • Punjabi: pa-IN
  • Romanian: ro-RO
  • Russian: ru-RU
  • Serbian (Cyrillic script): sr-Cyrl-RS
  • Serbian (Latin script): sr-Latn-RS
  • Slovak: sk-SK
  • Slovenian: sl-SI
  • Somali: so-SO
  • Spanish: es-ES
  • Spanish (Argentina): es-AR
  • Spanish (Latin America): es-419
  • Spanish (Mexico): es-MX
  • Sundanese: su-ID
  • Swahili: sw-KE
  • Swedish: sv-SE
  • Tamil: ta-IN
  • Thai: th-TH
  • Tosk Albanian: als-AL
  • Turkish: tr-TR
  • Ukrainian: uk-UA
  • Urdu: ur-PK
  • Vietnamese: vi-VN
  • Welsh: cy-GB
  • Zulu: zu-ZA

  • Billing

    Details are available in the pricing page