DocumentTranslationClient.StartTranslationAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
StartTranslationAsync(WaitUntil, StartTranslationDetails, CancellationToken) |
Submit a document translation request to the Document Translation service. |
StartTranslationAsync(WaitUntil, RequestContent, RequestContext) |
[Protocol Method] Submit a document translation request to the Document Translation service
|
StartTranslationAsync(DocumentTranslationInput, CancellationToken) |
Starts a translation operation which translates the document(s) in your source container to your TranslationTarget(s) in the given language. For document length limits, maximum batch size, and supported document formats, see . |
StartTranslationAsync(IEnumerable<DocumentTranslationInput>, CancellationToken) |
Starts a translation operation which translates the document(s) in your source container to your TranslationTarget(s) in the given language. For document length limits, maximum batch size, and supported document formats, see . |
StartTranslationAsync(WaitUntil, StartTranslationDetails, CancellationToken)
- Source:
- DocumentTranslationClient.cs
Submit a document translation request to the Document Translation service.
public virtual System.Threading.Tasks.Task<Azure.Operation> StartTranslationAsync (Azure.WaitUntil waitUntil, Azure.AI.Translation.Document.StartTranslationDetails startTranslationDetails, System.Threading.CancellationToken cancellationToken = default);
abstract member StartTranslationAsync : Azure.WaitUntil * Azure.AI.Translation.Document.StartTranslationDetails * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation>
override this.StartTranslationAsync : Azure.WaitUntil * Azure.AI.Translation.Document.StartTranslationDetails * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Operation>
Public Overridable Function StartTranslationAsync (waitUntil As WaitUntil, startTranslationDetails As StartTranslationDetails, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Operation)
Parameters
- waitUntil
- WaitUntil
Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- startTranslationDetails
- StartTranslationDetails
Translation job submission batch request.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Exceptions
startTranslationDetails
is null.
Remarks
Use this API to submit a bulk (batch) translation request to the Document Translation service. Each request can contain multiple documents and must contain a source and destination container for each document.
The prefix and suffix filter (if supplied) are used to filter folders. The prefix is applied to the subpath after the container name.
Glossaries / Translation memory can be included in the request and are applied by the service when the document is translated.
If the glossary is invalid or unreachable during translation, an error is indicated in the document status. If a file with the same name already exists at the destination, it will be overwritten. The targetUrl for each target language must be unique.
Applies to
StartTranslationAsync(WaitUntil, RequestContent, RequestContext)
- Source:
- DocumentTranslationClient.cs
[Protocol Method] Submit a document translation request to the Document Translation service
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler StartTranslationAsync(WaitUntil, StartTranslationDetails, CancellationToken) convenience overload with strongly typed models first.
public virtual System.Threading.Tasks.Task<Azure.Operation> StartTranslationAsync (Azure.WaitUntil waitUntil, Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member StartTranslationAsync : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>
override this.StartTranslationAsync : Azure.WaitUntil * Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Operation>
Public Overridable Function StartTranslationAsync (waitUntil As WaitUntil, content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Operation)
Parameters
- waitUntil
- WaitUntil
Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- content
- RequestContent
The content to send as the body of the request.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The Operation representing an asynchronous operation on the service.
Exceptions
content
is null.
Service returned a non-success status code.
Applies to
StartTranslationAsync(DocumentTranslationInput, CancellationToken)
- Source:
- DocumentTranslationClient.cs
- Source:
- DocumentTranslationClient.cs
Starts a translation operation which translates the document(s) in your source container to your TranslationTarget(s) in the given language.
For document length limits, maximum batch size, and supported document formats, see .
public virtual System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation> StartTranslationAsync (Azure.AI.Translation.Document.DocumentTranslationInput input, System.Threading.CancellationToken cancellationToken = default);
abstract member StartTranslationAsync : Azure.AI.Translation.Document.DocumentTranslationInput * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation>
override this.StartTranslationAsync : Azure.AI.Translation.Document.DocumentTranslationInput * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation>
Public Overridable Function StartTranslationAsync (input As DocumentTranslationInput, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DocumentTranslationOperation)
Parameters
- input
- DocumentTranslationInput
Sets the input for the translation operation including source and target containers for documents to be translated.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
Exceptions
Service returned a non-success status code.
Applies to
StartTranslationAsync(IEnumerable<DocumentTranslationInput>, CancellationToken)
- Source:
- DocumentTranslationClient.cs
- Source:
- DocumentTranslationClient.cs
Starts a translation operation which translates the document(s) in your source container to your TranslationTarget(s) in the given language.
For document length limits, maximum batch size, and supported document formats, see .
public virtual System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation> StartTranslationAsync (System.Collections.Generic.IEnumerable<Azure.AI.Translation.Document.DocumentTranslationInput> inputs, System.Threading.CancellationToken cancellationToken = default);
abstract member StartTranslationAsync : seq<Azure.AI.Translation.Document.DocumentTranslationInput> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation>
override this.StartTranslationAsync : seq<Azure.AI.Translation.Document.DocumentTranslationInput> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.Translation.Document.DocumentTranslationOperation>
Public Overridable Function StartTranslationAsync (inputs As IEnumerable(Of DocumentTranslationInput), Optional cancellationToken As CancellationToken = Nothing) As Task(Of DocumentTranslationOperation)
Parameters
- inputs
- IEnumerable<DocumentTranslationInput>
Sets the inputs for the translation operation including source and target containers for documents to be translated.
- cancellationToken
- CancellationToken
A CancellationToken controlling the request lifetime.
Returns
Exceptions
Service returned a non-success status code.