Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ com.azure:azure-ai-speech-transcription;1.0.0;1.1.0-beta.1
com.azure:azure-ai-textanalytics;5.5.13;5.6.0-beta.1
com.azure:azure-ai-textanalytics-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-ai-translation-text;2.0.0;2.1.0-beta.1
com.azure:azure-ai-translation-document;1.0.8;1.1.0-beta.1
com.azure:azure-ai-translation-document;1.0.8;2.0.0
com.azure:azure-ai-vision-face;1.0.0-beta.2;1.0.0-beta.3
com.azure:azure-ai-voicelive;1.0.0;1.1.0-beta.2
com.azure:azure-analytics-defender-easm;1.0.0-beta.1;1.0.0-beta.2
Expand Down
18 changes: 14 additions & 4 deletions sdk/translation/azure-ai-translation-document/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# Release History

## 1.1.0-beta.1 (Unreleased)
## 2.0.0 (2026-07-06)

### Features Added

### Breaking Changes
- Added support for the `2026-03-01` service API version, which is now the default.
- Added image translation support:
- Added the `BatchOptions` model with the `translateTextWithinImage` property, and the `options` property on `TranslationBatch`, to enable translation of text embedded within images for batch requests.
- Added `beginTranslation(List<DocumentTranslationInput>, Boolean)` convenience overloads to `DocumentTranslationClient` and `DocumentTranslationAsyncClient` to enable batch image translation without constructing a `TranslationBatch`/`BatchOptions`.
- Added the `translateTextWithinImage` parameter to `SingleDocumentTranslationClient.translate` and `SingleDocumentTranslationAsyncClient.translate` for single document requests.
- Added image scan reporting to `DocumentStatusResult`: `imageCharacterDetected`, `imageCharged`, `totalImageScansSucceeded`, and `totalImageScansFailed`.
- Added image scan totals to `TranslationStatusSummary`: `totalImageScansSucceeded`, `totalImageScansFailed`, and `totalImagesChargedCount`.
- Added custom translation model support:
- Added the `deploymentName` property to `TranslationTarget` to specify the deployment name of the custom translation model for a batch translation request.
- Added the `deploymentName` property to `DocumentStatusResult`, exposing the deployment name of the custom translation model used for the translation.
- Added the `deploymentName` parameter to `SingleDocumentTranslationClient.translate` and `SingleDocumentTranslationAsyncClient.translate` for single document translation requests.

### Bugs Fixed
### Breaking Changes

### Other Changes
- Replaced the `SingleDocumentTranslationClient.translate` and `SingleDocumentTranslationAsyncClient.translate` convenience overload `translate(String, DocumentTranslateContent, String, String, Boolean)` with `translate(String, DocumentTranslateContent, String, String, String, Boolean, Boolean)`, adding the `deploymentName` and `translateTextWithinImage` parameters (positioned after `category` and `allowFallback` respectively). Existing callers of the previous overload must update their call sites to the new signature.

## 1.0.8 (2026-05-05)

Expand Down
72 changes: 71 additions & 1 deletion sdk/translation/azure-ai-translation-document/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-ai-translation-document</artifactId>
<version>1.1.0-beta.1</version>
<version>2.0.0</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down Expand Up @@ -190,6 +190,72 @@ System.out.println("Translated Response: " + translatedResponse);
```
Please refer to the service documentation for a conceptual discussion of [singleDocumentTranslation][singleDocumentTranslation_doc].

### Custom Model Translation
Translate documents with a custom translation model by providing its deployment name. Set the `deploymentName` on the `TranslationTarget` for batch translation; for single document translation pass the `deploymentName` parameter. The deployment name that was used is reported back on each document's status.

```java startDocumentTranslationWithCustomModel
String sourceUrl = "https://myblob.blob.core.windows.net/sourceContainer";
TranslationSource translationSource = new TranslationSource(sourceUrl);
translationSource.setLanguage("en");
translationSource.setStorageSource(TranslationStorageSource.AZURE_BLOB);

String targetUrl = "https://myblob.blob.core.windows.net/destinationContainer";
TranslationTarget translationTarget = new TranslationTarget(targetUrl, "es");
// Set the deployment name of your custom translation model on the target.
translationTarget.setDeploymentName("<custom translation model deployment name>");
translationTarget.setStorageSource(TranslationStorageSource.AZURE_BLOB);

List<TranslationTarget> translationTargets = new ArrayList<>();
translationTargets.add(translationTarget);

DocumentTranslationInput batchRequest = new DocumentTranslationInput(translationSource, translationTargets);

SyncPoller<TranslationStatusResult, TranslationStatusResult> poller = documentTranslationClient
.beginTranslation(TestHelper.getStartTranslationDetails(batchRequest));
TranslationStatusResult translationStatus = poller.waitForCompletion().getValue();

for (DocumentStatusResult document : documentTranslationClient.listDocumentStatuses(translationStatus.getId())) {
System.out.println("Document Id: " + document.getId());
System.out.println("Document Status: " + document.getStatus());
// The status reports the deployment name of the custom model that was used.
System.out.println("Deployment name used: " + document.getDeploymentName());
}
```

### Image Translation
Translate text that is embedded within images in your documents by enabling `translateTextWithinImage` through `BatchOptions` when starting a batch translation. When enabled, each document's status also reports image scan usage.

```java startDocumentTranslationWithImageTranslation
String sourceUrl = "https://myblob.blob.core.windows.net/sourceContainer";
TranslationSource translationSource = new TranslationSource(sourceUrl);
translationSource.setLanguage("en");
translationSource.setStorageSource(TranslationStorageSource.AZURE_BLOB);

String targetUrl = "https://myblob.blob.core.windows.net/destinationContainer";
TranslationTarget translationTarget = new TranslationTarget(targetUrl, "es");
translationTarget.setStorageSource(TranslationStorageSource.AZURE_BLOB);

List<TranslationTarget> translationTargets = new ArrayList<>();
translationTargets.add(translationTarget);

DocumentTranslationInput batchRequest = new DocumentTranslationInput(translationSource, translationTargets);

// Enable translation of text embedded within images for the batch using the convenience overload.
SyncPoller<TranslationStatusResult, TranslationStatusResult> poller
= documentTranslationClient.beginTranslation(Arrays.asList(batchRequest), true);
TranslationStatusResult translationStatus = poller.waitForCompletion().getValue();

