Implementing Document Translation With Multiple Documents

Learn to perform multiple document translations from one language to another language using the text translator API.

Introduction

In the previous lesson, we implemented translation of the text which is being sent as part of the request to the translator service. In this lesson, we’ll explore how a document can be translated from one language to the other using the translator service. The document translator service from Azure can process numerous documents, preserve the original presentation of the document while translating, apply custom translation, etc.

To work on this chapter, you would need a Standard tier subscription of the translator service. It will not work in the Free tier.

Implementation

Before moving on with the implementation, there are some steps that need to be done. The Document translator endpoint accepts an Azure blob storage URL with a SAS token. Follow the steps mentioned below to upload your documents in a blob container:

  • You can follow the steps mentioned in the chapter How to Create a Storage Account and SAS Token? and create a blob container and upload your documents inside the source container.

  • You would need to create another container which will be the target container where all the translated documents will be stored.

  • Generate the SAS token for the container (if you want to translate all the documents in the container), or for the file/blob (if you want to translate a particular document from the source container).

  • We will explore both container-level and file-level document translation. Once you have the SAS token, save them in the below code snippets wherever mentioned.

Below are two sample PDFs of Azure certification. You can download these and keep them in your source container for working with this lesson.

Get hands-on with 1400+ tech skills courses.