Skip to content

Commit 2d91e2c

Browse files
Merge pull request #273793 from laujan/250121-translator-container-endpoints-data-residency
update containers and data residency
2 parents d19e2f7 + 70e2c2a commit 2d91e2c

File tree

6 files changed

+71
-62
lines changed

6 files changed

+71
-62
lines changed

articles/ai-services/translator/containers/translate-document-parameters.md

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88

99
ms.service: azure-ai-translator
1010
ms.topic: reference
11-
ms.date: 04/08/2024
11+
ms.date: 04/29/2024
1212
ms.author: lajanuar
1313
---
1414

@@ -25,20 +25,14 @@ ms.author: lajanuar
2525

2626
`POST` request:
2727

28-
```http
29-
POST {Endpoint}/translate?api-version=3.0&to={to}
30-
```
31-
32-
***With optional parameters***
33-
34-
```http
35-
POST {Endpoint}/translate?api-version=3.0&from={from}&to={to}&textType={textType}&category={category}&profanityAction={profanityAction}&profanityMarker={profanityMarker}&includeAlignment={includeAlignment}&includeSentenceLength={includeSentenceLength}&suggestedFrom={suggestedFrom}&fromScript={fromScript}&toScript={toScript}
28+
```bash
29+
POST "http://localhost:{port}/translator/document:translate?sourceLanguage={sourceLanguage}&targetLanguage={targetLanguage}&api-version=2023-11-01-preview" -F "document=@{path-to-your-document-with-file-extension};type={ContentType}/{file-extension}" -o "{path-to-output-file-with-file-extension}"
3630
```
3731

3832
Example:
3933

4034
```bash
41-
`curl -i -X POST "http://localhost:5000/translator/document:translate?sourceLanguage=en&targetLanguage=hi&api-version=2023-11-01-preview" -F "document={path-to-your-document-with-file-extension};type={ContentType}/{file-extension" -o "{path-to-output-file-with-file-extension}"`
35+
curl -i -X POST "http://localhost:5000/translator/document:translate?sourceLanguage=en&targetLanguage=hi&api-version=2023-11-01-preview" -F "document=@C:\Test\test-file.md;type=text/markdown" -o "C:\translation\translated-file.md"
4236
```
4337

4438
## Synchronous request headers and parameters
@@ -53,7 +47,7 @@ Use synchronous translation processing to send a document as part of the HTTP re
5347
|`sourceLanguage`|Specifies the language of the input document. If the `sourceLanguage` parameter isn't specified, automatic language detection is applied to determine the source language. |*Optional*|
5448
|`-H` or `--header` `"Ocp-Apim-Subscription-Key:{KEY}` | Request header that specifies the Document Translation resource key authorizing access to the API.|*Required*|
5549
|`-F` or `--form` |The filepath to the document that you want to include with your request. Only one source document is allowed.|*Required*|
56-
|&bull; `document=`<br> &bull; `type={contentType}/fileExtension` |&bull; Path to the file location for your source document.</br> &bull; Content type and file extension.</br></br> Ex: **"document=@C:\Test\test-file.md;type=text/markdown**|*Required*|
50+
|&bull; `document=`<br> &bull; `type={contentType}/fileExtension` |&bull; Path to the file location for your source document.</br> &bull; Content type and file extension.</br></br> Ex: **"document=@C:\Test\test-file.md;type=text/markdown"**|*Required*|
5751
|`-o` or `--output`|The filepath to the response results.|*Required*|
5852
|`-F` or `--form` |The filepath to an optional glossary to include with your request. The glossary requires a separate `--form` flag.|*Optional*|
5953
| &bull; `glossary=`<br> &bull; `type={contentType}/fileExtension`|&bull; Path to the file location for your optional glossary file.</br> &bull; Content type and file extension.</br></br> Ex: **"glossary=@C:\Test\glossary-file.txt;type=text/plain**|*Optional*|
@@ -77,7 +71,7 @@ For this project, you need a source document to translate. You can download our
7771
Here's an example cURL HTTP request using localhost:5000:
7872

7973
```bash
80-
curl -v "http://localhost:5000/translator/documents:translateDocument?from=en&to=es&api-version=v1.0" -F "document=@document-translation-sample-docx"
74+
curl -v "http://localhost:5000/translator/document:translate?sourceLanguage=en&targetLanguage=es&api-version=v1.0" -F "document=@document-translation-sample-docx" -o "C:\translation\translated-file.md"
8175
```
8276

8377
***Upon successful completion***:

articles/ai-services/translator/containers/translate-text-parameters.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ manager: nitinme
77

88
ms.service: azure-ai-translator
99
ms.topic: reference
10-
ms.date: 04/08/2024
10+
ms.date: 04/29/2024
1111
ms.author: lajanuar
1212
---
1313

@@ -20,19 +20,14 @@ ms.author: lajanuar
2020
Send a `POST` request to:
2121

2222
```HTTP
23-
POST {Endpoint}/translate?api-version=3.0&&from={from}&to={to}
23+
POST http://localhost:{port}/translate?api-version=3.0&&from={from}&to={to}
2424
```
2525

2626
***Example request***
2727

28-
```rest
29-
POST https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&from=en&to=es
30-
31-
[
32-
{
33-
"Text": "I would really like to drive your car."
34-
}
35-
]
28+
```bash
29+
curl -x POST "https:localhost:5000/translate?api-version=3.0&from=en&to=es" -H "Content-Type: application/json" -d "[{
30+
'Text': 'I would really like to drive your car.'}]"
3631

3732
```
3833

@@ -51,7 +46,6 @@ POST https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&fro
5146
]
5247
```
5348

54-
5549
## Request parameters
5650

5751
Request parameters passed on the query string are:
@@ -136,7 +130,7 @@ If an error occurs, the request returns a JSON error response. The error code is
136130
> * Each sample runs on the `localhost` that you specified with the `docker run` command.
137131
> * While your container is running, `localhost` points to the container itself.
138132
> * You don't have to use `localhost:5000`. You can use any port that is not already in use in your host environment.
139-
> To specify a port, use the `-p` option.
133+
140134

141135
### Translate a single input
142136

@@ -285,7 +279,7 @@ namespace TranslateContainer
285279
Translating multiple strings at once is simply a matter of specifying an array of strings in the request body.
286280

287281
```bash
288-
curl -X POST "http://localhost:{port}/translate?api-version=3.0&from=en&to=zh-Hans" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'Hello, what is your name?'}, {'Text':'I am fine, thank you.'}]"
282+
curl -X POST "http://localhost:5000/translate?api-version=3.0&from=en&to=zh-Hans" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'Hello, what is your name?'}, {'Text':'I am fine, thank you.'}]"
289283
```
290284

291285
The response contains the translation of all pieces of text in the exact same order as in the request.
@@ -311,7 +305,7 @@ The response body is:
311305
This example shows how to translate the same input to several languages in one request.
312306

313307
```bash
314-
curl -X POST "http://localhost:{port}/translate?api-version=3.0&from=en&to=zh-Hans&to=de" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'Hello, what is your name?'}]"
308+
curl -X POST "http://localhost:5000/translate?api-version=3.0&from=en&to=zh-Hans&to=de" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'Hello, what is your name?'}]"
315309
```
316310

317311
The response body is:
@@ -339,7 +333,7 @@ It's common to translate content that includes markup such as content from an HT
339333
Here's a sample request to illustrate.
340334

341335
```bash
342-
curl -X POST "http://localhost:{port}/translate?api-version=3.0&from=en&to=zh-Hans&textType=html" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'<div class=\"notranslate\">This will not be translated.</div><div>This will be translated.</div>'}]"
336+
curl -X POST "http://localhost:5000/translate?api-version=3.0&from=en&to=zh-Hans&textType=html" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'<div class=\"notranslate\">This will not be translated.</div><div>This will be translated.</div>'}]"
343337
```
344338

345339
The response is:
@@ -367,7 +361,7 @@ The markup to supply uses the following syntax.
367361
For example, consider the English sentence "The word wordomatic is a dictionary entry." To preserve the word _wordomatic_ in the translation, send the request:
368362

369363
```bash
370-
curl -X POST "http://localhost:{port}/translate?api-version=3.0&from=en&to=de" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'The word <mstrans:dictionary translation=\"wordomatic\">word or phrase</mstrans:dictionary> is a dictionary entry.'}]"
364+
curl -X POST "http://localhost:5000/translate?api-version=3.0&from=en&to=de" -H "Ocp-Apim-Subscription-Key: <client-secret>" -H "Content-Type: application/json; charset=UTF-8" -d "[{'Text':'The word <mstrans:dictionary translation=\"wordomatic\">word or phrase</mstrans:dictionary> is a dictionary entry.'}]"
371365
```
372366

373367
The result is:

articles/ai-services/translator/containers/transliterate-text-parameters.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88

99
ms.service: azure-ai-translator
1010
ms.topic: reference
11-
ms.date: 04/08/2024
11+
ms.date: 04/29/2024
1212
ms.author: lajanuar
1313
---
1414

@@ -21,7 +21,7 @@ Convert characters or letters of a source language to the corresponding characte
2121
`POST` request:
2222

2323
```HTTP
24-
POST {Endpoint}/transliterate?api-version=3.0&language={language}&fromScript={fromScript}&toScript={toScript}
24+
POST http://localhost:{port}/transliterate?api-version=3.0&language={language}&fromScript={fromScript}&toScript={toScript}
2525
2626
```
2727

