You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document Translation is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service that asynchronously translates whole documents in [supported languages](../../language-support.md) and various [file formats](../overview.md#supported-document-formats). In this quickstart, you'll learn to use Document Translation with a programming language of your choice to translate a source document into a target language while preserving structure and text formatting.
20
+
Document Translation is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service that asynchronously translates whole documents in [supported languages](../../language-support.md) and various [file formats](../overview.md#supported-document-formats). In this quickstart, learn to use Document Translation with a programming language of your choice to translate a source document into a target language while preserving structure and text formatting.
> * Document Translation is **only** supported in the S1 Standard Service Plan (Pay-as-you-go) or in the D3 Volume Discount Plan. *See*[Cognitive Services pricing—Translator](https://azure.microsoft.com/pricing/details/cognitive-services/translator/).
29
29
>
30
30
31
-
To get started, you'll need:
31
+
To get started, you need:
32
32
33
33
* An active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free account**](https://azure.microsoft.com/free/).
34
34
35
-
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You'll create containers to store and organize your blob data within your storage account.
35
+
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You also need to create containers to store and organize your blob data within your storage account.
36
36
37
37
* A [**single-service Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) (**not** a multi-service Cognitive Services resource):
38
38
@@ -66,6 +66,9 @@ The custom domain endpoint is a URL formatted with your resource name, hostname,
66
66
> ***All API requests to the Document Translation service require a custom domain endpoint**.
67
67
> * Don't use the Text Translation endpoint found on your Azure portal resource *Keys and Endpoint* page nor the global translator endpoint—`api.cognitive.microsofttranslator.com`—to make HTTP requests to Document Translation.
68
68
69
+
> [!div class="nextstepaction"]
70
+
> [I ran into an issue with the prerequisites.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?Pillar=Language&Product=Document-translation&Page=quickstart&Section=Prerequisites)
71
+
69
72
### Retrieve your key and endpoint
70
73
71
74
Requests to the Translator service require a read-only key and custom endpoint to authenticate access.
@@ -76,16 +79,19 @@ Requests to the Translator service require a read-only key and custom endpoint t
76
79
77
80
1. Copy and paste your **`key`** and **`document translation endpoint`** in a convenient location, such as *Microsoft Notepad*. Only one key is necessary to make an API call.
78
81
79
-
1. You'll paste it into the code sample to authenticate your request to the Document Translation service.
82
+
1. You**`key`** and **`document translation endpoint`**into the code samples to authenticate your request to the Document Translation service.
80
83
81
84
:::image type="content" source="../media/document-translation-key-endpoint.png" alt-text="Screenshot showing the get your key field in Azure portal.":::
82
85
86
+
> [!div class="nextstepaction"]
87
+
> [I ran into an issue retrieving my key and endpoint.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?Pillar=Language&Product=Document-translation&Page=quickstart&Section=Retrieve-your-keys-and-endpoint)
88
+
83
89
## Create Azure blob storage containers
84
90
85
-
You'll need to [**create containers**](../../../../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) in your [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM) for source and target files.
91
+
You need to [**create containers**](../../../../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) in your [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM) for source and target files.
86
92
87
93
***Source container**. This container is where you upload your files for translation (required).
88
-
***Target container**. This container is where your translated files will be stored (required).
94
+
***Target container**. This container is where your translated files are stored (required).
89
95
90
96
### **Required authentication**
91
97
@@ -101,13 +107,16 @@ The `sourceUrl` , `targetUrl` , and optional `glossaryUrl` must include a Share
101
107
> * If you're translating a **single** file (blob) in an operation, **delegate SAS access at the blob level**.
102
108
> * As an alternative to SAS tokens, you can use a [**system-assigned managed identity**](../how-to-guides/create-use-managed-identities.md) for authentication.
103
109
110
+
> [!div class="nextstepaction"]
111
+
> [I ran into an issue creating blob storage containers with authentication.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?Pillar=Language&Product=Document-translation&Page=quickstart&Section=Create-blob-storage-containers)
112
+
104
113
### Sample document
105
114
106
-
For this project, you'll need a **source document** uploaded to your **source container**. You can download our [document translation sample document](https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/Translator/document-translation-sample.docx) for this quickstart.
115
+
For this project, you need a **source document** uploaded to your **source container**. You can download our [document translation sample document](https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/Translator/document-translation-sample.docx) for this quickstart.
107
116
108
117
## HTTP request
109
118
110
-
A batch Document Translation request is submitted to your Translator service endpoint via a POST request. If successful, the POST method returns a `202 Accepted` response code and the batch request is created by the service. The translated documents will be listed in your target container.
119
+
A batch Document Translation request is submitted to your Translator service endpoint via a POST request. If successful, the POST method returns a `202 Accepted` response code and the batch request is created by the service. The translated documents are listed in your target container.
111
120
112
121
### Headers
113
122
@@ -156,10 +165,13 @@ The following headers are included with each Document Translation API request:
156
165
[!INCLUDE [REST API](includes/rest-api.md)]
157
166
::: zone-end
158
167
159
-
That's it, congratulations! In this quickstart, you used Document Translation to translate a document while preserving it's original structure and data format.
168
+
> [!div class="nextstepaction"]
169
+
> [My REST API call was successful](#next-steps)[I ran into an issue](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?Product=Document-translation&Page=quickstart-translator&Section=run-your-appliation)
160
170
161
171
## Next steps
162
172
173
+
That's it, congratulations! In this quickstart, you used Document Translation to translate a document while preserving it's original structure and data format.
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/quickstarts/includes/csharp.md
+13-5Lines changed: 13 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@ manager: nitinme
6
6
ms.service: cognitive-services
7
7
ms.subservice: translator-text
8
8
ms.topic: include
9
-
ms.date: 12/08/2022
9
+
ms.date: 02/10/2023
10
10
ms.author: lajanuar
11
11
recommendations: false
12
12
---
13
13
14
14
## Set up your C#/.NET environment
15
15
16
-
For this quickstart, we'll use the latest version of [Visual Studio](https://visualstudio.microsoft.com/vs/) IDE to build and run the application.
16
+
For this quickstart, we use the latest version of [Visual Studio](https://visualstudio.microsoft.com/vs/) IDE to build and run the application.
17
17
18
18
1. Start Visual Studio.
19
19
@@ -33,6 +33,9 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
33
33
34
34
:::image type="content" source="../../media/visual-studio/additional-information.png" alt-text="Screenshot of Visual Studio 2022 additional information set-up window.":::
35
35
36
+
> [!div class="nextstepaction"]
37
+
> [I ran into an issue setting up my environment.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=CSHARP&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Set-up-the-environment)
38
+
36
39
## Install Newtonsoft.Json
37
40
38
41
1. Right-click on your **document-translation-qs** project and select **Manage NuGet Packages...** .
@@ -47,6 +50,9 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
47
50
48
51
:::image type="content" source="../../media/visual-studio/install-nuget-package.png" alt-text="Screenshot of install selected NuGet package window.":::
49
52
53
+
> [!div class="nextstepaction"]
54
+
> [I ran into an issue installing the NuGet package.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=CSHARP&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Install-package)
55
+
50
56
## Translate all documents in a storage container
51
57
52
58
> [!NOTE]
@@ -71,7 +77,6 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
71
77
> [!IMPORTANT]
72
78
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../../key-vault/general/overview.md). For more information, *see* Cognitive Services [security](../../../../../cognitive-services/security-features.md).
73
79
74
-
75
80
```csharp
76
81
77
82
usingSystem.Text;
@@ -130,6 +135,9 @@ class Program
130
135
131
136
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
132
137
133
-
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
138
+
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
139
+
140
+
* The translated documents are listed in your target container.
134
141
135
-
* The translated documents will be listed in your target container.
142
+
> [!div class="nextstepaction"]
143
+
> [I ran into an issue translating documents.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=CSHARP&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Translate-documents)
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/quickstarts/includes/go.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ manager: nitinme
6
6
ms.service: cognitive-services
7
7
ms.subservice: translator-text
8
8
ms.topic: include
9
-
ms.date: 12/16/2022
9
+
ms.date: 02/10/2023
10
10
ms.author: lajanuar
11
11
recommendations: false
12
12
---
@@ -29,6 +29,9 @@ You can use any text editor to write Go applications. We recommend using the lat
29
29
go version
30
30
```
31
31
32
+
> [!div class="nextstepaction"]
33
+
> [I ran into an issue setting up my environment.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=GO&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Set-up-the-environment)
34
+
32
35
## Translate all documents in a storage container
33
36
34
37
1. In a console window (such as cmd, PowerShell, or Bash), create a new directory for your app called **document-translation-qs**, and navigate to it.
@@ -45,7 +48,7 @@ You can use any text editor to write Go applications. We recommend using the lat
45
48
46
49
> [!IMPORTANT]
47
50
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../../../key-vault/general/overview.md). For more information, *see* Cognitive Services [security](../../../../../cognitive-services/security-features.md).
48
-
51
+
49
52
```go
50
53
51
54
package main
@@ -108,8 +111,11 @@ func main() {
108
111
go run document-translation.go
109
112
```
110
113
111
-
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
114
+
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
115
+
116
+
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
112
117
113
-
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
118
+
* The translated documents are listed in your target container.
114
119
115
-
* The translated documents will be listed in your target container.
120
+
> [!div class="nextstepaction"]
121
+
> [I ran into an issue translating documents.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=GO&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Translate-documents)
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/quickstarts/includes/java.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ manager: nitinme
6
6
ms.service: cognitive-services
7
7
ms.subservice: translator-text
8
8
ms.topic: include
9
-
ms.date: 12/17/2022
9
+
ms.date: 02/10/2023
10
10
ms.author: lajanuar
11
11
recommendations: false
12
12
---
13
13
14
14
15
15
## Set up your Java environment
16
16
17
-
For this quickstart, we'll use the Gradle build automation tool to create and run the application.
17
+
For this quickstart, we use the Gradle build automation tool to create and run the application.
18
18
19
19
* You should have the latest version of [Visual Studio Code](https://code.visualstudio.com/) or your preferred IDE. _See_[Java in Visual Studio Code](https://code.visualstudio.com/docs/languages/java).
20
20
@@ -23,12 +23,15 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
23
23
> * Visual Studio Code offers a **Coding Pack for Java** for Windows and macOS.The coding pack is a bundle of VS Code, the Java Development Kit (JDK), and a collection of suggested extensions by Microsoft. The Coding Pack can also be used to fix an existing development environment.
24
24
> * If you are using VS Code and the Coding Pack For Java, install the [**Gradle for Java**](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle) extension.
25
25
26
-
* If you aren't using VS Code, make sure you have the following installed in your development environment:
26
+
* If you aren't using Visual Studio Code, make sure you have the following installed in your development environment:
27
27
28
28
* A [**Java Development Kit** (OpenJDK)](/java/openjdk/download#openjdk-17) version 8 or later.
29
29
30
30
*[**Gradle**](https://docs.gradle.org/current/userguide/installation.html), version 6.8 or later.
31
31
32
+
> [!div class="nextstepaction"]
33
+
> [I ran into an issue setting up my environment.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=JAVA&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Translate-documents)
34
+
32
35
## Create a new Gradle project
33
36
34
37
1. In console window (such as cmd, PowerShell, or Bash), create a new directory for your app called **document-translation**, and navigate to it.
@@ -41,7 +44,7 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
41
44
mkdir document-translation; cd document-translation
42
45
```
43
46
44
-
1. Run the `gradle init` command from the document-translation directory. This command will create essential build files for Gradle, including _build.gradle.kts_, which is used at runtime to create and configure your application.
47
+
1. Run the `gradle init` command from the document-translation directory. This command creates essential build files for Gradle, including _build.gradle.kts_, which is used at runtime to create and configure your application.
45
48
46
49
```console
47
50
gradle init --type basic
@@ -73,6 +76,9 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
73
76
}
74
77
```
75
78
79
+
> [!div class="nextstepaction"]
80
+
> [I ran into creating a Gradle project.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=JAVA&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Create-gradle-project)
81
+
76
82
## Translate all documents in a storage container
77
83
78
84
1. From the document-translation directory, run the following command:
@@ -81,7 +87,7 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
81
87
mkdir -p src/main/java
82
88
```
83
89
84
-
You'll create the following directory structure:
90
+
The command creates the following directory structure:
@@ -172,4 +178,7 @@ public class DocumentTranslation {
172
178
173
179
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
174
180
175
-
* The translated documents will be listed in your target container.
181
+
* The translated documents are listed in your target container.
182
+
183
+
> [!div class="nextstepaction"]
184
+
> [I ran into an issue translating documents.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=JAVA&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Translate-documents)
0 commit comments