Skip to content

Commit 5b45af0

Browse files
Merge pull request #1325 from laujan/document-translation-how-to-update
update document translation how-to
2 parents 1738e98 + e7c71de commit 5b45af0

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

articles/ai-services/translator/document-translation/how-to-guides/use-rest-api-programmatically.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: laujan
66
manager: nitinme
77
ms.service: azure-ai-translator
88
ms.topic: quickstart
9-
ms.date: 06/19/2024
9+
ms.date: 11/19/2024
1010
ms.author: lajanuar
1111
recommendations: false
1212
ms.devlang: csharp
@@ -22,9 +22,7 @@ ms.custom: mode-other, build-2023, devx-track-extended-java, devx-track-python
2222

2323
> [!NOTE]
2424
>
25-
> * Typically, when you create an Azure AI resource in the Azure portal, you have the option to create a multi-service key or a single-service key. However, Document Translation is currently supported in the Translator (single-service) resource only, and is **not** included in the Azure AI services (multi-service) resource.
26-
>
27-
> * Document Translation is supported in the S1 Standard Service Plan (Pay-as-you-go) and C2, C3, C4, and D3 Volume Discount Plans. _See_ [Azure AI services pricing—Translator](https://azure.microsoft.com/pricing/details/cognitive-services/translator/).
25+
> Document Translation is supported in the S1 Standard Service Plan (Pay-as-you-go) and C2, C3, C4, and D3 Volume Discount Plans. _See_ [Azure AI services pricing—Translator](https://azure.microsoft.com/pricing/details/cognitive-services/translator/).
2826
>
2927
3028
To get started, you need:
@@ -36,13 +34,13 @@ To get started, you need:
3634
* **Source container**. This container is where you upload your files for translation (required).
3735
* **Target container**. This container is where your translated files are stored (required).
3836

39-
* A [**single-service Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) (**not** a multi-service Azure AI services resource):
37+
* A [**Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation):
4038

4139
**Complete the Translator project and instance details fields as follows:**
4240

4341
1. **Subscription**. Select one of your available Azure subscriptions.
4442

45-
1. **Resource Group**. You can create a new resource group or add your resource to a pre-existing resource group that shares the same lifecycle, permissions, and policies.
43+
1. **Resource Group**. You can create a new resource group or add your resource to an existing resource group that shares the same lifecycle, permissions, and policies.
4644

4745
1. **Resource Region**. Choose **Global** unless your business or application requires a specific region. If you're planning on using a [system-assigned managed identity](create-use-managed-identities.md) for authentication, choose a **geographic** region like **West US**.
4846

@@ -212,6 +210,30 @@ The following headers are included with each Document Translation API request:
212210
}
213211
```
214212

213+
### 🆕 Translate text embedded in images within documents
214+
215+
> [!Note]
216+
>
217+
> * This feature is optional and must be enabled for each translation request.
218+
> * Enabling this feature will incur additional costs based on usage. For more information, *see* [Azure AI Vision pricing](https://azure.microsoft.com/pricing/details/cognitive-services/computer-vision/)
219+
> * This feature is currently available only with the Batch Document Translation API.
220+
> * The Supported file format is `.docx` only.
221+
> * An Azure AI Services resource (not the standalone Translator resource) is required to use this feature.
222+
223+
### Request configuration
224+
225+
* Use the optional `translateTextWithinImage` parameter in the `options` field
226+
227+
* Data type: Boolean (`true` or `false`)
228+
* Default Boolean setting is `false`. Set the option to `true` to enable image text translation.
229+
230+
* **Response Details**. When the feature is enabled, added image processing information is included with the response:
231+
232+
* **`totalImageScansSucceeded`**. The number of successfully translated image scans.
233+
234+
* **`totalImageScansFailed`**. The number of image scans that failed processing.
235+
236+
215237
## Use code to submit Document Translation requests
216238

217239
### Set up your coding Platform
@@ -1279,7 +1301,7 @@ func main() {
12791301
|------------------|-------------|-----------------|
12801302
| 200 | OK | The request was successful. |
12811303
| 400 | Bad Request | A required parameter is missing, empty, or null. Or, the value passed to either a required or optional parameter is invalid. A common issue is a header that is too long. |
1282-
| 401 | Unauthorized | The request isn't authorized. Check to make sure your key or token is valid and in the correct region. When managing your subscription on the Azure portal, make sure you're using the **Translator** single-service resource _not_ the **Azure AI services** multi-service resource.
1304+
| 401 | Unauthorized | The request isn't authorized. Check to make sure your key or token is valid and in the correct region.
12831305
| 429 | Too Many Requests | You exceeded the quota or rate of requests allowed for your subscription. |
12841306
| 502 | Bad Gateway | Network or server-side issue. Can also indicate invalid headers. |
12851307

0 commit comments

Comments
 (0)