@@ -66,8 +66,8 @@ A successful response is a JSON array with one result for each element in the in
6666

6767
### Sample request
6868

69-
```http
70-
https://api.cognitive.microsofttranslator.com/transliterate?api-version=3.0&language=ja&fromScript=Jpan&toScript=Latn
69+
```bash
70+
curl -X POST "http://localhost:5000/transliterate?api-version=3.0&language=ja&fromScript=Jpan&toScript=Latn"
7171
```
7272

7373
### Sample request body
@@ -107,7 +107,14 @@ The following limitations apply:
107107
> * Each sample runs on the `localhost` that you specified with the `docker run` command.
108108
> * While your container is running, `localhost` points to the container itself.
109109
> * You don't have to use `localhost:5000`. You can use any port that is not already in use in your host environment.
110-
> To specify a port, use the `-p` option.
110+
111+
### Transliterate with REST API
112+
113+
```bash
114+
115+
curl -X POST "http://localhost:5000/transliterate?api-version=3.0&language=ja&fromScript=Jpan&toScript=Latn" -H "Content-Type: application/json" -d "[{'Text':'こんにちは'},{'Text':'さようなら'}]"
116+
117+
```
111118

112119
## Next Steps
113120

articles/ai-services/translator/document-translation/overview.md

Lines changed: 7 additions & 11 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: overview
9-
ms.date: 02/12/2024
9+
ms.date: 05/02/2024
1010
ms.author: lajanuar
1111
ms.custom: references_regions
1212
recommendations: false
@@ -143,20 +143,16 @@ For detailed information regarding Azure AI Translator Service request limits, *
143143

144144
Document Translation data residency depends on the Azure region where your Translator resource was created:
145145

146-
* Translator resources **created** in any region in Europe (except Switzerland) are **processed** at data center in North Europe and West Europe.
147-
* Translator resources **created** in any region in Switzerland are **processed** at data center in Switzerland North and Switzerland West.
148-
* Translator resources **created** in any region in Asia Pacific or Australia are **processed** at data center in Southeast Asia and Australia East.
149-
* Translator resource **created** in all other regions including Global, North America, and South America are **processed** at data center in East US and West US 2.
150-
151146
✔️ Feature: **Document Translation**</br>
152147
✔️ Service endpoint: **Custom:** &#8198;&#8198;&#8198; **`<name-of-your-resource.cognitiveservices.azure.com/translator/text/batch/v1.1`**
153148

154-
|Resource region| Request processing data center |
149+
|Resource created region| Request processing data center |
155150
|----------------------------------|-----------------------|
156-
|**Any region within Europe (except Switzerland)**| Europe: North Europe &bull; West Europe|
157-
|**Switzerland**|Switzerland: Switzerland North &bull; Switzerland West|
158-
|**Any region within Asia Pacific and Australia**| Asia: Southeast Asia &bull; Australia East|
159-
|**All other regions including Global, North America, and South America** | US: East US &bull; West US 2|
151+
|**Global**|Closest available data center.|
152+
|**Americas**|East US 2 &bull; West US 2|
153+
|**Asia Pacific**| Japan East &bull; Southeast Asia|
154+
|**Europe (except Switzerland)**| France Central &bull; West Europe|
155+
|**Switzerland**|Switzerland North &bull; Switzerland West|
160156

161157
## Next steps
162158

articles/ai-services/translator/reference/v3-0-reference.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: laujan
77
manager: nitinme
88
ms.service: azure-ai-translator
99
ms.topic: reference
10-
ms.date: 02/14/2024
10+
ms.date: 04/29/2024
1111
ms.author: lajanuar
1212
---
1313

@@ -29,14 +29,19 @@ Requests to Translator are, in most cases, handled by the datacenter that is clo
2929

3030
To force the request to be handled within a specific geography, use the desired geographical endpoint. All requests are processed among the datacenters within the geography.
3131

32-
|Geography|Base URL (geographical endpoint)|Datacenters|
33-
|:--|:--|:--|
34-
|Global (`non-regional`)| api.cognitive.microsofttranslator.com|Closest available datacenter|
35-
|Asia Pacific| api-apc.cognitive.microsofttranslator.com|Korea South, Japan East, Southeast Asia, and Australia East|
36-
|Europe| api-eur.cognitive.microsofttranslator.com|North Europe, West Europe|
37-
|United States| api-nam.cognitive.microsofttranslator.com|East US, South Central US, West Central US, and West US 2|
32+
✔️ Feature: **Translator Text** </br>
3833

39-
<sup>`1`</sup> Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the `Resource region` `Switzerland North` or `Switzerland West`, then use the resource's custom endpoint in your API requests.
34+
| Service endpoint | Request processing data center |
35+
|------------------|--------------------------|
36+
|**Global (recommended):**</br>**`api.cognitive.microsofttranslator.com`**|Closest available data center.|
37+
|**Americas:**</br>**`api-nam.cognitive.microsofttranslator.com`**|East US 2 &bull; West US 2|
38+
|**Asia Pacific:**</br>**`api-apc.cognitive.microsofttranslator.com`**|Japan East &bull; Southeast Asia|
39+
|**Europe (except Switzerland):**</br>**`api-eur.cognitive.microsofttranslator.com`**|France Central &bull; West Europe|
40+
|**Switzerland:**</br> For more information, *see* [Switzerland service endpoints](#switzerland-service-endpoints).|Switzerland North &bull; Switzerland West|
41+
42+
#### Switzerland service endpoints
43+
44+
Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the `Resource region` `Switzerland North` or `Switzerland West`, then use the resource's custom endpoint in your API requests.
4045

4146
For example: If you create a Translator resource in Azure portal with `Resource region` as `Switzerland North` and your resource name is `my-swiss-n`, then your custom endpoint is `https&#8203;://my-swiss-n.cognitiveservices.azure.com`. And a sample request to translate is:
4247

