Multi-language23 February 2015
We’ve recently translated peertransfer.com into Spanish, Chinese and Korean.
It has been technically challenging because our app is built on a Service-oriented architecture (SOA). That is, we have different services interacting with each other and each service has its own translations. peertransfer.com collects information from all these services.
Our solution relies on enhancing our existing public API with multi-language support. All our internal services respond with translation keys and it’s API who is responsible for translating these keys into texts.
Services upload their translations to an external translation service, where professional translators take care of actually translating content. Once the content is ready in all languages, the API application downloads and stores translations in YAML files.
This flow has its downsides. There’s a time gap when we modify or add new English content. API knows nothing of these new translations until they’re translated and downloaded. For this reason, each service also stores this content in a temporal storage, Redis.
When peertransfer.com needs to display a translated content, API will try to find it first in its YAML file, and if it doesn’t exist, it’ll return the default English text stored in Redis. In this way, we avoid returning translation missing messages to users and they can see the texts in our default language, English, for a short period of time.