Over a million developers have joined DZone.

Crowd Localizing Under Version Control

DZone's Guide to

Crowd Localizing Under Version Control

· DevOps Zone ·
Free Resource

DevOps involves integrating development, testing, deployment and release cycles into a collaborative process. Learn more about the 4 steps to an effective DevSecOps infrastructure.

Although managing all your code via a version control system is a good approach, it becomes tricky when particular files need to be translated, especially when crowd translation is planned. It is not just about sending files to the localizing agency and storing the result in the version system. In this case you have to provide an intuitive localizing system where non-technical people can simply enter the localized text. Anything technical, e.g. synchronizing the localized content with the versioning system, should run in the background.

These features are available out of the box in the Launchpad platform. However, this platform can only host projects versioned in the Bazaar version control system. While Bazaar is used for many well-known projects like Ubuntu, MySQL or Inkscape, it is not as popular as Git. Unfortunately, the most popular platform for Git based projects, GitHub, doesn't cover this scenario at all. 

But let’s not give up just yet. The localization process can be divided into two parts. The source files can be kept in your favorite versioning platform, while, a dedicated web-based localization management tool translates them. Both systems can communicate via platform APIs.

Localization management tools, namely TransifexCrowdinPOEditor or Get Localization, are ready for crowdsourcing, they offer intuitive user interfaces and can be accessed externally via API. Unlike any custom solution they even offer to leverage their localizing communities for you. Make your project public and current users can openly request to join your team. 

A few months ago I stumbled upon the txgh Ruby project that aims to integrate Transifex with GitHub. It uses the API of both systems to synchronize them. It runs its own embedded server to process the incoming events. I like the idea, but a Ruby-based solution doesn't fit well within my Java ecosystem. So I implemented it in Java as a servlet application, which can run on Apache Tomcat with my other apps. It actually simplifies my environment as no extra embedded server is required.

How it works

Both Transifex and GitHub can send POST requests when specific events happen. The specific Java servlet can process these requests and when particular ones are detected, it can synchronize the updated content. What needs to be synchronized is specified in the configuration file.

If both Transifex and GitHub projects are set properly, the resource for translation (specified in the configuration file) should be fetched into Transifex automatically and updated whenever it is changed in GitHub.

Once this resource appears in Transifex, everyone can translate it. Every language is processed separately and only recommitted to GitHub after it is fully translated and verified. When completed, localized files should never be modified directly via GitHub as they will be out of sync and any changes would be lost during subsequent updates.

Further details can be found on project page https://github.com/drifted-in/txgh

Btw, do you like astronomy? Would you like to support one of my projects? Are you impatient to see this all in action? Follow this link https://www.transifex.com/projects/p/planisphere/ :-)

Read the 4-part DevOps testing eBook to learn how to detect problems earlier in your DevOps testing processes.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}