@@ -49,7 +54,7 @@ curl -X POST "https://my-swiss-n.cognitiveservices.azure.com/translator/text/v3.
4954
-d "[{'Text':'Hello'}]" -v
5055
```
5156

52-
<sup>`2`</sup> Custom Translator isn't currently available in Switzerland.
57+
Custom Translator isn't currently available in Switzerland.
5358

5459
## Authentication
5560

articles/ai-services/translator/text-translation-overview.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ author: laujan
77
manager: nitinme
88
ms.service: azure-ai-translator
99
ms.topic: overview
10-
ms.date: 07/18/2023
10+
ms.date: 05/02/2024
1111
ms.author: lajanuar
1212
---
1313

@@ -62,21 +62,34 @@ Add Text Translation to your projects and applications using the following resou
6262
6363
Text Translation data residency depends on the Azure region where your Translator resource was created:
6464
65-
* Translator resources **created** in any region in Europe are **processed** at data center in West Europe and North Europe.
66-
* Translator resources **created** in any region in Asia or Australia are **processed** at data center in Southeast Asia and Australia East.
67-
* Translator resource **created** in all other regions including Global, North America and South America are **processed** at data center in East US and West US 2.
68-
6965
### Text Translation data residency
7066
7167
✔️ Feature: **Translator Text** </br>
72-
✔️ Region where resource created: **Any**
7368
7469
| Service endpoint | Request processing data center |
7570
|------------------|--------------------------|
7671
|**Global (recommended):**</br>**`api.cognitive.microsofttranslator.com`**|Closest available data center.|
77-
|**Americas:**</br>**`api-nam.cognitive.microsofttranslator.com`**|East US &bull; South Central US &bull; West Central US &bull; West US 2|
78-
|**Europe:**</br>**`api-eur.cognitive.microsofttranslator.com`**|North Europe &bull; West Europe|
79-
| **Asia Pacific:**</br>**`api-apc.cognitive.microsofttranslator.com`**|Korea South &bull; Japan East &bull; Southeast Asia &bull; Australia East|
72+
|**Americas:**</br>**`api-nam.cognitive.microsofttranslator.com`**|East US 2 &bull; West US 2|
73+
|**Asia Pacific:**</br>**`api-apc.cognitive.microsofttranslator.com`**|Japan East &bull; Southeast Asia|
74+
|**Europe (except Switzerland):**</br>**`api-eur.cognitive.microsofttranslator.com`**|France Central &bull; West Europe|
75+
|**Switzerland:**</br> For more information, *see* [Switzerland service endpoints](#switzerland-service-endpoints).|Switzerland North &bull; Switzerland West|
76+
77+
#### Switzerland service endpoints
78+
79+
Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the `Resource region` `Switzerland North` or `Switzerland West`, then use the resource's custom endpoint in your API requests.
80+
81+
For example: If you create a Translator resource in Azure portal with `Resource region` as `Switzerland North` and your resource name is `my-swiss-n`, then your custom endpoint is `https&#8203;://my-swiss-n.cognitiveservices.azure.com`. And a sample request to translate is:
82+
83+
```curl
84+
// Pass secret key and region using headers to a custom endpoint
85+
curl -X POST "https://my-swiss-n.cognitiveservices.azure.com/translator/text/v3.0/translate?to=fr" \
86+
-H "Ocp-Apim-Subscription-Key: xxx" \
87+
-H "Ocp-Apim-Subscription-Region: switzerlandnorth" \
88+
-H "Content-Type: application/json" \
89+
-d "[{'Text':'Hello'}]" -v
90+
```
91+
92+
Custom Translator isn't currently available in Switzerland.
8093

8194
## Get started with Text Translation
8295

0 commit comments

Comments
 (0)