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
@@ -163,4 +172,4 @@ That's it, congratulations! In this quickstart, you used Document Translation to
163
172
Learn more about Document Translation:
164
173
165
174
> [!div class="nextstepaction"]
166
-
>[Document Translation REST API guide](../reference/rest-api-guide.md)[Language support](../../language-support.md)
175
+
>[Document Translation REST API guide](../reference/rest-api-guide.md)</br></br>[Language support](../../language-support.md)
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/quickstarts/includes/csharp.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +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/08/2022
9
+
ms.date: 02/10/2023
10
10
ms.author: lajanuar
11
11
recommendations: false
12
12
---
13
+
<!-- markdownlint-disable MD051 -->
13
14
14
15
## Set up your C#/.NET environment
15
16
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.
17
+
For this quickstart, we use the latest version of [Visual Studio](https://visualstudio.microsoft.com/vs/) IDE to build and run the application.
17
18
18
19
1. Start Visual Studio.
19
20
@@ -33,6 +34,9 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
33
34
34
35
:::image type="content" source="../../media/visual-studio/additional-information.png" alt-text="Screenshot of Visual Studio 2022 additional information set-up window.":::
35
36
37
+
> [!div class="nextstepaction"]
38
+
> [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)
39
+
36
40
## Install Newtonsoft.Json
37
41
38
42
1. Right-click on your **document-translation-qs** project and select **Manage NuGet Packages...** .
@@ -47,6 +51,9 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
47
51
48
52
:::image type="content" source="../../media/visual-studio/install-nuget-package.png" alt-text="Screenshot of install selected NuGet package window.":::
49
53
54
+
> [!div class="nextstepaction"]
55
+
> [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)
56
+
50
57
## Translate all documents in a storage container
51
58
52
59
> [!NOTE]
@@ -71,7 +78,6 @@ For this quickstart, we'll use the latest version of [Visual Studio](https://vis
71
78
> [!IMPORTANT]
72
79
> 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
80
74
-
75
81
```csharp
76
82
77
83
usingSystem.Text;
@@ -130,6 +136,9 @@ class Program
130
136
131
137
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
132
138
133
-
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
139
+
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
140
+
141
+
* The translated documents are listed in your target container.
134
142
135
-
* The translated documents will be listed in your target container.
143
+
> [!div class="nextstepaction"]
144
+
> [I successfully translated my document.](#next-steps)[I ran into an issue](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
+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,11 +6,13 @@ 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
---
13
13
14
+
<!-- markdownlint-disable MD051 -->
15
+
14
16
## Set up your Go environment
15
17
16
18
You can use any text editor to write Go applications. We recommend using the latest version of [Visual Studio Code and the Go extension](/azure/developer/go/configure-visual-studio-code).
@@ -29,6 +31,9 @@ You can use any text editor to write Go applications. We recommend using the lat
29
31
go version
30
32
```
31
33
34
+
> [!div class="nextstepaction"]
35
+
> [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)
36
+
32
37
## Translate all documents in a storage container
33
38
34
39
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 +50,7 @@ You can use any text editor to write Go applications. We recommend using the lat
45
50
46
51
> [!IMPORTANT]
47
52
> 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
-
53
+
49
54
```go
50
55
51
56
package main
@@ -108,8 +113,11 @@ func main() {
108
113
go run document-translation.go
109
114
```
110
115
111
-
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
116
+
* The successful POST method returns a `202 Accepted` response code indicating that the batch request was created by the service.
117
+
118
+
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
112
119
113
-
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
120
+
* The translated documents are listed in your target container.
114
121
115
-
* The translated documents will be listed in your target container.
122
+
> [!div class="nextstepaction"]
123
+
> [I successfully translated my document.](#next-steps) [I ran into an issue.](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
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,16 @@ 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
+
<!-- markdownlint-disable MD051 -->
14
15
15
16
## Set up your Java environment
16
17
17
-
For this quickstart, we'll use the Gradle build automation tool to create and run the application.
18
+
For this quickstart, we use the Gradle build automation tool to create and run the application.
18
19
19
20
* 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
21
@@ -23,12 +24,15 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
23
24
> * 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
25
> * 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
26
26
-
* If you aren't using VS Code, make sure you have the following installed in your development environment:
27
+
* If you aren't using Visual Studio Code, make sure you have the following installed in your development environment:
27
28
28
29
* A [**Java Development Kit** (OpenJDK)](/java/openjdk/download#openjdk-17) version 8 or later.
29
30
30
31
*[**Gradle**](https://docs.gradle.org/current/userguide/installation.html), version 6.8 or later.
31
32
33
+
> [!div class="nextstepaction"]
34
+
> [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)
35
+
32
36
## Create a new Gradle project
33
37
34
38
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 +45,7 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
41
45
mkdir document-translation; cd document-translation
42
46
```
43
47
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.
48
+
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
49
46
50
```console
47
51
gradle init --type basic
@@ -73,6 +77,9 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
73
77
}
74
78
```
75
79
80
+
> [!div class="nextstepaction"]
81
+
> [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)
82
+
76
83
## Translate all documents in a storage container
77
84
78
85
1. From the document-translation directory, run the following command:
@@ -81,7 +88,7 @@ For this quickstart, we'll use the Gradle build automation tool to create and ru
81
88
mkdir -p src/main/java
82
89
```
83
90
84
-
You'll create the following directory structure:
91
+
The command creates the following directory structure:
@@ -172,4 +179,7 @@ public class DocumentTranslation {
172
179
173
180
* The POST request also returns response headers including `Operation-Location` that provides a value used in subsequent GET requests.
174
181
175
-
* The translated documents will be listed in your target container.
182
+
* The translated documents are listed in your target container.
183
+
184
+
> [!div class="nextstepaction"]
185
+
> [I successfully translated my document.](#next-steps) [I ran into an issue.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?PLanguage=JAVA&Pillar=Language&Product=Document-translation&Page=quickstart&Section=Translate-documents)
0 commit comments