Skip to content

How to translate only the source language? #43

@drozd2000

Description

@drozd2000

Use case

I am using this Deepl API for Python to translate phrases:

from deepl import Translator
...
deepl_translator = Translator(api_key)
translated_text_object = deepl_translator.translate_text(
      "Contraction of cortical representation zones", 
      source_lang="ES",
      target_lang="FR", 
      preserve_formatting=True,
      glossary=glossary_id
)
print(translated_text_object.text) 
print(translated_text_object.detected_source_lang)

The wrong result

How it is now:
Contraction des zones de représentation corticale
ES

The expected result

Is there a way to translate only from Spanish so the answer is gonna be
Contraction of cortical representation zones
EN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions