Request Translation
The translate function.
The total request body size must not exceed 128 KiB (128 · 1024 bytes). Please split up your text into multiple calls if it exceeds this limit.
Language of the text to be translated. Options currently available:
AR
- Arabic [1]BG
- BulgarianCS
- CzechDA
- DanishDE
- GermanEL
- GreekEN
- EnglishES
- SpanishET
- EstonianFI
- FinnishFR
- FrenchHU
- HungarianID
- IndonesianIT
- ItalianJA
- JapaneseKO
- KoreanLT
- LithuanianLV
- LatvianNB
- Norwegian (Bokmål)NL
- DutchPL
- PolishPT
- Portuguese (all Portuguese varieties mixed)RO
- RomanianRU
- RussianSK
- SlovakSL
- SlovenianSV
- SwedishTR
- TurkishUK
- UkrainianZH
- ChineseIf this parameter is omitted, the API will attempt to detect the language of the text and translate it.
[1] Please note that Arabic has not yet been added to the /languages
endpoint because it does not
yet support document translation; only text translation is supported for Arabic at this time. When
document translation support is added for Arabic, we will a) remove this note and b) add Arabic to
the /languages
endpoint.
The language into which the text should be translated. Options currently available:
AR
- Arabic [1]BG
- BulgarianCS
- CzechDA
- DanishDE
- GermanEL
- GreekEN
- English (unspecified variant for backward compatibility; please select EN-GB
or EN-US
instead)EN-GB
- English (British)EN-US
- English (American)ES
- SpanishET
- EstonianFI
- FinnishFR
- FrenchHU
- HungarianID
- IndonesianIT
- ItalianJA
- JapaneseKO
- KoreanLT
- LithuanianLV
- LatvianNB
- Norwegian (Bokmål)NL
- DutchPL
- PolishPT
- Portuguese (unspecified variant for backward compatibility; please select PT-BR
or PT-PT
instead)PT-BR
- Portuguese (Brazilian)PT-PT
- Portuguese (all Portuguese variants excluding Brazilian Portuguese)RO
- RomanianRU
- RussianSK
- SlovakSL
- SlovenianSV
- SwedishTR
- TurkishUK
- UkrainianZH
- Chinese (unspecified variant for backward compatibility; please select ZH-HANS
or ZH-HANT
instead)ZH-HANS
- Chinese (simplified)ZH-HANT
- Chinese (traditional)[1] Please note that Arabic and traditional Chinese have not yet been added to the /languages endpoint because these languages do not yet support document translation; only text translation is supported for Arabic and traditional Chinese at this time. When document translation support is added for these languages, we will a) remove this note and b) add the languages to the /languages endpoint where appropriate.
The context
parameter makes it possible to include additional context that can influence a translation but is not translated itself.
This additional context can potentially improve translation quality when translating short, low-context source texts such
as product names on an e-commerce website, article headlines on a news website, or UI elements.
For example...
For best results, we recommend sending a few complete sentences of context in the same language as the source text.
There is no size limit for the context
parameter itself, but the request body size limit of 128 KiB still applies to
all text translation requests.
If you send a request with multiple text
parameters, the context
parameter will be applied to each one.
Characters included in the context
parameter will not be counted toward billing (i.e. there is no additional
cost for using the context
parameter, and only characters sent in the text parameter(s) will be counted toward
billing for text translation even when the context
parameter is included in a request).
Sets whether the translation engine should first split the input into sentences. For text translations where
tag_handling
is not set to html
, the default value is 1
, meaning the engine splits on punctuation and on newlines.
For text translations where tag_handling=html
, the default value is nonewlines
, meaning the engine splits on punctuation only, ignoring newlines.
The use of nonewlines
as the default value for text translations where tag_handling=html
is new behavior that was implemented in November 2022,
when HTML handling was moved out of beta.
Possible values are:
0
- no splitting at all, whole input is treated as one sentence1
(default when tag_handling
is not set to html
) - splits on punctuation and on newlinesnonewlines
(default when tag_handling=html
) - splits on punctuation only, ignoring newlinesFor applications that send one sentence per text parameter, we recommend setting split_sentences
to 0
, in order to prevent the engine from splitting the sentence unintentionally.
Please note that newlines will split sentences when split_sentences=1
. We recommend cleaning files so they don't contain breaking sentences or setting the parameter split_sentences
to nonewlines
.
Sets whether the translation engine should respect the original formatting, even if it would usually correct some aspects. Possible values are:
0
(default)1
The formatting aspects affected by this setting include:
Sets whether the translated text should lean towards formal or informal language.
This feature currently only works for target languages
DE
(German),
FR
(French),
IT
(Italian),
ES
(Spanish),
NL
(Dutch),
PL
(Polish),
PT-BR
and PT-PT
(Portuguese),
JA
(Japanese),
and RU
(Russian).
Learn more about the plain/polite feature for Japanese here.
Setting this parameter with a target language that does not support formality will fail,
unless one of the prefer_...
options are used.
Possible options are:
default
(default)more
- for a more formal languageless
- for a more informal languageprefer_more
- for a more formal language if available, otherwise fallback to default formalityprefer_less
- for a more informal language if available, otherwise fallback to default formalitysource_lang
parameter to be set and the language pair of the glossary has to match the language pair of the request.Sets which kind of tags should be handled. Options currently available:
xml
: Enable XML tag handling; see XML Handling.html
: Enable HTML tag handling; see HTML Handling.The automatic detection of the XML structure won't yield best results in all XML files. You can disable this automatic mechanism altogether by setting the outline_detection
parameter to 0
and selecting the tags that should be considered structure tags. This will split sentences using the splitting_tags
parameter.
In the example below, we achieve the same results as the automatic engine by disabling automatic detection with outline_detection=0
and setting the parameters manually to tag_handling=xml
, split_sentences=nonewlines
, and splitting_tags=par,title
.
<document> <meta> <title>A document's title</title> </meta> <content> <par>This is the first sentence. Followed by a second one.</par> <par>This is the third sentence.</par> </content> </document>
<document> <meta> <title>Der Titel eines Dokuments</title> </meta> <content> <par>Das ist der erste Satz. Gefolgt von einem zweiten.</par> <par>Dies ist der dritte Satz.</par> </content> </document>
While this approach is slightly more complicated, it allows for greater control over the structure of the translation output.
Comma-separated list of XML tags which never split sentences.
For some XML files, finding tags with textual content and splitting sentences using those tags won't yield the best results. The following example shows the engine splitting sentences on par
tags and proceeding to translate the parts separately, resulting in an incorrect translation:
<par>The firm said it had been </par><par> conducting an internal investigation.</par>
<par>Die Firma sagte, es sei eine gute Idee gewesen.</par><par> Durchführung einer internen Untersuchung.</par>
As this can lead to bad translations, this type of structure should either be avoided, or the non_splitting_tags
parameter should be set. The following example shows the same call, with the parameter set to par
:
<par>The firm said it had been </par><par> conducting an internal investigation.</par>
<par>Die Firma sagte, dass sie</par><par> eine interne Untersuchung durchgeführt</par><par> habe</par><par>.</par>
This time, the sentence is translated as a whole. The XML tags are now considered markup and copied into the translated sentence. As the translation of the words "had been" has moved to another position in the German sentence, the two par tags are duplicated (which is expected here).
Comma-separated list of XML tags which always cause splits.
See the example in the outline_detection
parameter's description.
Comma-separated list of XML tags that indicate text not to be translated.
Use this parameter to ensure that elements in the original text are not altered in the translation (e.g., trademarks, product names) and insert tags into your original text. In the following example, the ignore_tags
parameter is set to keep
:
Please open the page <keep>Settings</keep> to configure your system.
Bitte öffnen Sie die Seite <keep>Settings</keep> um Ihr System zu konfigurieren.
Specify how the response should be mapped to the table output. The following formats are available:
Structured Table: Returns a parsed table with data split into rows and columns.
source_lang
parameter, when specified.Raw Response: Returns the raw response in a single row with the following columns:
You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.
To use this node in KNIME, install the extension DeepL Nodes from the below update site following our NodePit Product and Node Installation Guide:
A zipped version of the software site can be downloaded here.
Deploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com, follow @NodePit on Twitter or botsin.space/@nodepit on Mastodon.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.