for (DocumentStatusResult document : documentTranslationClient.listDocumentStatuses(translationStatus.getId())) {
System.out.println("Document Id: " + document.getId());
System.out.println("Document Status: " + document.getStatus());
// Image scan usage is reported when image translation is enabled.
System.out.println("Total image scans succeeded: " + document.getTotalImageScansSucceeded());
System.out.println("Total image scans failed: " + document.getTotalImageScansFailed());
System.out.println("Images charged: " + document.getImageCharged());
System.out.println("Characters detected within images: " + document.getImageCharacterDetected());
}
```

### Cancel Translation
Cancels a translation job that is currently processing or queued (pending) as indicated in the request by the id query parameter.

Expand Down Expand Up @@ -466,6 +532,8 @@ Samples are provided for each main functional area.

* [BatchDocumentTranslation][sample_batchDocumentTranslation]
* [SingleDocumentTranslation][sample_singleDocumentTranslation]
* [CustomModelTranslation][sample_customModelTranslation]
* [ImageTranslation][sample_imageTranslation]
* [CancelTranslation][sample_cancelTranslation]
* [GetTranslationsStatus][sample_getTranslationsStatus]
* [GetTranslationStatus][sample_getTranslationStatus]
Expand Down Expand Up @@ -504,6 +572,8 @@ For details on contributing to this repository, see the [contributing guide](htt
[single_document_translator_client_class]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/translation/azure-ai-translation-document/src/main/java/com/azure/ai/translation/document/SingleDocumentTranslationClient.java
[sample_batchDocumentTranslation]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/StartDocumentTranslation.java
[sample_singleDocumentTranslation]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/StartSingleDocumentTranslation.java
[sample_customModelTranslation]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/TranslateWithCustomModel.java
[sample_imageTranslation]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/TranslateWithImageTranslation.java
[sample_cancelTranslation]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/CancelDocumentTranslation.java
[sample_getTranslationsStatus]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/GetTranslationsStatus.java
[sample_getTranslationStatus]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/translation/azure-ai-translation-document/src/samples/java/com/azure/ai/translation/document/GetTranslationStatus.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo" : "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath" : "java",
"TagPrefix" : "java/translation/azure-ai-translation-document",
"Tag" : "java/translation/azure-ai-translation-document_32dd6be902"
"Tag" : "java/translation/azure-ai-translation-document_52b0493f69"
}
2 changes: 1 addition & 1 deletion sdk/translation/azure-ai-translation-document/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator.

<groupId>com.azure</groupId>
<artifactId>azure-ai-translation-document</artifactId>
<version>1.1.0-beta.1</version> <!-- {x-version-update;com.azure:azure-ai-translation-document;current} -->
<version>2.0.0</version> <!-- {x-version-update;com.azure:azure-ai-translation-document;current} -->

<name>Microsoft Azure SDK for DocumentTranslation</name>
<description>This package contains Microsoft Azure DocumentTranslation client library.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

import com.azure.ai.translation.document.implementation.DocumentTranslationClientImpl;
import com.azure.ai.translation.document.implementation.models.SupportedFileFormats;
import com.azure.ai.translation.document.models.BatchOptions;
import com.azure.ai.translation.document.models.DocumentStatusResult;
import com.azure.ai.translation.document.models.DocumentTranslationInput;
import com.azure.ai.translation.document.models.FileFormat;
import com.azure.ai.translation.document.models.FileFormatType;
import com.azure.ai.translation.document.models.ListDocumentStatusesOptions;
Expand Down Expand Up @@ -95,6 +97,7 @@ public final class DocumentTranslationAsyncClient {
* (Required){
* targetUrl: String (Required)
* category: String (Optional)
* deploymentName: String (Optional)
* language: String (Required)
* glossaries (Optional): [
* (Optional){
Expand All @@ -110,6 +113,9 @@ public final class DocumentTranslationAsyncClient {
* storageType: String(Folder/File) (Optional)
* }
* ]
* options (Optional): {
* translateTextWithinImage: Boolean (Optional)
* }
* }
* }
* </pre>
Expand Down Expand Up @@ -260,6 +266,9 @@ public PollerFlux<BinaryData, BinaryData> beginTranslation(BinaryData body, Requ
* notYetStarted: int (Required)
* cancelled: int (Required)
* totalCharacterCharged: long (Required)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* totalImageCharged: Long (Optional)
* }
* }
* }
Expand Down Expand Up @@ -308,6 +317,11 @@ public PagedFlux<BinaryData> listTranslationStatuses(RequestOptions requestOptio
* progress: double (Required)
* id: String (Required)
* characterCharged: Integer (Optional)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* imageCharged: Integer (Optional)
* imageCharacterDetected: Integer (Optional)
* deploymentName: String (Optional)
* }
* }
* </pre>
Expand Down Expand Up @@ -363,6 +377,9 @@ public Mono<Response<BinaryData>> getDocumentStatusWithResponse(String translati
* notYetStarted: int (Required)
* cancelled: int (Required)
* totalCharacterCharged: long (Required)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* totalImageCharged: Long (Optional)
* }
* }
* }
Expand Down Expand Up @@ -422,6 +439,9 @@ public Mono<Response<BinaryData>> getTranslationStatusWithResponse(String transl
* notYetStarted: int (Required)
* cancelled: int (Required)
* totalCharacterCharged: long (Required)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* totalImageCharged: Long (Optional)
* }
* }
* }
Expand Down Expand Up @@ -565,6 +585,11 @@ public Mono<Response<BinaryData>> cancelTranslationWithResponse(String translati
* progress: double (Required)
* id: String (Required)
* characterCharged: Integer (Optional)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* imageCharged: Integer (Optional)
* imageCharacterDetected: Integer (Optional)
* deploymentName: String (Optional)
* }
* }
* </pre>
Expand Down Expand Up @@ -676,6 +701,35 @@ public PollerFlux<TranslationStatusResult, TranslationStatusResult> beginTransla
return serviceClient.beginTranslationWithModelAsync(BinaryData.fromObject(body), requestOptions);
}

/**
* Submit a document translation request to the Document Translation service, optionally translating text
* embedded within images in the documents.
*
* This is a convenience overload that enables image translation without constructing a {@link BatchOptions}.
* It builds a {@link TranslationBatch} from the provided inputs and, when {@code translateTextWithinImage} is
* non-null, sets it via {@link BatchOptions#setTranslateTextWithinImage(Boolean)}.
*
* @param inputs the input list of documents or folders containing documents to be translated.
* @param translateTextWithinImage whether to translate text embedded within images in the documents; may be
* {@code null} to use the service default.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux<TranslationStatusResult, TranslationStatusResult>
beginTranslation(List<DocumentTranslationInput> inputs, Boolean translateTextWithinImage) {
TranslationBatch body = new TranslationBatch(inputs);
if (translateTextWithinImage != null) {
body.setOptions(new BatchOptions().setTranslateTextWithinImage(translateTextWithinImage));
}
return beginTranslation(body);
}

/**
* Returns a list of batch requests submitted and the status for each request
*
Expand Down
Loading
Loading