Using API to Manage a Translation Project: Part Four

Using API to Manage a Translation Project: Part Four

Share on social media:

As the majority of companies that want to make using their system as effective as possiblewe created an API. After all, they are making web-service mashups possible and we want our customers to be as familiarized with this possibilities. But creating an API itself is too little for everyone to understand the mechanism behind it – that’s why we decided to create a blog series in which we explain thoroughly how to use our API to manage a Translation Project.

In this series, you will find the parts of the code along with the descriptions. To put this blog into more of a tutorial nature, we made our use cases of API Examples available to download and work on. This specific example code is created by our developers in Visual Studio 2017; a C# console application (feel free to read about the API method it uses here).  The main code of the example is placed in the Main() method of the Program.cs. You will find there all the steps needed to create a project, upload files, check the statuses, generate translated versions and download translations.

In the first part of the series, we presented the helper methods you should be familiar with, along with method classes you should know, followed by descriptions on how to add the supported languages and company users to the project. In the second part, we explained how to create a project with one .resx file for translation and get a collection of files to check if it’s ready for translation. In part three, we explained how to read the project details and project files.

Today, you will find out more about the process of translation itself. If you are here for the first time, we encourage you to download the file with use cases, read the previous parts of the series and start familiarizing yourself with our system!

Step #7: Start Translating

After the project files are processed, the project is ready. Now it’s time for the most important part – translating it. For now, let’s suppose only one segment in the package has been translated, as depicted below:



Step #8. Read Project Details to See its Progress

You should read project details periodically. This practice allows you to see the progress of translation after it has been kicked off. In our case, the progress should be 33% approximately.

An output from the code:

reqProjectDetails = GetRequest(uriProjectDetails, "GET");
resProjectDetails = reqProjectDetails.GetResponse();
jsonProjectDetails = GetResponseJson(resProjectDetails);
Console.WriteLine("\nRaw JSON:");
projectDetails = JsonConvert.DeserializeObject<ApiProjectDetails>(jsonProjectDetails);
Console.WriteLine("Project ID: {0}", projectDetails.Id);
Console.WriteLine("Status: {0}", projectDetails.State);
Console.WriteLine("Progress: {0}", projectDetails.Progress); 

is shown below:

Project ID: 42217
Status: In progress
Progress: 33

It matches our calculation. Perfect!

Step#9. Request Generating Translated Versions of the Files in the Project

During your work with the project, you may request generating a translated version of the file at any time. Such request will create a target file with all the translations in place. Segments (resource strings) that not translated at the given moment will be kept in their original form.

The translation itself is the most crucial process. In the next and last part of the series, you will find out how to check if the translation is ready, download the translated version of the file, and most importantly, update the file in an on-going project.

Stay Tuned!
Translation experience made for you
Tailored solutions trusted by 100s of companies