All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added
CreateTranslationMemoryImportOptions(content type, display name, extra body parameters) andcreateTranslationMemoryImport()overloads taking only the file name and size, or an options object; extra body parameters are added to the request last. - Added
ImportTranslationMemoryOptions(display name, content type, timeout, extra body parameters) andimportTranslationMemoryFromFilepath()overloads taking it, with aFileor with the file content asbyte[]plus a file name. The content type is declared on the import job and sent with the upload. - Added
exportTranslationMemoryToFilepath()overloads that write to anOutputStream, and one taking aTranslationMemoryInfo, aFileand a timeout. - Added
getTranslationMemoryJob()andwaitUntilTranslationMemoryJobDone()overloads that take aTranslationMemoryJobobject. - Added
uploadTranslationMemoryFile(String uploadUrl, byte[] fileContent), which uploads with the content typeapplication/xml. - Added overloads of
getStyleRule(),updateStyleRuleName(),deleteStyleRule(),updateStyleRuleConfiguredRules()and the four style rule custom instruction methods that take aStyleRuleInfoobject, and overloads ofgetStyleRuleCustomInstruction(),updateStyleRuleCustomInstruction()anddeleteStyleRuleCustomInstruction()that take aCustomInstructionobject. - Added
createStyleRule()andupdateStyleRuleConfiguredRules()overloads that take the configured rules as aMap<String, Map<String, String>>, sent as given, so categories and rules beyond the fields ofConfiguredRulescan be sent. - Added
CreateStyleRuleOptions,UpdateStyleRuleNameOptions,UpdateStyleRuleConfiguredRulesOptions,CreateStyleRuleCustomInstructionOptionsandUpdateStyleRuleCustomInstructionOptions, and overloads of the matching style rule methods that take them; their extra body parameters are added to the request last. - Added
DeepLClient.updateMultilingualGlossary()andUpdateMultilingualGlossaryOptions, which rename a glossary and merge dictionaries into it in one request, sending only the fields that are set. - Added
CreateMultilingualGlossaryOptionsandReplaceMultilingualGlossaryDictionaryOptions, and overloads of the multilingual glossary create, update and replace methods that take an options object whose extra body parameters are added to the request last. - Added
getMultilingualGlossary(),updateMultilingualGlossaryName(),updateMultilingualGlossaryDictionaryFromCsv()andreplaceMultilingualGlossaryDictionaryFromCsv()overloads that take aMultilingualGlossaryInfoobject. - Added
DeepLException.getHttpStatusCode(), the HTTP status code of the failed response (nullif there was none), andDeepLException.getShouldRetry(), which istruefor HTTP 429, HTTP 5xx and connection, DNS and timeout failures. - Added
setProxyUrl(String)toDeepLClientOptions(TranslatorOptions) andDeepLAdminClientOptions, which takes an HTTP proxy URL such ashttp://proxy.example.com:3128. TextTranslationOptions.setExtraBodyParameters()andDocumentTranslationOptions.setExtraBodyParameters()now return the options class, so further setters can be chained after them.- Added the
setStyleProfile()option toTextTranslationOptionsandDocumentTranslationOptions, sent asstyle_profile_idon text and document translation. It accepts a style profile ID or aStyleProfileobject. - Added the
TagHandlingMode,TagHandlingVersionandModelTypeenums andTextTranslationOptions.setTagHandling(),setTagHandlingVersion()andsetModelType()overloads that take them; the string setters remain. - Added
TextTranslationOptions.setFormality(String)andsetSentenceSplittingMode(String), which send the string as given, for values not yet inFormalityorSentenceSplittingMode. - Added
TextTranslationOptions.setSplittingTags(String),setNonSplittingTags(String)andsetIgnoreTags(String), which send a comma-separated tag list as given. - Added
TextTranslationOptions.setStyleRule(String)andsetTranslationMemory(String), taking the style rule or translation memory ID. - Added
TextTranslationOptions.setGlossaryIds(IGlossary, IGlossary...), taking glossary objects. - Added
Translator.translateDocumentGetStatus(), which returns the status of a document translation. - Added a
translateDocumentWaitUntilDone(DocumentHandle, Duration)overload that throws aDeepLExceptionwhen the timeout expires, andDocumentTranslationOptions.setTimeout(Duration), which limits how longtranslateDocument()waits for the translation; on expiry it throws aDocumentTranslationExceptionwith the document handle. - Added
DocumentTranslationOptions.setFilename(), the file name sent with the upload in place of the input file's name. - Added
DocumentTranslationOptions.setFormality(String), which sends the string as given. - Added
DocumentTranslationOptions.setStyleRule(String),setTranslationMemory(String)andsetGlossaryIds(IGlossary, IGlossary...). - Added
DocumentStatus.getStatusString(), the status as the API sent it, including values not inDocumentStatus.StatusCode. - Added
TextResult.getTagHandlingVersion(), the tag handling version the API used (tag_handling_version);nullwhen the response does not contain it. - Added style profile support to
DeepLClient(/v3/style_profiles):createStyleProfile(),listStyleProfiles(),getStyleProfile(),updateStyleProfile()anddeleteStyleProfile(), with the new classesStyleProfile,CreateStyleProfileOptionsandUpdateStyleProfileOptions(which addssetName()). Both options classes supportsetExtraBodyParameters().setGlossaryIds(),setStyleRuleIds()andsetTranslationMemoryIds()take a list of IDs or theIGlossary,StyleRuleInfoorTranslationMemoryInfoobjects. Options leftnullare not sent; an empty string clears the description or industry and an empty list unlinks all components of that kind.StyleProfile.getCreationTime()andgetUpdatedTime()are nevernull; a response without a validcreation_timeorupdated_timeraises aDeepLException. - Added Spoken Terms support to
DeepLClient(/v3/spoken-terms):createSpokenTerms(),listSpokenTerms(),getSpokenTerms(),updateSpokenTerms(),getSpokenTermsEntries(),replaceSpokenTermsList(),deleteSpokenTerms()anddeleteSpokenTermsList(), with the new classesSpokenTerms,SpokenTermsListandSpokenTermsEntries.updateSpokenTerms()takes anUpdateSpokenTermsOptions(setName(),setTermLists()) and sends only the fields set;createSpokenTerms()andreplaceSpokenTermsList()take optionalCreateSpokenTermsOptionsandReplaceSpokenTermsListOptions. All three options classes supportsetExtraBodyParameters(). Collection IDs are URL-encoded in the request path. Terms are passed and returned as a list of strings; each term is trimmed of leading and trailing whitespace and then checked like a glossary term, so a term containing a newline throws anIllegalArgumentException. - Added the
DeepLAdminClientclass for the Admin API. It must be created with an admin API key and supports managing developer keys (createDeveloperKey(),listDeveloperKeys(),deactivateDeveloperKey(),renameDeveloperKey(),setDeveloperKeyUsageLimits()) and retrieving usage analytics (getUsageAnalytics()with an optionalgroupByargument andgetCustomTagUsageAnalytics()with optionalaggregateByandpagearguments;groupByandaggregateBytake theAdminUsageGroupByandCustomTagUsageAggregateByenums or a string, sent as given; the client is configured withDeepLAdminClientOptions).createDeveloperKey()takes aCreateDeveloperKeyOptionswith the label; the other key functions have overloads takingDeactivateDeveloperKeyOptions,RenameDeveloperKeyOptionsandSetDeveloperKeyUsageLimitsOptions. All four supportsetExtraBodyParameters(), added to the JSON body last. Responses areDeveloperKey,DeveloperKeyUsageLimits,AdminUsageReport,AdminUsageBreakdown(includinggetSpeechToSpeechMinutes()),KeyUsage,CustomTagUsageReport,CustomTagUsageandCustomTagUsageBreakdown. The analytics functions takeLocalDate,"YYYY-MM-DD"strings, orDateandInstantvalues, of which the UTC day is sent; both the start and the end day are included. Report dates areDatevalues at midnight UTC.DeveloperKey.getLabel(),DeveloperKey.getUsageLimits()andKeyUsage.getApiKeyLabel()returnnullwhen the API sends no value.setDeveloperKeyUsageLimits()takes aDeveloperKeyUsageLimitsUpdateand changes only the limits set in it, including the speech-to-speech limit. - Added the API Pro fields of
GET /v2/usagetoUsage:getApiKeyCharacter()(per-key character usage),getSpeechToTextMinutes(),getSpeechToSpeechMinutes(),getStartTime()andgetEndTime()(billing period) andgetProducts()(per-product usage asUsage.Product). They arenullwhen the response does not contain them, for example for Free accounts. - Added
DocumentTranslationOptions.setEnableWatermark()to add a "Translated by DeepL" watermark to translateddocxandpdfdocuments. By default the option is not sent. - Added
DocumentTranslationOptions.setOutputFormat()to request the file format of the translated document, for exampledocx. By default the translated document has the same format as the input document. - Added
LanguageCodeconstants for the target language variantsde-CH,de-DE,es-ES,es-419,fr-CA,fr-FR,zh-Hansandzh-Hant. - Added
DeepLClient.getLanguagesForResource(), which callsGET /v3/languagesfor a given resource (translate_text,glossary,write, ...) and returnsLanguageSupportobjects with per-language feature support. The resource is aLanguageResourceNameor a string; optionalGetLanguagesForResourceOptions.setInclude()takesLanguageIncludevalues (Beta,External) or strings, each sent as anincludequery parameter. - Added
DeepLClient.getLanguageResources(), which callsGET /v3/languages/resourcesand returnsLanguageResourceobjects describing each resource's features and whether they need source and/or target language support (falsewhen the API omits the flag). - Added
correctText()to theDeepLClientclass, which corrects grammar, spelling and punctuation using the/v2/write/correctendpoint. It accepts a single text or a list of texts, an optional target language and an optionalCorrectTextOptions, which supportssetExtraBodyParameters(). A response without one complete result per input text raises aDeepLException. - Added
TextRephraseOptions.setWritingStyle(WritingStyle)andsetTone(WritingTone)overloads; the string setters remain. TextRephraseOptionsnow extendsBaseRequestOptionsand supportssetExtraBodyParameters(), added last to therephraseText()request body.
- Text translation accepts a glossary (
setGlossary()) or glossary list (setGlossaryIds()) without a source language; the API detects the source language and uses the glossary's dictionary for the detected language pair. Document translation with a glossary still requires a source language. TranslationMemoryJob.getProduct(),getOperation(),getCreationTime()andgetUpdatedTime()are no longer annotated@Nullable, as the API always returns these fields.- The bare target languages
enandptare no longer rejected client-side in text translation, document translation and rephrasing. The API translates them toen-USandpt-PTrespectively. getSourceLanguages(),getTargetLanguages(),getLanguages()andgetGlossaryLanguages()now useGET /v3/languagesinstead of the deprecated v2 endpoints. The returned lists may contain additional languages, including the bareenandptas target languages.
createStyleRule(String, String, ConfiguredRules, List)andupdateStyleRuleConfiguredRules(String, ConfiguredRules)are deprecated; use the overloads that take aMap<String, Map<String, String>>instead.- Deprecated
Translator.getLanguages(LanguageType)and theLanguageTypeenum. UsegetSourceLanguages()orgetTargetLanguages()instead. They will be removed in the next major version. - Deprecated
GlossaryNotFoundException. Catch its superclassNotFoundExceptioninstead, which is thrown for HTTP 404 on every endpoint. It will be removed in the next major version. - Deprecated
DeepLClientOptions.setApiVersion()andgetApiVersion(); the API version will no longer be configurable in the next major version. - Deprecated the language code constants in
LanguageCode(for exampleLanguageCode.German). Pass the language code as a string instead, for example"de", or usegetSourceLanguages()/getTargetLanguages(). The constants will be removed in the next major version. The class itself and its helper methods are not deprecated. - Deprecated
TextTranslationOptions.setGlossaryId(),setGlossaries(),setStyleId()andsetTranslationMemoryId(). UsesetGlossary(),setGlossaryIds(),setStyleRule()andsetTranslationMemory()instead. They will be removed in the next major version. - Deprecated
Translator.translateDocumentStatus(); usetranslateDocumentGetStatus()instead. DeprecatedDocumentTranslationOptions.setGlossaryId(),setGlossaries(),setStyleId()andsetTranslationMemoryId(); usesetGlossary(),setGlossaryIds(),setStyleRule()andsetTranslationMemory()instead. They will be removed in the next major version.
- Translation memory and translation memory job IDs are now URL-encoded in request paths.
- The style rule and custom instruction methods now URL-encode the style rule ID and custom instruction ID in the request path; they were inserted unescaped before.
replaceMultilingualGlossaryDictionary()andreplaceMultilingualGlossaryDictionaryFromCsv()now send a JSON body, the only content type the endpoint accepts, instead of a form body.getMultilingualGlossaryDictionaryEntries()now throwsNotFoundException(GlossaryNotFoundException) if the response contains no dictionary andDeepLExceptionif it is malformed, instead of anIndexOutOfBoundsExceptionorNullPointerException.createMultilingualGlossary(),createMultilingualGlossaryFromCsv()andlistMultilingualGlossaries()now throwGlossaryNotFoundExceptionon HTTP 404, like the other multilingual glossary methods.- Multilingual glossary IDs are now URL-encoded in request paths.
rephraseText()raises aDeepLExceptionwhen the response does not contain one complete result per input text. Before, the single-text overload threw anIndexOutOfBoundsExceptionor returnednull, and the list overload returned a short list.- A document status the library does not know yet no longer stops
translateDocumentWaitUntilDone()andtranslateDocument()with "Unknown error": it counts as in progress and polling continues.DocumentStatus.getStatus()returnsnullfor it. translateDocumentGetStatus()andtranslateDocumentDownload()now URL-encode the document ID in the request path.translateDocumentUpload()andtranslateDocument()with an input stream now post to/v2/documentinstead of/v2/document/.- Document translation now sends the source and target language codes with
only the language part lower-cased, for example
zh-Hans; it sentzh-HANSbefore. translateText()no longer fails when a translation in the response has nobilled_characters(getBilledCharacters()returns 0) or anullmodel_type_used(getModelTypeUsed()returnsnull).- HTTP 401 now throws
AuthorizationException, like HTTP 403, instead of aDeepLExceptionwith "Unknown error". - Connection failures (refused connections, unreachable hosts) and failed DNS
lookups are now retried like timeouts, in all request types including
PATCH. - Developer key creation is now also retried after a refused connection or a connect timeout, in addition to HTTP 429 and DNS failures, as the request was not sent in these cases. A timeout or connection reset after the request was sent is still not retried.
- A failure while reading the response body, for example a read timeout, now
throws a
ConnectionExceptionand is retried. It threw a non-retriedDeepLExceptionbefore. - A whitespace-only auth key is now rejected by the
DeepLClientandTranslatorconstructors with anIllegalArgumentException. - An
Authorizationheader passed withsetHeaders()no longer replaces theDeepL-Auth-Keyauthorization built from the auth key, in all clients. - A malformed or empty API response now throws a
DeepLExceptioninstead of aJsonSyntaxExceptionorNullPointerException. - Fixed the doc comments of
LanguageCode.EnglishandLanguageCode.Portuguese, which claimed they may only be used as source languages. rephraseText()no longer throws aNullPointerExceptionwhen the target language isnull.getLanguages()no longer sends aPOSTrequest to/v2/languages; it now sendsGET.translateDocument()with file arguments andtranslateDocumentDownload()with an output file no longer delete an existing file at the output path when they refuse to overwrite it and throw anIOException.PATCHrequests (updateMultilingualGlossaryName(),updateMultilingualGlossaryDictionary()andupdateStyleRuleName()) now use the JVM proxy settings (http.proxyHost,https.proxyHostand others) like all other requests. They ignored them before.
1.17.0 - 2026-08-11
- Added support for using multiple glossaries in text and document translation
via
setGlossaryIds()/setGlossaries()(up to 5 glossaries) inTextTranslationOptionsandDocumentTranslationOptions. - Added support for style rules in document translation via
setStyleRule()/setStyleId()inDocumentTranslationOptions. - Added support for translation memories in document translation via
setTranslationMemory()/setTranslationMemoryId()/setTranslationMemoryThreshold()inDocumentTranslationOptions. - Added support for the translation memory management endpoints in the
DeepLClientclass:getTranslationMemory(),listTranslationMemorySegments(),deleteTranslationMemory(),createTranslationMemoryImport(),uploadTranslationMemoryFile(),createTranslationMemoryExport(),getTranslationMemoryJob(),waitUntilTranslationMemoryJobDone(),downloadTranslationMemoryExport(),importTranslationMemoryFromFilepath()andexportTranslationMemoryToFilepath(). - Added
creationTimeandupdatedTimetoTranslationMemoryInfo. - Added optional timeouts to
waitUntilTranslationMemoryJobDone(),importTranslationMemoryFromFilepath()andexportTranslationMemoryToFilepath().
- Fixed
waitUntilTranslationMemoryJobDone()throwing when a translation memory job reportsAwaitingInput. An import job keeps reporting that status for a while after its file has been uploaded, because the API detects the upload asynchronously, so it is now polled through like any other non-terminal status. - Fixed incorrect example texts in the test suite for several languages (Danish, Indonesian, Japanese, Portuguese, and Russian) to match the mock server.
1.16.0 - 2026-04-09
- Added support for translation memories in text translation via
setTranslationMemoryId()andsetTranslationMemoryThreshold()inTextTranslationOptions. - Added
listTranslationMemories()method to theDeepLClientclass for listing available translation memories.
- Fixed GitLab release job using wrong image by explicitly setting
image: registry.gitlab.com/gitlab-org/release-cli:latest.
1.15.0 - 2026-03-26
- Added JSON request body support to
HttpContentandHttpClientWrapper, enabling JSON-encoded API calls viasendJsonRequestWithBackoff()andsendJsonPatchRequestWithBackoff(). - Added support for style rules CRUD endpoints in the
DeepLClientclass:createStyleRule(),getStyleRule(),updateStyleRuleName(),updateStyleRuleConfiguredRules(), anddeleteStyleRule(). - Added support for style rule custom instruction CRUD endpoints in the
DeepLClientclass:createStyleRuleCustomInstruction(),getStyleRuleCustomInstruction(),updateStyleRuleCustomInstruction(), anddeleteStyleRuleCustomInstruction(). Please refer to the README for usage instructions.
- Updated formality tests to accept either formal or informal output when using default formality, since the default formality is automatic.
- Updated
testModelType()to just check if themodel_type_usedis non-null if themodel_typeis specified in the request - Updated
testMixedDirectionText()to add a missing</p>tag - Improved
NotFoundExceptionerror message by removing the misleading "check server_url" suggestion.
- Fixed PATCH requests (
sendPatchRequestWithBackoff) not retrying on 429/5xx errors despite the method name promising backoff behavior. PATCH requests now use the same retry logic as all other HTTP methods.
1.14.0 - 2025-12-10
- Added
setTagHandlingVersion()method toTextTranslationOptionsto specify which version of the tag handling algorithm to use. Options arev1andv2.
1.13.0 - 2025-12-03
-
Added
setCustomInstructions()method toTextTranslationOptionsto 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 the custom instructions parameter will use
quality_optimizedmodel type as the default. Requests combining custom instructions and thelatency_optimizedmodel type will be rejected.
1.12.0 - 2025-11-12
- Added support for the
GET /v3/style_rulesendpoint in the client library, the implementation can be found in theDeepLClientclass. Please refer to the README for usage instructions - Added
styleIdoption totranslateText()which allows text translation with style rules.
1.11.0 - 2025-11-04
- Added
extraRequestParametersoption 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.).
1.10.3 - 2025-08-22
- Updated
org.apache.httpcomponents:httpclientto 4.5.14 due to CVE-2020-13956.
1.10.2 - 2025-07-11
- Migrate to Sonatype Portal OSSRH Staging API due to legacy OSSRH being sunsetted.
- Whitespace surrounding auth key is now stripped.
1.10.1 - 2025-06-18
- Fixed
DeepLClient::deleteMultilingualGlossary(String glossaryId)being package private, made it public instead.
1.10.0 - 2025-04-30
- Added support for the /v3 Multilingual Glossary APIs in the client library while providing backwards compatability for the previous /v2 Glossary endpoints. Please refer to the README or upgrading_to_multilingual_glossaries.md for usage instructions.
- Added Ukrainian language code
1.9.0 - 2025-02-21
- Allow specifying the API version to use. This is mostly for users who have an API subscription that includes an API key for CAT tool usage, who need to use the v1 API.
1.8.1 - 2025-02-07
- Added a constructor for
DeepLClientthat only takes anauthKey, to fix the README example and be in line withTranslator. - Un-deprecated the
TranslatorandTranslatorOptionsclass and moved it to their constructors. The functionality in them continues to work and be supported, user code should just useDeepLClientandDeepLClientOptions.
1.8.0 - 2025-01-17
- Added support for the Write API in the client library, the implementation
can be found in the
DeepLClientclass. Please refer to the README for usage instructions.
- The main functionality of the library is now also exposed via the
DeepLClientclass. Please change your code to use this over theTranslatorclass whenever convenient.
1.7.0 - 2024-11-15
- Added
modelTypeoption totranslateText()to use models with higher translation quality (available for some language pairs), or better latency. Options are'quality_optimized','latency_optimized', and'prefer_quality_optimized' - Added the
modelTypeUsedfield totranslateText()response, that indicates the translation model used when themodelTypeoption is specified.
1.6.0 - 2024-09-17
- Added
getBilledCharacters()to text translation response.
1.5.1 - 2024-09-05
1.5.0 - 2024-04-10
-
New language available: Arabic (MSA) (
'ar'). Add language code constants and tests.Note: older library versions also support the new language, this update only adds new code constants.
- Change document upload to use the path
/v2/documentinstead of/v2/document/(no trailing/). Both paths will continue to work in the v2 version of the API, but/v2/documentis the intended one.
1.4.0 - 2023-11-03
- Add optional
contextparameter for text translation, that specifies additional context to influence translations, that is not translated itself.
- Remove unused
commons-mathdependency
1.3.0 - 2023-06-09
- Changed document translation to poll the server every 5 seconds. This should greatly reduce observed document translation processing time.
- Fix getUsage request to be a HTTP GET request, not POST.
1.2.0 - 2023-03-22
- Script to check our source code for license headers and a step for them in the CI.
- Added system and java version information to the user-agent string that is sent with API calls, along with an opt-out.
- Added method for applications that use this library to identify themselves in API requests they make.
1.1.0 - 2023-01-26
-
Add example maven project using this library.
-
New languages available: Korean (
'ko') and Norwegian (bokmål) ('nb'). Add language code constants and tests.Note: older library versions also support the new languages, this update only adds new code constants.
- Send Formality options in API requests even if it is default.
1.0.1 - 2023-01-02
1.0.0 - 2022-12-15
- Add support for glossary management functions.
parsing.ErrorResponsefieldsmessageanddetailare now private, encapsulated with getters.
0.2.1 - 2022-10-19
- Handle case where HTTP response is not valid JSON.
0.2.0 - 2022-09-26
- Add new
Formalityoptions:PreferLessandPreferMore.
- Requests resulting in
503 Service Unavailableerrors are now retried. Attempting to download a document before translation is completed will now wait and retry (up to 5 times by default), rather than throwing an exception.
- Use
Locale.ENGLISHwhen changing string case.- Thanks to seratch.
- Avoid cases in
HttpContentandStreamUtilswhere temporary objects might not be closed.- Thanks to seratch.
0.1.3 - 2022-09-09
- Fixed examples in readme.
Usage.Detailcountandlimitproperties type changed frominttolong.
0.1.2 - 2022-09-08
- Fix publishing to Maven Central by including sourcesJar and javadocJar.
0.1.1 - 2022-09-08
- Fix CI publishing step.
0.1.0 - 2022-09-08
Initial version.