Locale API

The Locale API is composed of 2 endpoints:

  • Add Locale — add a new locale or language to a project
  • Delete Locale — delete a locale or language from a project

Add Locale

This endpoint is only accessible by the private Project API key and is used to add a locale to a project.

/api/projects/:project_token/locales [POST]

Parameters:

  • id: the locale code (en-US, en_GB or fr for instance).

If everything goes well, the server should respond with 202 Accepted in the response headers. Please note that the request could be acted upon since the rest of the process (creating language files for that locale) is processed in the background on WebTranslateIt’s server. Besides, these new files might not immediately be available.

Implementation Example in Ruby:

Implementation Example in PHP:

Delete Locale

This endpoint is only accessible by the private Project API key and is used to delete a locale from a project.

/api/projects/:project_token/locales/:locale_code [DELETE]

If everything goes well, the server should respond with 202 Accepted in the response headers. Please note that the request could be acted upon since the rest of the process (deleting locale, linguistic files and translations for that locale) is processed in the background on WebTranslateIt’s server.

Implementation Example in Ruby:

Implementation Example in PHP: