Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 13 additions & 4 deletions sdk/translation/azure-ai-translation-document/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# 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 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
- Added the `deploymentName` and `translateTextWithinImage` parameters (positioned after `category` and `allowFallback` respectively) to the `SingleDocumentTranslationClient.translate` and `SingleDocumentTranslationAsyncClient.translate` convenience methods.
Comment thread
jrjrguo marked this conversation as resolved.
Outdated

## 1.0.8 (2026-05-05)

Expand Down
75 changes: 74 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,75 @@ 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.
TranslationBatch translationBatch = new TranslationBatch(new ArrayList<>(Arrays.asList(batchRequest)))
.setOptions(new BatchOptions().setTranslateTextWithinImage(true));

SyncPoller<TranslationStatusResult, TranslationStatusResult> poller
= documentTranslationClient.beginTranslation(translationBatch);
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 +535,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 +575,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
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 @@ -95,6 +95,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 +111,9 @@ public final class DocumentTranslationAsyncClient {
* storageType: String(Folder/File) (Optional)
* }
* ]
* options (Optional): {
* translateTextWithinImage: Boolean (Optional)
* }
* }
* }
* </pre>
Expand Down Expand Up @@ -260,6 +264,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 +315,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 +375,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 +437,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 +583,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
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ public final class DocumentTranslationClient {
* (Required){
* targetUrl: String (Required)
* category: String (Optional)
* deploymentName: String (Optional)
* language: String (Required)
* glossaries (Optional): [
* (Optional){
Expand All @@ -105,6 +106,9 @@ public final class DocumentTranslationClient {
* storageType: String(Folder/File) (Optional)
* }
* ]
* options (Optional): {
* translateTextWithinImage: Boolean (Optional)
* }
* }
* }
* </pre>
Expand Down Expand Up @@ -255,6 +259,9 @@ public SyncPoller<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 @@ -303,6 +310,11 @@ public PagedIterable<BinaryData> listTranslationStatuses(RequestOptions requestO
* 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 @@ -358,6 +370,9 @@ public Response<BinaryData> getDocumentStatusWithResponse(String translationId,
* notYetStarted: int (Required)
* cancelled: int (Required)
* totalCharacterCharged: long (Required)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* totalImageCharged: Long (Optional)
* }
* }
* }
Expand Down Expand Up @@ -416,6 +431,9 @@ public Response<BinaryData> getTranslationStatusWithResponse(String translationI
* notYetStarted: int (Required)
* cancelled: int (Required)
* totalCharacterCharged: long (Required)
* totalImageScansSucceeded: Integer (Optional)
* totalImageScansFailed: Integer (Optional)
* totalImageCharged: Long (Optional)
* }
* }
* }
Expand Down Expand Up @@ -558,6 +576,11 @@ public Response<BinaryData> cancelTranslationWithResponse(String translationId,
* 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ public enum DocumentTranslationServiceVersion implements ServiceVersion {
/**
* Enum value 2024-05-01.
*/
V2024_05_01("2024-05-01");
V2024_05_01("2024-05-01"),

/**
* Enum value 2026-03-01.
*/
V2026_03_01("2026-03-01");

private final String version;

Expand All @@ -35,6 +40,6 @@ public String getVersion() {
* @return The latest {@link DocumentTranslationServiceVersion}.
*/
public static DocumentTranslationServiceVersion getLatest() {
return V2024_05_01;
return V2026_03_01;
}
Comment thread
jrjrguo marked this conversation as resolved.
}
Loading
Loading