Guide to Create a New Library
In addition to the regular API, we added 3 special endpoints, specifically designed to be really fast while doing a lot of work:
segments/init | Push existing translations to Translation.io. |
segments/sync | Send new keys/strings and get new translations from Translation.io. |
source_edits/pull | Get source editions made on Translation.io interface (see here). |
Using these endpoints and our complete guide, you are now able to create a library for your own stack, as we did for the existing libraries.
If you created your own library, please contact us so we can add it on our listing. We can also help you maintain it and host it on https://github.com/translation for more visibility.
API Reference
We created a new API that uses REST principles and conventions. It receives JSON parameters and returns JSON responses.
The main page is located here: https://translation.io/docs/api
Using the following models, you can very easily create custom translation workflows:
We intend to keep on adding more models in the future, so you will
be able to manage all of your resources programmatically.
If you have any feedback regarding our API, please contact us at contact@translation.io
Highlighting of HTML Tags and Interpolated Variables
Sometimes you have no choice but to confront your translators with HTML or interpolated variables.
The problem is that translators do not necessarily know the meaning of these notations and may be tempted to translate them or may inadvertently alter them, as shown here below:
English | French | |
---|---|---|
Hello %{name}
|
Bonjour %{nom}
|
|
Account <em>disabled<em>
|
Compte < em>>désactivé<em>
|
In the first example, the name
variable will not be replaced by the username
in French. In the second, the HTML will not be correctly interpreted and the page will
be broken.
To help translators manage these notations more easily, we now highlight HTML tags and interpolated variables. We also display a warning icon if some of these tags and variables are missing or incorrectly translated.
On top of that, translators are now able to insert these notations into the target field by clicking on them or pressing the TAB key. This really speeds up the translation process and prevents unfortunate typos.
Auto-Translation with Google Translate
Machine Translation (MT) is a term used to describe translations that are carried out by a computer. One very popular MT service is Google Translate.
Recently, Google Translate started to use Deep Learning strategies to improve its translations with great success. Even though Google Translate is still not comparable to a native-speaker translator, the results are usually “good enough” until someone proofread them.
For this reason, we created the new Auto-Translate feature(1), which you will find in the project settings.
If you enable it, every new source text will be automatically translated for free
using Google Translate, and then pushed back into your code. A new auto translated
tag will be added to these segments and your translators will be notified that they
may proofread them at their own convenience.
You can also click on “Auto-Translate now” to translate an existing project into a specific target language.
Custom Languages
You may want to add a custom language that is derived from an existing language. It's useful if you want to adapt some translations to another instance of your application, or to a specific customer.
The structure of a custom language is: existing language code
+ -
+ custom text
, where
custom text
can only contain alphanumeric characters and -
.
Examples: en-microsoft
or fr-BE-custom
.
Custom languages can be added like any other language.
Fallbacks work as expected. It means that if the en-microsoft.some_key
is missing,
then it will fallback to en.some_key
. So you only need to translate keys that should
be customized.
Note that fallback are chained, so fr-BE-custom
will fallback to fr-BE
that will
itself fallback to fr
.
Using GetText syntax, it will only fallback to the source language. So either you create a fallback mechanism by yourself or you avoid fallbacking by translating everything in Translation.io for that custom language.