Text Translation
This describes the web services that relate to text translation.
Aculab Cloud uses Google Translate to perform text translation.
Note
This is a low level API. For information on higher level APIs see the Web Services Language Wrappers
Translate
This API takes a PUT or POST request with the text to be translated in the request body. The text must be submitted as plain text encoded in utf-8. The maximum content size is 102400 characters. The URL parameters are used to specify the source and target language codes.
Authorisation
This API uses basic authentication, using your cloud account username and API Access Key.
Username | : | cloudID/username (e.g. 1-2-0/ |
Password | : | API Access key |
Request:
Url | : | https://ws.aculabcloud.net |
Methods | : | PUT, POST |
Parameter | Required/Optional | Description |
---|---|---|
target_language | required | The language code of the intended translation Use a language code from Translation Languages. |
source_language | optional | The language code of the source text. If not specified the source language will be detected. However we recommend specifying the source language to improve accuracy. Use a language code from Translation Languages. |
Returns:
A JSON object with the following parameters:
Parameter | Type | Availability | Description |
---|---|---|---|
request_id | string | always | a unique ID for this request. |
target_language_name | string | always | the English name of the requested target language. |
detected_source_language | string | when the request has not specified a source language | the language code of the detected source language. |
source_language_name | string | always | the English name of the requested or detected source language. |
translation | string | always | the translated text. |
Example:
https://ws.aculabcloud.net/translate/v1/translate?target_language=es
With the body containing "The text to be translated".
Response:
{
"request_id": "tr-23b2cc6d_1.0066bcb579.000008",
"target_language_name": "Spanish",
"detected_source_language": "en",
"source_language_name": "English",
"translation": "El texto a traducir"
}
Supported Languages
This returns a list of objects detailing the supported languages.
Authorisation
This API uses basic authentication, using your cloud account username and API Access Key.
Username | : | cloudID/username (e.g. 1-2-0/ |
Password | : | API Access key |
Request:
Url | : | https://ws.aculabcloud.net |
Methods | : | GET |
Returns:
A JSON array of objects describing the supported languages. The objects have the following parameters:
Parameter | Type | Description |
---|---|---|
language_name | string | the English name of the language. |
language | string | the language code of the language. |
Example:
https://ws.aculabcloud.net/translate/v1/supported_languages
Response:
[
{
"language_name": "Abkhaz",
"language": "ab"
},
{
"language_name": "Acehnese",
"language": "ace"
},
...
{
"language_name": "Zapotec",
"language": "zap"
},
{
"language_name": "Zulu",
"language": "zu"
}
]