Localisation API
Retrieving a translation
A translation can be retrieved by sending a GET requestÂ
/api/translations/{lang}_{key}
where {lang} is the ISO 693-1 code of the language and {key} is the key to be translated.
GET /api/translations/en_REMARK_STRINGS_PROMOTIE
Successful response:
Status: 200 OK
Content-Type: application/json
Body:
{
"key": "REMARK_STRINGS_PROMOTIE",
"language": "en",
"translation": "promotion"
}
If no translation for the requested key and language exists, a status code 404 is returned
Setting or altering a translation
A translation is created or modified by sending a PUT request
/api/translations/{lang}_{key}
using content-type JSON, where {lang} is the ISO 693-1 code of the language and {key} is the key.
The body must contain the following mandatory fields:
- language
- key
- translation
Both language and key in the request body MUST be identical to the language and key in the request path.
Succes is indicated with status code 204. No body is returned.
Failure due to user error is indicated by status code 400.
Request:
PUT /api/translations/en_REMARK_STRINGS_PROMOTIE
Content-Type: application/json
Body:
{
"key": "REMARK_STRINGS_PROMOTIE",
"language": "en",
"translation": "promotion EN"
}
Successful response:
Status: 204 NO_CONTENT