Back

Managing translations with localise.biz

May 9, 2019
5mn

Introduction

As part of our project, we needed a translation management tool. We have 3 languages on our site, and the translations are done by the business team (marketing and other).

Localise.biz (aka Loco) is a SaaS online translation management service. It offers free and paid subscriptions according to the needs and the size of the project.

Setup

First, we need to create a user account. Once our account is created, we start by creating a project and choose a main language for this project which will serve as a basis for translations. The same user can be part of several projects.

loco_create

We can then add all the languages we need in our application, whether it be in a standard format, ISO2, or custom languages for more specific needs.

The interface is quite simple and intuitive. With all the filters availables, it becomes easy to work on this interface without any issues.

loco_translate

Features

Here are the reasons that convinced us to choose this tool.

Implementation of a translation workflow

Loco allows you to manage statuses for assets (an asset is a translation key associated with its translations in all languages).

This allows us to set up a rather simple translation validation workflow. For example, when the development team creates translation keys, they can put them into Provisional status.

Then, when the translations have been done and validated by the people whose responsibility it is, the status is modified, allowing to filter on the assets that are to be translated yet, thus simplifying their work.

loco_statuses

Moreover, it is possible to assign tags to assets. This was useful for us to prepare releases in particular.

loco_tags

Import / export

Of course, when migrating to a new solution, we do not want to create the translation keys one by one... Loco has a very complete import / export system with a wide range of formats (JSON, CSV, etc.). We can also use all the filters in our exports. I'll let you take a look at their documentation with all the details if needed.

loco_export

REST API

The main reason to choose Loco for us was the REST API. It allows to manipulate all the data that we are able to modify with the UI (translations, locales, tags ...). In our case, we used only the retrieval of translations.

Usage

When translation files are stored within an application, we sometimes have to deploy it only to update certain translations.

When redesigning our website, we decided to store the translation files on a cloud storage to separate the deployment of our applications from the translations update.

Thus, we export the contents of Loco to store it in a bucket on Google Cloud Platform in JSON files (one file per language). So we have set up a cron that runs regularly on Google App Engine that takes care of that.

Below is the code:

const axios = require('axios'); const express = require('express'); const { Storage } = require('@google-cloud/storage'); const app = express(); const storage = new Storage({ projectId: 'GOOGLE_CLOUD_PLATEFORM_PROJECT_ID', }); app.get('/translations/b2cwebsite', (req, res,) => { const bucket = storage.bucket('YOUR_BUCKET_NAME'); const locales = ['en', 'fr']; let status = 200; const client = axios.create({ baseURL: 'https://localise.biz', headers: {'Authorization': 'Loco YOUR_LOCALISE_API_KEY'} }); locales.forEach(function(locale) { client.get('/api/export/locale/' + locale + '.json') .then(function (response) { const file = bucket.file(`messages.${locale}.json`); file.save(JSON.stringify(response.data), { contentType: 'application/json', public: true, gzip: true, resumable: false, metadata: { cacheControl: `public, max-age=3600`, }, }, function(err) { if (err) { console.error(`Couldn't upload translations file to Google Cloud Storage for locale ${locale}: ${err}`); status = 500; } }); }) .catch(function (error) { console.error(`Couldn't fetch translations from Localise for locale ${locale}: ${error}`); status = 500; }); }); res.status(status).end(); });

As you can see, in just a few lines we get our translation files. Just load them into our app and you're done!

Conclusion

If you are working on a multi-language site and you are looking for a solution that would satisfy both developers and translators, Localise.biz could be right for you. This solution offers great flexibility, both in the way you manage and export translations, and in the way you manage translations on a daily basis for business users.


Related articles

Dependency injection in Symfony

You work with Symfony, but the concept of dependency injection is a little blurry for you? Find out how to take advantage of the component reading this article.

Sep 29, 2021•10mn•Marie Minasyan

Women in IT

Today is the International Women's Rights Day, and we wanted to take the opportunity to talk to you about a subject that is close to our hearts: women in IT. The purpose of this article is to tell you about our experience to give you a better vision of why there aren't many of us, why some give up, and, above all, how to make that change.

Mar 8, 2021•9mn•Marie Minasyan & Marianne Joseph-Géhannin

Discover Eleven Labs

To learn more, visit our website

Let's go

Contact

Eleven Labs - Paris

102, rue du Faubourg Saint Honoré

75008 Paris

Eleven Labs - Nantes

42, rue la Tour d'Auvergne

44200 Nantes

Eleven Labs - Montréal

1155, Metcalfe St Suite 1500

Montréal, QC H3B 2V6, Canada

business@eleven-labs.com

01.82.83.11.75