AWS
AWS functions access the AWS SDK.
They need an account with a valid AWS-IAM API User key ID and secret. In addition for most cases a region has to be provided in the account too.
aws_translate
Translates a text from one language to another using AWS Translate.
Returns { TranslatedText, SourceLanguageCode, TargetLanguageCode }.
Be aware that this function is limited by the limits of the AWS API. At the current time this was about 5000 Bytes per translation call.
aws_translate(source_language, target_language, translation_text, [terminology_list], aws_account);
Example 1:
let res = aws_translate("de", "en", "Willkommen in Cuxhaven", "aws");
log("RESULT ", res);
Result:
{
"TranslatedText": "Welcome to Cuxhaven",
"SourceLanguageCode": "de",
"TargetLanguageCode": "en"
}
Example 2: auto translation
use 'auto' as source language will calculate it - this results in higher aws costs
let res = aws_translate("auto", "en", "Willkommen in Cuxhaven", "aws");
log("RESULT ", res);
Result:
{
"TranslatedText": "Welcome to Cuxhaven",
"SourceLanguageCode": "de",
"TargetLanguageCode": "en"
}
Example 3: using terminology lists 1
Terminology lists stored at AWS can be addressed as 4th parameter before the account. See terminology list named "IT" in the following example
let res = aws_translate("auto", "en", "Willkommen in Cuxhaven", "IT", "aws");
log("RESULT ", res);
Result:
{
"TranslatedText": "Welcome to Cuxhaven",
"SourceLanguageCode": "de",
"TargetLanguageCode": "en"
}
Example 4: using terminology lists 2
Terminology lists stored at AWS can be addressed as 4th parameter before the account. Using multiple terminology lists can be done by separate the names by ','
let res = aws_translate("auto", "en", "Willkommen in Cuxhaven", "IT,HR,Manufacturing", "aws");
log("RESULT ", res);
Result:
{
"TranslatedText": "Welcome to Cuxhaven",
"SourceLanguageCode": "de",
"TargetLanguageCode": "en"
}