Repository navigation
Releases
Releases · DeepL/deepl-dotnet
v2.0.0
TL;DR: this release has breaking changes. See Upgrading to 2.0.0 for how to adapt.
Added
- Added the interfaces
ITextTranslator(TranslateTextAsync()),IDocumentTranslator(TranslateDocumentAsync(),
TranslateDocumentUploadAsync(),TranslateDocumentGetStatusAsync(),TranslateDocumentWaitUntilDoneAsync(),
TranslateDocumentDownloadAsync(), all overloads),ILanguageProvider(GetSourceLanguagesAsync(),
GetTargetLanguagesAsync(),GetGlossaryLanguagesAsync()) andIUsageProvider(GetUsageAsync()), implemented
byDeepLClient. They take the place of the removedITranslator, for example for mocking. - Breaking:
IGlossaryManagernow also declares the v2 glossary methodsCreateGlossaryAsync(),CreateGlossaryFromCsvAsync(),
GetGlossaryAsync(),WaitUntilGlossaryReadyAsync(),ListGlossariesAsync(),GetGlossaryEntriesAsync()and
DeleteGlossaryAsync(). Classes implementingIGlossaryManagerthemselves must add them. - Breaking:
IGlossaryManagernow also declares theDeepLClientoverloads that takeCreateMultilingualGlossaryOptions,
ReplaceMultilingualGlossaryDictionaryOptionsorBaseRequestOptions, theMultilingualGlossaryInfooverloads
ofGetMultilingualGlossaryAsync()andUpdateMultilingualGlossaryNameAsync(), and both
UpdateMultilingualGlossaryAsync()overloads. Classes implementingIGlossaryManagerthemselves must add them. - Breaking:
ITranslationMemoryManagernow also declares theDeepLClientoverloads that take
TranslationMemorySegmentsOptions,CreateTranslationMemoryImportOptions,ImportTranslationMemoryOptions, a
timeout or aTranslationMemoryJob. Classes implementingITranslationMemoryManagerthemselves must add them. - Breaking:
IWriternow also declares bothCorrectTextAsync()overloads. Classes implementingIWriterthemselves must
add them. - Breaking:
IStyleRuleManagernow also declares theDeepLClientoverloads that take aStyleRuleInfoor
CustomInstruction, and those that takeCreateStyleRuleOptions,UpdateStyleRuleNameOptions,
UpdateStyleRuleConfiguredRulesOptions,CreateStyleRuleCustomInstructionOptionsor
UpdateStyleRuleCustomInstructionOptions. Classes implementingIStyleRuleManagerthemselves must add them.
Changed
- Breaking: The package now targets
net8.0andnetstandard2.0; thenet5.0target is removed. .NET 5, 6 and 7
applications now use thenetstandard2.0build, which has no separate connect timeout (see
PerRetryConnectionTimeoutin the README) and does not honour cancellation while it copies a translation
memory export to a stream. The library is supported on .NET 8 and later, and on .NET Framework 4.6.2 and later.
Move applications on .NET 5, 6 or 7 to .NET 8 or later. - Breaking: The
System.Text.Jsondependency is now10.0.14and applies to thenetstandard2.0build only;net8.0uses
the framework's ownSystem.Text.Json. Applications onnetstandard2.0platforms that pin an older
System.Text.Jsonmust raise it to at least10.0.14. - Breaking: The
Microsoft.Extensions.Http.Pollydependency is now8.0.33(still Polly 7). Retry and timeout behaviour
are unchanged. Applications that pinMicrosoft.Extensions.HttporMicrosoft.Extensions.Http.Pollybelow 8.0
must raise them. - Breaking: The library is now tested on .NET 8 and .NET 10, instead of .NET 5 and .NET Core 3.1; the
netstandard2.0build
is tested on the .NET 8 runtime. .NET Core 3.1 and .NET 5 to 7 are not supported: theSystem.Text.Json10 and
Microsoft.Extensions.Http8 dependencies do not support them, and applications targeting them get a build
warning that the package "doesn't support" their target framework (an error withTreatWarningsAsErrors). Set
theSuppressTfmSupportBuildWarningsMSBuild property totrueto silence it, at your own risk. - Breaking: Glossary endpoints (v2 and v3 multilingual) now throw
NotFoundExceptionon HTTP 404, like every other endpoint;
they threw its subclassGlossaryNotFoundExceptionbefore. Code catchingNotFoundExceptionis unaffected.
CatchNotFoundExceptioninstead ofGlossaryNotFoundException. - Breaking:
DeepL.Internal.LargeFormUrlEncodedContent,MultilingualGlossaryDictionaryEntriesResultand the
MultilingualGlossaryDictionaryEntriesconstructor taking aMultilingualGlossaryDictionaryEntriesResultare now
internal. ConstructMultilingualGlossaryDictionaryEntriesfrom the language codes and aGlossaryEntries
object instead. - Breaking:
StyleRuleInfo.ConfiguredRulesis now aDictionary<string, Dictionary<string, string>>, the API's
configured_rulesobject as sent (category to rule to value, keyed by the API names), the same shape
CreateStyleRuleAsync()andUpdateStyleRuleConfiguredRulesAsync()take. Categories the removed
ConfiguredRulesclass lacked are no longer dropped. Replacerule.ConfiguredRules?.DatesAndTimeswith
rule.ConfiguredRules?["dates_and_times"](orTryGetValue("dates_and_times", ...)), and likewise for the other
categories. TheIStyleRuleManagermethodsCreateStyleRuleAsync()andUpdateStyleRuleConfiguredRulesAsync()
now take this map too, and so does theStyleRuleInfoconstructor. - Breaking: Text translation, rephrasing and correction, v2 glossary creation, and v3 glossary creation, renaming and
dictionary updates (CreateMultilingualGlossaryAsync(),CreateMultilingualGlossaryFromCsvAsync(),
UpdateMultilingualGlossaryNameAsync(),UpdateMultilingualGlossaryDictionaryAsync()and
UpdateMultilingualGlossaryDictionaryFromCsvAsync()) now send JSON request bodies instead of form-encoded ones.
text, the tag lists,custom_instructionsandglossary_idsare sent as JSON arrays, the v3dictionariesas
an array of objects, and booleans and numbers with their JSON types. Code that intercepts or asserts on request
bodies (proxies, test doubles) sees JSON withContent-Type: application/json. Document upload stays multipart,
withglossary_idscomma-separated as before. Such code must parse the JSON body instead of form fields. - Breaking:
BaseRequestOptions.ExtraBodyParameters(on every options class, including those ofDeepLAdminClient) is now a
Dictionary<string, object?>, so extra parameters can be booleans, numbers, arrays or objects. In JSON bodies each
value is sent with its JSON type, and anullvalue is sent as JSONnull. In the multipart document
upload, strings are sent as given, collections comma-joined, booleans astrue/[secure], numbers in the invariant
culture and other values as their JSON text. The API does not convert types, so a string for a field it types as
boolean, number or array (for example["outline_detection"] = "0") is now rejected: pass the typed value
(["outline_detection"] = [secure]) or use the matching option. Collection initializers with string values compile
unchanged; variables or helpers declared asDictionary<string, string>must be declared as
Dictionary<string, object?>. - Breaking:
TranslateDocumentAsync()(all overloads) now returnsTask<DocumentStatus>, the final status of the
translation (for example withBilledCharacters). Code that awaits it without using a result compiles unchanged;
classes implementingIDocumentTranslatormust change the return type. - Breaking:
TranslateDocumentWaitUntilDoneAsync()(both overloads) now returnsTask<DocumentStatus>, the final status with
status done, instead of discarding it. Classes implementingIDocumentTranslatormust change the return type. - Breaking:
TranslateDocumentAsync()no longer wraps a cancellation requested through itsCancellationTokenin a
DocumentTranslationException: theOperationCanceledException(usually aTaskCanceledException) propagates
as is, as in the step methods. Code catchingDocumentTranslationExceptionto detect cancellation must catch
OperationCanceledExceptioninstead. Timeouts and other failures are still wrapped. - Breaking:
TranslateDocumentAsync(FileInfo, ...)andTranslateDocumentUploadAsync(FileInfo, ...)now throw an
ArgumentExceptionbefore any request when the input file does not exist or is a directory, instead of a
FileNotFoundException,DirectoryNotFoundExceptionorUnauthorizedAccessException. Other local file failures of
TranslateDocumentAsync(FileInfo, ...)(the input cannot be read, the output file already exists or cannot be
created) now throw aDocumentTranslationExceptionwith theIOExceptionorUnauthorizedAccessExceptionas
InnerException, still before any request; an existing output file is still left unchanged. Catch
ArgumentExceptionandDocumentTranslationExceptioninstead of the I/O exceptions. - Breaking:
TranslationMemoryJob.DoneandTranslationMemoryJobResult.Doneare nowtrueonly for
TranslationMemoryJobStatus.Completed; a failed or expired job is no longer done (checkOkfor those). Code that
usedDoneto mean "finished, successfully or not" must checkDone || !Ok.
WaitUntilTranslationMemoryJobDoneAsync()still returns a completed job and throws aDeepLExceptionfor a failed or expired one. - Breaking:
ImportTranslationMemoryFromFilepathAsync()andExportTranslationMemoryToFilepathAsync()now wrap local file
failures in aTranslationMemoryJobException(see below), with the originalIOExceptionor
UnauthorizedAccessExceptionasInnerException: an input file that cannot be read, an output file that already
exists or cannot be created, and errors writing the output. The checks still run before any job is created, and a
missing input file still throws anArgumentException. CatchDeepLExceptionor
TranslationMemoryJobExceptioninstead of the I/O exceptions. - Breaking: `TextResu...
v1.23.0
TL;DR: new APIs in this release: the Admin API, spoken terms, style profiles and text correction.
Translation memories, style rules and multilingual glossaries gained many options and fixes.
Read Changed and Deprecated before upgrading; no public API is removed in this release.
Added
DocumentTranslationExceptionnow copiesHttpStatusCodeandShouldRetryfrom theDeepLExceptionthat
caused it; they were alwaysnullbefore.- Added
DeepLClientoverloads ofListTranslationMemorySegmentsAsync()(translation memory ID or
TranslationMemoryInfo) taking aTranslationMemorySegmentsOptions(PageSize,PageCursor,FilterText,
FilterCaseSensitive); options leftnullare not sent. - Added a
DeepLClientoverload ofCreateTranslationMemoryImportAsync()taking a
CreateTranslationMemoryImportOptions(ContentType,DisplayName); itsExtraBodyParametersare added last to
the JSON request body. - Added a
DeepLClientoverload ofImportTranslationMemoryFromFilepathAsync()taking an
ImportTranslationMemoryOptions(DisplayName,ContentType,Timeout).ContentTypeis declared on the import
job and sent with the upload (defaultapplication/xml);ExtraBodyParametersare added last to the import job
request body. - Added
DeepLClientoverloads ofWaitUntilTranslationMemoryJobDoneAsync()and
ExportTranslationMemoryToFilepathAsync()taking aTimeSpan? timeout; aDeepLExceptionis thrown when it
expires before the job finishes. - Added
DeepLClientoverloads ofGetTranslationMemoryJobAsync()andWaitUntilTranslationMemoryJobDoneAsync()
taking aTranslationMemoryJobinstead of the job ID. TranslationMemoryJobconverts implicitly to its job ID, so a job object can also be passed to the
ITranslationMemoryManagermethods taking a job ID.- Added
TranslationMemoryJobStatus.UnknownandStatusValueonTranslationMemoryJobResultand
TranslationMemoryJob, holding the job status as returned by the API. - The new translation memory overloads are members of
DeepLClient; theITranslationMemoryManagerinterface is
unchanged. - Added
DeepLClientoverloads of all eight style rule methods that take a style rule ID (GetStyleRuleAsync(),
UpdateStyleRuleNameAsync(),UpdateStyleRuleConfiguredRulesAsync(),DeleteStyleRuleAsync(),
CreateStyleRuleCustomInstructionAsync(),GetStyleRuleCustomInstructionAsync(),
UpdateStyleRuleCustomInstructionAsync(),DeleteStyleRuleCustomInstructionAsync()) taking aStyleRuleInfo
instead, and overloads of the get, update and delete custom instruction methods taking aCustomInstruction
instead of the instruction ID.CustomInstructionconverts implicitly to its ID. These and the following style rule
overloads are members ofDeepLClient; theIStyleRuleManagerinterface is unchanged. - Added
DeepLClientoverloads ofCreateStyleRuleAsync()andUpdateStyleRuleConfiguredRulesAsync()taking the
configured rules as aDictionary<string, Dictionary<string, string>>(category to rule to value, keyed by the API
names), sent as given, so categories theConfiguredRulesclass lacks can be sent.ConfiguredRulesconverts
implicitly to this map. - Added
DeepLClientoverloads ofCreateStyleRuleAsync(),UpdateStyleRuleNameAsync(),
UpdateStyleRuleConfiguredRulesAsync(),CreateStyleRuleCustomInstructionAsync()and
UpdateStyleRuleCustomInstructionAsync()taking aCreateStyleRuleOptions,UpdateStyleRuleNameOptions,
UpdateStyleRuleConfiguredRulesOptions,CreateStyleRuleCustomInstructionOptionsor
UpdateStyleRuleCustomInstructionOptions. The options classes derive fromBaseRequestOptions: their
ExtraBodyParametersare added last to the JSON request body (for the configured rules, to the rules map as further
keys). - Added
DeepLClient.UpdateMultilingualGlossaryAsync(), taking a glossary ID orMultilingualGlossaryInfoand an
UpdateMultilingualGlossaryOptionsobject (Name,Dictionaries), to rename a glossary and merge entries into
its dictionaries in one request. Only the set properties are sent;ExtraBodyParametersare added last to the
JSON request body. - Added
DeepLClientoverloads ofCreateMultilingualGlossaryAsync()andCreateMultilingualGlossaryFromCsvAsync()
taking aCreateMultilingualGlossaryOptions, and ofReplaceMultilingualGlossaryDictionaryAsync()and
ReplaceMultilingualGlossaryDictionaryFromCsvAsync()taking aReplaceMultilingualGlossaryDictionaryOptions. Both
options classes derive fromBaseRequestOptions: theirExtraBodyParametersare added last to the request body. - Added
DeepLClientoverloads ofGetMultilingualGlossaryAsync()andUpdateMultilingualGlossaryNameAsync()taking
aMultilingualGlossaryInfoinstead of the glossary ID. - The new multilingual glossary methods and overloads are members of
DeepLClient; theIGlossaryManagerinterface
is unchanged. - Added
StyleProfiletoTextTranslateOptionsandDocumentTranslateOptions(the ID or aStyleProfileobject),
and constructors taking aStyleProfile, to translate text and documents with a style profile (sent as
style_profile_id). - Added
Glossary,StyleRuleandTranslationMemorytoDocumentTranslateOptions, replacingGlossaryId,
StyleIdandTranslationMemoryId, as inTextTranslateOptions: each takes the ID or the resource object.
Glossary objects can also be added toDocumentTranslateOptions.GlossaryIds. - Added
DocumentTranslateOptions.FormalityValue: theformalityvalue as a string, sent unchanged instead of
Formalityif set. - Added
DocumentTranslateOptions.FilenameandStreamoverloads ofTranslateDocumentAsync()and
TranslateDocumentUploadAsync()without theinputFileNameparameter, which sendFilenameas the file name.
TheFileInfooverloads sendFilenameinstead of the file's name if it is set. - Added
TranslateDocumentGetStatusAsync(), replacingTranslateDocumentStatusAsync(). - Added a
TranslateDocumentWaitUntilDoneAsync()overload with aTimeSpan? timeout, and
DocumentTranslateOptions.Timeoutfor the wait insideTranslateDocumentAsync(). When the timeout expires, a
DeepLExceptionis thrown (wrapped in aDocumentTranslationExceptionbyTranslateDocumentAsync()). - Added
DocumentStatus.StatusValue, the status string as returned by the API, and
DocumentStatus.StatusCode.Unknownfor statuses this library does not know. - The new document methods and overloads are members of
TranslatorandDeepLClient; the obsoleteITranslator
interface is unchanged. - Added
Glossary,StyleRuleandTranslationMemorytoTextTranslateOptions, replacingGlossaryId,StyleId
andTranslationMemoryId. Each takes the ID or the resource object (GlossaryInfoorMultilingualGlossaryInfo,
StyleRuleInfo,TranslationMemoryInfo), so several resource objects can be combined in one options object. GlossaryInfo,MultilingualGlossaryInfo,StyleRuleInfo,StyleProfileandTranslationMemoryInfoconvert
implicitly to their ID, so they can also be added toTextTranslateOptions.GlossaryIds, mixed with IDs. Anull
object converts tonull, so assigning one leaves the option unset.- Added
FormalityValue,SplitSentencesandModelTypeValuetoTextTranslateOptions: theformality,
split_sentencesandmodel_typevalues as strings, sent unchanged instead of theFormality,
SentenceSplittingModeandModelTypeenum properties if set, for values the enums do not have. - Added the
TagHandlingMode(Html,Xml) andTagHandlingVersion(V1,V2) constants for
TextTranslateOptions.TagHandlingandTagHandlingVersion, which still accept any string. - Added
TextResult.TagHandlingVersion, thetag_handling_versionof the response (nullif absent or not a
string). - Added
IStyleProfileManager, implemented byDeepLClient, to manage style profiles (/v3/style_profiles):
ListStyleProfilesAsync(),CreateStyleProfileAsync(),GetStyleProfileAsync(),UpdateStyleProfileAsync()and
DeleteStyleProfileAsync(), with the modelStyleProfileand the options classesCreateStyleProfileOptionsand
UpdateStyleProfileOptions(which addsName). Options leftnullare not sent; an empty string clears the
description or industry and an empty list unlinks all components of that kind. Both options classes derive from
BaseRequestOptions:ExtraBodyParametersare added to the body last. The glossary, style rule list and
translation memory lists take IDs or resource objects (SetGlossaries(),SetStyleRules(),
SetTranslationMemories()).StyleProfile.CreationTimeandUpdatedTimeare non-nullable. - Added
ISpokenTermsManager, implemented byDeepLClient, to manage Spoken Terms collections (/v3/spoken-terms):
CreateSpokenTermsAsync(),ListSpokenTermsAsync(),GetSpokenTermsAsync(),UpdateSpokenTermsAsync(),
GetSpokenTermsEntriesAsync(),ReplaceSpokenTermsListAsync(),DeleteSpokenTermsAsync()and
DeleteSpokenTermsListAsync(), with the modelsSpokenTerms,SpokenTermsListandSpokenTermsEntries.
Terms are checked like glossary terms before sending; an invalid term throwsArgumentException.
UpdateSpokenTermsAsync()takes the new name and the terms to merge as anUpdateSpokenTermsOptionsobject
(Name,TermLists).CreateSpokenTermsAsync(),UpdateSpokenTermsAsync()andReplaceSpokenTermsListAsync()
take an optionalCreateSpokenTermsOptions,UpdateSpokenTermsOptionsorReplaceSpokenTermsListOptions, whose
ExtraBodyParametersare added last to the JSON request body. - Added the API Pro fields of
GET /v2/usagetoUsage:ApiKeyCharacter(the character usage of the API key,
as opposed to the account-wideCharacter),SpeechToTextMinutes,SpeechToSpeechMinutes,StartTime,
EndTimeandProducts...
v1.22.1
Changed
- Relaxed client-side validation for translation requests using glossaries without a set source language. API-side enforcement remains active until upcoming release.
v1.22.0
Added
- Added support for using multiple glossaries in text and document translation
via theGlossaryIdsproperty (up to 5 glossary IDs) inTextTranslateOptions
andDocumentTranslateOptions. - Added support for style rules in document translation via the
StyleId
property inDocumentTranslateOptions. - Added support for translation memories in document translation via the
TranslationMemoryIdandTranslationMemoryThresholdproperties in
DocumentTranslateOptions. - Added support for the translation memory management endpoints in the
DeepLClientclass:GetTranslationMemoryAsync(),
ListTranslationMemorySegmentsAsync(),DeleteTranslationMemoryAsync(),
CreateTranslationMemoryImportAsync(),UploadTranslationMemoryFileAsync(),
CreateTranslationMemoryExportAsync(),GetTranslationMemoryJobAsync(),
WaitUntilTranslationMemoryJobDoneAsync(),
DownloadTranslationMemoryExportAsync(),
ImportTranslationMemoryFromFilepathAsync()and
ExportTranslationMemoryToFilepathAsync(), along with the
TranslationMemorySegments,TranslationMemorySegment,
TranslationMemoryTargetSegment,TranslationMemoryImport,
TranslationMemoryExport,TranslationMemoryJoband
TranslationMemoryJobResultmodel classes.
Please refer to the README for usage instructions. - Added the
CreationTimeandUpdatedTimeproperties to
TranslationMemoryInfo.
Fixed
- Fixed incorrect example texts in test suite for several languages (Danish, Indonesian,
Japanese, Portuguese, and Russian).
v1.21.0
Added
- Added support for translation memories in text translation via
TranslationMemoryIdandTranslationMemoryThresholdproperties in
TextTranslateOptions. - Added
ListTranslationMemoriesAsync()method to theDeepLClientclass
for listing available translation memories.
Fixed
- Fixed
gitlab releaseCI job by explicitly setting therelease-cliimage to avoid
issues with a missing$HOMEenvironment variable from the global image.
v1.20.0
Added
- Added new language constants from January 2026 API release of 81 new languages.
- Added
ApiPostJsonAsync(),ApiPutJsonAsync(), andApiPatchJsonAsync()methods to
DeepLHttpClient, enabling JSON-encoded API calls. - Added support for style rules CRUD endpoints in the
DeepLClientclass:CreateStyleRuleAsync(),GetStyleRuleAsync(),UpdateStyleRuleNameAsync(),UpdateStyleRuleConfiguredRulesAsync(), andDeleteStyleRuleAsync(). - Added support for style rule custom instruction CRUD endpoints in the
DeepLClientclass:CreateStyleRuleCustomInstructionAsync(),GetStyleRuleCustomInstructionAsync(),UpdateStyleRuleCustomInstructionAsync(), andDeleteStyleRuleCustomInstructionAsync().
Please refer to the README for usage instructions.
v1.19.0
Added
- Added
TagHandlingVersionparameter toTextTranslateOptionsto specify which version of the tag handling algorithm to use. Options arev1andv2.
v1.18.0
Added
- Added
CustomInstructionsproperty toTextTranslateOptionsto customize translation behavior with up to 10 instructions (max 300 characters each). Only supported for target languages:de,en,es,fr,it,ja,ko,zhand their variants. Note: using theCustomInstructionsparameter will usequality_optimizedmodel type as the default. Requests combiningCustomInstructionsand theLatencyOptimizedmodel type will be rejected.
v1.17.0
Added
- Added support for style rules in text translation via the
StyleIdproperty inTextTranslateOptions. - Added
GetAllStyleRulesAsync()method toDeepLClientto retrieve all available style rules with optional pagination and detailed configuration. - Added new model classes:
StyleRuleInfo,ConfiguredRules, andCustomInstructionto support style rules functionality.
v1.16.0
Added
- Added
ExtraBodyParametersoption to text and document translation methods to pass arbitrary parameters in the request body. This can be used to access beta features or override built-in parameters (such astarget_lang,source_lang, etc.).