Gunnebo Business Solutions, Methodology, Technical

Continuous Translation with Crowdin

The Gunnebo Business Solution software consists of many sub-projects and with customers spread across the world, localization and language is very important. To have an effective process, all the sub-projects uses Crowdin for translations, implemented into our Continuous Integration pipelines. Continuous Integration is a development practice that allows developers to integrate code into a shared repository several times a day. After check-in, the latest translations are pulled from Crowdin, and committed code is verified by automated builds allowing teams to detect problems early.

Introduction to Crowdin

Crowdin service https://crowdin.com enables merging of translation process into continuous integration pipeline for projects based on any kind of resource files dependles of localization.

image005

The web-based Crowdin Translator’s Editor provides a full range of handy tools which help translators to work at their best. The platform allows to accelerate turnaround time, as several different translators can work on the same task simultaneously:

crowdinimg7.png

With Crowdin, you may choose individual localization strategy, easily organising remote translators, proofreaders and project managers in a team. It also allows to avoid constant back and forth files sendings which are typical for the traditional old-way manner of organising translation process. As a result, translations are made on a higher professional level, and all the payments, updates, and the process of communication with your end users are shaped in a much more comfortable, free and easy way. The platform provides powerful tools effective in managing localization for projects of any type and any size. Its localization management features include continuous localization, accountability, and reporting, as well as simple workflow management.

This post describes an implementation for translation using resx key-value files with text strings.

The automation algorithm can be summarized in the following 5 steps accomplished on a build server with the help of build definition running on schedule:

  1. Get solution files from the repository.
  2. Run a script enabling build agent to push to the remote repository.
  3. Using console Java app, upload default resource file to Crowdin service.
  4. Download files for other languages from the same app.
  5. Check in changes and push to the remote repository.

If there have been any translators’ changes to the localized resource files, they will be committed to the repository, and that will trigger automated builds for all projects using that repository, enabling continuous integration option. If there have not been any changes, the push won’t take place, and build won’t be triggered.

Technical Setup in VSTS

Prerequisites

Crowdin integration requires three files to be added to the repository:

  • YAML configuration file https://support.crowdin.com/configuration-file/#cli-2
  • Standalone Java console app https://support.crowdin.com/cli-tool/
  • Powershell script to run git and Crowdin commands

VSTS Build Agent should have rights to work with git repository. This can be set in Version Control section in VSTS project settings:

crowdinimg1
The default resource file should not have a language id extension in the name, this file is used for generating localized resource files and filling missing values in those files. This is the only file to be uploaded to Crowdin service. All other files should be manually added to the solution in order to generate utility classes during the build. If you already have some localized strings in your files, the changes should be added to Crowdin web interface before synchronizing the files:

crowdinimg2

Crowdin Configuration

Yml configuration file and jar file should be placed in the root repository directory. Crowdin console app, by default, is looking for “crowdin.yml” file in the same directory. Main properties in the file are:

  • “project_identifier” – Id of the project in Crowdin service
  • “api_key” – Crowdin API key
  • “source” – Path to resource files
  • “translation” – Path and naming pattern for localized files

Crowdin documentation: https://support.crowdin.com/configuration-file/#cli-2

Build Configuration

Sample build configuration is saved as a template named “Crowdin Translation”, it’s available when adding new build configuration:

crowdinimg3.jpg

Build configuration is scheduled to run nightly:

crowdinimg4
It requires access to OAuth Token:

crowdinimg5

It consists of 4 steps, the most important of which is running a powershell script. The location of the script can be configured:

crowdinimg6

Summary

So, to add Crowdin support for a solution, you should:

  1. Get API key and project id from Crowdin.
  2. Add required files to the repository.
  3. Edit crowdin.yml file.
  4. Add Crowdin Translation build definition.
  5. Set path to the PowerShell script.
  6. Run the build definition and check that all resx files are added to the solution.

Many thanks to Fedor Sulaev for his assistance in setting this up for Gunnebo in our VSTS environment.

1 thought on “Continuous Translation with Crowdin”

Leave a Reply