Muokkaa

Jaa


Document Translation SDKs

Document Translation is a cloud-based REST API feature of the Azure AI Translator service. The Document Translation API enables quick and accurate source-to-target whole document translations, asynchronously, in supported languages and various file formats. The Document Translation software development kit (SDK) is a set of libraries and tools that enable you to easily integrate Document Translation REST API capabilities into your applications.

Supported languages

Document Translation SDK supports the following programming languages:

Language → SDK version Package Client library Supported API version
🆕 .NET/C# → 2.0.0-beta.1 NuGet Azure SDK for .NET Document Translation api-version=2024-05-01
🆕 Python → 1.1.0b1 PyPi Azure SDK for Python Document Translation api-version=2024-05-01

Changelog and release history

This section provides a version-based description of Document Translation feature and capability releases, changes, updates, and enhancements.

Version 2.0.0-beta.1
2024-05-07

Changelog/Release History
README
Samples

Use Document Translation SDK in your applications

The Document Translation SDK enables the use and management of the Translation service in your application. The SDK builds on the underlying Document Translation REST APIs for use within your programming language paradigm. Choose your preferred programming language:

1. Install the SDK client library

dotnet add package Azure.AI.Translation.Document --version 2.0.0-beta.1
Install-Package Azure.AI.Translation.Document -Version 2.0.0-beta.1

2. Import the SDK client library into your application

using System;
using Azure.Core;
using Azure.AI.Translation.Document;

3. Authenticate the client

Create an instance of the DocumentTranslationClient object to interact with the Document Translation SDK, and then call methods on that client object to interact with the service. The DocumentTranslationClient is the primary interface for using the Document Translation client library. It provides both synchronous and asynchronous methods to perform operations.

Asynchronous batch translation

private static readonly string endpoint = "<your-custom-endpoint>";
private static readonly string key = "<your-key>";

DocumentTranslationClient client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(key));

Synchronous single document translation

private static readonly string endpoint = "<your-custom-endpoint>";
private static readonly string key = "<your-key>";

SingleDocumentTranslationClient client = new SingleDocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(apiKey));

4. Build your application

Asynchronous batch translation

Document Translation batch interfaces require the following input:

  1. Upload your files to an Azure Blob Storage source container (sourceUri).
  2. Provide a target container where the translated documents can be written (targetUri).
  3. Include the target language code (targetLanguage).

Uri sourceUri = new Uri("<your-source container-url");
Uri targetUri = new Uri("<your-target-container-url>");
string targetLanguage = "<target-language-code>";

DocumentTranslationInput input = new DocumentTranslationInput(sourceUri, targetUri, targetLanguage)

Synchronous single document translation

Single document translation

Help options

The Microsoft Q&A and Stack Overflow forums are available for the developer community to ask and answer questions about Azure Text Translation and other services. Microsoft monitors the forums and replies to questions that the community has yet to answer.

Tip

To make sure that we see your Microsoft Q&A question, tag it with microsoft-translator. To make sure that we see your Stack Overflow question, tag it with Azure AI Translator.

Next steps