Translation API

The Translation API is composed of 2 endpoints:

Show Translation

This endpoint is only accessible by the private Project API key and is used to show a string.

/api/projects/:project_token/strings/:string_id/locales/:locale_code/translations.format [GET]

Where format is one of xml, json or yaml. Note that you can get a JSONP response by adding a ?callback=yourFunctionName parameter to the json API call.

Example response with JSON:

  • text: The actual translation.
  • status: Translation status. One of status_proofread, status_untranslated, status_unverified, status_unproofread, status_hidden (status from string), status_obsolete (status from string).
  • version: Version number of the translation.
  • Some information from the string are returned as a convenience.

Example Implementation in Ruby

Example Implementation in PHP

Create Translation

This endpoint is only accessible by the private Project API key and is used to create a new translation.

/api/projects/:project_token/strings/:string_id/locales/:locale_code/translations [POST]

Parameters

A JSON object modelled after the following:

All fields are optional. If no text is provided, WebTranslateIt will create an empty translation. Setting minor_change to true to a translation in source language won’t flag the target translations as “to verify”.

status can be one of status_proofread (proofread), status_unverified (to verify) or status_unproofread (to proofread). For more information on the string statuses, check String.

Note that you can also pass a validation parameter set to "false" if you don’t want translation validations to take place.

If everything goes well, WebTranslateIt will respond with 201 Created in the header and a JSON representation of the string just created in the body.

Note that updating an existing string is made using this same API, WebTranslateIt creates new versions of that translation.

If the translation cannot be saved due to a validation error, you will get a 406 response status with the following payload:

Example Implementation in Ruby

Example Implementation in PHP