Clurgo logo
  • Clurgo
  • Blog
  • Automated and asynchronous localization management with Quartz in clustering mode

Automated and asynchronous localization management with Quartz in clustering mode

2/9/2022 Hubert Brychczyński

Share

Machine translation is yesterday’s news. With the arrival of such tools as DeepL, translators can now sigh with relief because much of the tedious work they usually have to do can be ceded down to a robot. All that’s left for the translator to do is polish the text after the machine.

Until recently, localization project managers were not so lucky. They may have looked at translators in envy, wishing there was a way to automate some of their tasks, too, so they could focus on more important and demanding challenges.

Our client

That is exactly the desire with which a large translation agency came to Clurgo. They wanted to automate the handling of translation assignments between their website, which crowdsourced translators, and a partner service, which collected assignments from clients.

The challenge

Previously, the task of sorting out assignments and ascribing them to the right translators was done manually. The partner website would receive a request to translate a text from language A to B. Then, a human would send the text to the translation agency’s system, taking care that the languages on both sides of the exchange match. After the job has been completed, a human would do the same thing in reverse – match the translation with the client on the other end.

As you can see, the entire process was repetitive and manual, which made it an ideal candidate for automation. The benefits of such automation could be tremendous. Theoretically, the right implementation could cut the time needed for localization management by hours, freeing human resources to be applied elsewhere. It was a prize worth pursuing, so we rolled up our sleeves and set out to work.

The solution

The client gave us access to the internal APIs of both platforms. We read the documentation and wrote an entire automation backend in Java with SpringBoot at the core, connecting the two APIs. Its job was to handle the generating, sending, and matching of submitted documents. For that, we needed to equip it with a tool that would regularly check for new assignments, and then initiate and manage the process of exchange between the two services. In other words, we needed a scheduler.

Choosing the right scheduler: Quartz for easy scalability and optimal performance

A key step in the development process was to choose and configure the right scheduler. It had to meet a few specific criteria. One, it needed to be compatible with Java, because that was the language of our backend. Two, it had to be scalable in a containerized architecture, because that was how our client was deploying and running its applications. And finally, it had to work asynchronously to prevent any breaks in operation.

We decided to go with Quartz, a robust, feature-rich, and Java-ready event scheduler. Quartz is open-source, easy to integrate into any Java application, and natively supported by Spring. Furthermore, and maybe even more importantly, it comes with a built-in clustering feature. This feature is what made Quartz easily applicable and scalable in our client’s containerized environment.

The only relative drawback of Quartz is that it doesn’t seem to be the most intuitive solution for asynchronous processing. Simpler tools can achieve the same result. To be honest, if we cared about the ease of implementing asynchronicity above anything else, we could have just disregarded schedulers and used some implementation of ExecutorService interface in plain Java instead. But then we wouldn’t be able to scale our system optimally. Quartz, on the other hand, was able to replicate itself into numerous containers, making its copies communicate with each other through a shared database and dividing jobs between them so that the workload was even across all the containers. The ease of replication across clusters plus performance tuning were the selling points that convinced us Quartz was the right way to go.

Addressing language code incompatibility

Along the way, it turned out that not all language codes were the same across both platforms. For instance, the Hungarian language could be shortened to HUN on one platform and to HN on another. This caused the system to malfunction when it processed a translation job involving that particular language. So we decided to implement a failsafe mechanism that alerts the localization manager via email about the language code incompatibility. This way, the system worked without interruption and the managers were kept informed about the language codes they needed to sync across their systems.

The result

As a result of our efforts, the client received a dependable system that worked in the background and instantaneously handled translation jobs between the two separate services. It essentially relieved human workers of hours of dull and monotonous work, allowing them to pursue other responsibilities. In addition, we found and mitigated a blind spot on the intersection of the platforms, which could otherwise sabotage the entire project’s operation.

Are you a manager who has to perform hundreds of similar and mechanical tasks over and over again? Or maybe some of your subordinates suffer a similar plight and you would rather see them applying themselves to more creative endeavors? Perhaps you can’t think of anything that would be suitable for automation? Whatever the case, do not hesitate to give us a call. You’d be surprised to learn how many things we can program computers to do for you.

Clurgo logo

Subscribe to our newsletter

© 2014 - 2024 All rights reserved.