Translation Options
REST API Version 2.0 only.
This controls how recognised speech is translated.
Used in class call translation options
The language codes are those of the text, such as "en"
for English or "es"
for Spanish.
Use a language code from the Translation Languages page.
Normally, the source language
can be determined from the corresponding speech recognition language.
Similarly, when used in a
call translation options
object, the target language
can usually be derived from the TTS voice used. Some voices can speak more
than one language and the default language for the voice will be used unless a target language
is specified.
language wrappers and examples
It contains the following properties:
Property | Required/Optional | Default | Description |
---|---|---|---|
source language | optional | - | The language code of the source text. The default is based on the language specified in the corresponding speech recognition options. |
target language | action dependent | - | The language code to translate the recognised speech in to. When used in a call translation options object, the target language can usually be derived from the TTS voice used. This property is required in other cases. |
Examples:
{
"target_language" : "es"
}
{
"source_language" : "en",
"target_language" : "es"
}
TranslationOptions Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
A class representing the options used to translate between languages and is used
by the call translation options object.
public class TranslationOptions
{
// Constructors
public TranslationOptions(string sourceLanguage = null, string targetLanguage = null);
// Members
public string SourceLanguage;
public string TargetLanguage;
}
Examples:
var translationOptions = new TranslationOptions()
{
TargetLanguage = "es"
};
var translationOptions = new TranslationOptions()
{
SourceLanguage = "en",
TargetLanguage = "es"
};
public class TranslationOptions
{
// Constructors
public TranslationOptions(string sourceLanguage = null, string targetLanguage = null);
// Members
public string SourceLanguage;
public string TargetLanguage;
}
Examples:
var translationOptions = new TranslationOptions()
{
TargetLanguage = "es"
};
var translationOptions = new TranslationOptions()
{
SourceLanguage = "en",
TargetLanguage = "es"
};
public class TranslationOptions
{
// Constructors
public TranslationOptions(string sourceLanguage = null, string targetLanguage = null);
// Members
public string SourceLanguage;
public string TargetLanguage;
}
Examples:
var translationOptions = new TranslationOptions()
{
TargetLanguage = "es"
};
var translationOptions = new TranslationOptions()
{
SourceLanguage = "en",
TargetLanguage = "es"
};
TranslationOptions Class
Namespace: Aculab.Cloud.RestAPIWrapper
Assembly: Aculab.Cloud.RestAPIWrapper.dll
A class representing the options used to translate between languages and is used
by the call translation options object.
Public Class TranslationOptions
' Constructors
Public Sub New (Optional sourceLanguage As String = Nothing, Optional targetLanguage As String = Nothing)
' Members
Public Property SourceLanguage As String
Public Property TargetLanguage As String
End Class
Examples:
Dim translationOptions = New TranslationOptions(targetLanguage:="es")
Dim translationOptions = New TranslationOptions() With {
.SourceLanguage = "en",
.TargetLanguage = "es"
}
Public Class TranslationOptions
' Constructors
Public Sub New (Optional sourceLanguage As String = Nothing, Optional targetLanguage As String = Nothing)
' Members
Public Property SourceLanguage As String
Public Property TargetLanguage As String
End Class
Examples:
Dim translationOptions = New TranslationOptions(targetLanguage:="es")
Dim translationOptions = New TranslationOptions() With {
.SourceLanguage = "en",
.TargetLanguage = "es"
}
class TranslationOptions extends JSONElement
Represents the Translation Options support class.
Class synopsis:
// Constructors:
public TranslationOptions()
// Members:
public void setSourceLanguage(String sourceLanguage)
public void setTargetLanguage(String targetLanguage)
Examples:
TranslationOptions translationOpts = new TranslationOptions();
translationOpts.setTargetLanguage("es");
TranslationOptions translationOpts = new TranslationOptions();
translationOpts.setSourceLanguage("en");
translationOpts.setTargetLanguage("es");
class TranslationOptions
Represents the Translation Options support class.
Class synopsis:
# TranslationOptions object:
TranslationOptions()
# Instance methods:
TranslationOptions.set_source_language(source_language)
TranslationOptions.set_target_language(target_language)
Examples:
translationOpts = TranslationOptions()
translationOpts.set_target_language("es")
translationOpts = TranslationOptions()
translationOpts.set_source_language("en")
translationOpts.set_target_language("es")
The TranslationOptions class
Introduction
Represents the translation options.
Class synopsis
class TranslationOptions {
/* methods */
public __construct()
public self setSourceLanguage(string $language)
public self setTargetLanguage(string $language)
}
Examples:
$translation_options = new Aculab\TelephonyRestAPI\TranslationOptions();
$translation_options->setTargetLanguage('es');
$translation_options = new Aculab\TelephonyRestAPI\TranslationOptions();
$translation_options->setSourceLanguage('en')
->setTargetLanguage('es');