Automate your application translation in VSTSBy Mirek on (tags: POEditor, Translations, VSTS, categories: tools)
In this post I will show you a way to make your application translations to be done in Visual Studio Team Services. I will use a POEditor subscription for that. Keep reading
Let’s say we have an application we want to support in three languages: English, German and Polish. The application is managed in Visual Studio Team Services and as a repository we’ve choosen GIT.
According to the languages we want to support, our project contains three resx files : Literals.resx with English translations, Literals.de.resx with German translations and Literals.pl.resx with Polish translations. Let’s assume the English translations will be provided during application development. So the English literals will be the source of the translation and German and Polish will be the languages we need the literals to be tranlsated into.
In this post I will show you one of the alternatives which is the integration with POEditor service. POEditor is a translation service which offers and facilitates translations in your projects. It offers a manual translation facilities, automatic translation with use of external API’s like Google tranlsate. It can integrate with GitHub, VSTS/TFS and other. POEDitor is generally a paid service, but also offers a free / evaluation subscritpion, in which you can translate up to 1000 strings. The pricing table is available here.
Once we create a account on POEditor we need to create a project and corresponding languages for the tranlsation.
We need to add languages our application is about to support.
Next, go to integrations options here and connect your POEditor account to the Visual Studio Team Services. Follow the instructions.
You will be redirected to the Visual Studio page and asked for the confirmation and granting POEditor some privilages on your project.
After that you should see the POEditor as authorized application in VSTS. Go to your VSTS Profile page and at the bottom click on Manage authorizations
Ok, we have the POEditor account connected to VSTS. Next thing we need to do is to tell POEditor which file in our GIT repo contains which tranlsation of our project. To do that let’s back to the settings integration page and point to our resx files in VSTS repo.
When we hit Link to VSTS / TFS file the modal will popup where we have to point to the file
We have to repeat this step for all three languages.
Now we can import terms and translations to POEditor. For each language hit Get terms on the right hand side. That will upload all terms. Also when you want to load translations for the language you can select one or more languages and hit Import. That will import the translations made by developer or by other tool outside the POEditor.
You can also add some automation to this process by generating a Webhooks for terms and translations export and import. That will simplify the export and import to just ona REST call.
After we’ve imported the terms we can use all the functionality of the POEditor.
Go to the project and hit language German. Then from the right toolbar select Set reference Language
Select English as reference language and repeat this step for Polish as well. That tells the POEditor to use English as a reference and translate from it to the target languages.
Now we want to use the automatic translation feature. Go to the language you want the translation to be done and select Automatic Translation from the right side toolbar.
You can choose here which translation service you want to use. In a free subscriptions there is Google and Microsoft. Not sure if there are more in higher options, but those two are good enough to have quite acurate translations in most cases. Select the source and target languages and hit Translate. After all you get the translations which you can eventually refine manually.
After all your translations are ready you can upload them back to VSTS. Got to the integrations settings again and hit Export this time for the German and Polish languages selected.
When all succeed you will see te updated resx files in your repository on VSTS.