In this tutorial our goal is to to use multiple Translation Providers taken from an existing Studio project and fire the pre-translation batch task to retrieve the translation for each one using only one studio project.
Before start writing the code let's take a look in Studio what happens when you have multiple providers and what to apply pre-translate batch task:
If all the providers are "Enabled" Studio will take by default first provider from the list and apply the pre-translation.
Following source code will do the following things:
-
Take the list of translation providers from a Studio project
-
Create another project with the configuration of the original project, apply pre-translation batch task
-
Parse the files and retrieve the translations, and store somewhere and clear each target segment. By clearing the target segment we can reuse the studio project created before and apply pre-translation for the next provider