AWS.Translate — AWS SDK for JavaScript (original) (raw)
We recommend that you migrate to AWS SDK for JavaScript v3. For dates, additional details, and information on how to migrate, please refer to the linked announcement.
Class: AWS.Translate
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Provides translation of the input content from the source language to the target language.
Sending a Request Using Translate
var translate = new AWS.Translate();
translate.createParallelData(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the Translate object uses this specific API, you can construct the object by passing the apiVersion
option to the constructor:
var translate = new AWS.Translate({apiVersion: '2017-07-01'});
You can also set the API version globally in AWS.config.apiVersions
using the translate service identifier:
AWS.config.apiVersions = {
translate: '2017-07-01',
// other service API versions
};
var translate = new AWS.Translate();
Constructor Summarycollapse
- new AWS.Translate(options = {}) ⇒ Object constructor
Constructs a service object.
Property Summarycollapse
- endpoint ⇒ AWS.Endpoint readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summarycollapse
- createParallelData(params = {}, callback) ⇒ AWS.Request
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. - deleteParallelData(params = {}, callback) ⇒ AWS.Request
Deletes a parallel data resource in Amazon Translate.
. - deleteTerminology(params = {}, callback) ⇒ AWS.Request
A synchronous action that deletes a custom terminology.
. - describeTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Gets the properties associated with an asynchronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
. - getParallelData(params = {}, callback) ⇒ AWS.Request
Provides information about a parallel data resource.
. - getTerminology(params = {}, callback) ⇒ AWS.Request
Retrieves a custom terminology.
. - importTerminology(params = {}, callback) ⇒ AWS.Request
Creates or updates a custom terminology, depending on whether one already exists for the given terminology name. - listLanguages(params = {}, callback) ⇒ AWS.Request
Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports.
. - listParallelData(params = {}, callback) ⇒ AWS.Request
Provides a list of your parallel data resources in Amazon Translate.
. - listTagsForResource(params = {}, callback) ⇒ AWS.Request
Lists all tags associated with a given Amazon Translate resource. - listTerminologies(params = {}, callback) ⇒ AWS.Request
Provides a list of custom terminologies associated with your account.
. - listTextTranslationJobs(params = {}, callback) ⇒ AWS.Request
Gets a list of the batch translation jobs that you have submitted.
. - startTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Starts an asynchronous batch translation job. - stopTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Stops an asynchronous batch translation job that is in progress.
If the job's state isIN_PROGRESS
, the job will be marked for termination and put into theSTOP_REQUESTED
state. - tagResource(params = {}, callback) ⇒ AWS.Request
Associates a specific tag with a resource. - translateDocument(params = {}, callback) ⇒ AWS.Request
Translates the input document from the source language to the target language. - translateText(params = {}, callback) ⇒ AWS.Request
Translates input text from the source language to the target language. - untagResource(params = {}, callback) ⇒ AWS.Request
Removes a specific tag associated with an Amazon Translate resource. - updateParallelData(params = {}, callback) ⇒ AWS.Request
Updates a previously created parallel data resource by importing a new input file from Amazon S3.
.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.Translate(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Property Details
endpoint ⇒ AWS.Endpoint
Returns an Endpoint object representing the endpoint URL for service requests.
Method Details
createParallelData(params = {}, callback) ⇒ AWS.Request
Creates a parallel data resource in Amazon Translate by importing an input file from Amazon S3. Parallel data files contain examples that show how you want segments of text to be translated. By adding parallel data, you can influence the style, tone, and word choice in your translation output.
deleteParallelData(params = {}, callback) ⇒ AWS.Request
Deletes a parallel data resource in Amazon Translate.
deleteTerminology(params = {}, callback) ⇒ AWS.Request
A synchronous action that deletes a custom terminology.
describeTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Gets the properties associated with an asynchronous batch translation job including name, ID, status, source and target languages, input/output S3 buckets, and so on.
getParallelData(params = {}, callback) ⇒ AWS.Request
Provides information about a parallel data resource.
getTerminology(params = {}, callback) ⇒ AWS.Request
Retrieves a custom terminology.
importTerminology(params = {}, callback) ⇒ AWS.Request
Creates or updates a custom terminology, depending on whether one already exists for the given terminology name. Importing a terminology with the same name as an existing one will merge the terminologies based on the chosen merge strategy. The only supported merge strategy is OVERWRITE, where the imported terminology overwrites the existing terminology of the same name.
If you import a terminology that overwrites an existing one, the new terminology takes up to 10 minutes to fully propagate. After that, translations have access to the new terminology.
listLanguages(params = {}, callback) ⇒ AWS.Request
Provides a list of languages (RFC-5646 codes and names) that Amazon Translate supports.
listParallelData(params = {}, callback) ⇒ AWS.Request
Provides a list of your parallel data resources in Amazon Translate.
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Lists all tags associated with a given Amazon Translate resource. For more information, see Tagging your resources.
listTerminologies(params = {}, callback) ⇒ AWS.Request
Provides a list of custom terminologies associated with your account.
listTextTranslationJobs(params = {}, callback) ⇒ AWS.Request
Gets a list of the batch translation jobs that you have submitted.
startTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Starts an asynchronous batch translation job. Use batch translation jobs to translate large volumes of text across multiple documents at once. For batch translation, you can input documents with different source languages (specify auto
as the source language). You can specify one or more target languages. Batch translation translates each input document into each of the target languages. For more information, see Asynchronous batch processing.
Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation.
stopTextTranslationJob(params = {}, callback) ⇒ AWS.Request
Stops an asynchronous batch translation job that is in progress.
If the job's state is IN_PROGRESS
, the job will be marked for termination and put into the STOP_REQUESTED
state. If the job completes before it can be stopped, it is put into the COMPLETED
state. Otherwise, the job is put into the STOPPED
state.
Asynchronous batch translation jobs are started with the StartTextTranslationJob operation. You can use the DescribeTextTranslationJob or ListTextTranslationJobs operations to get a batch translation job's JobId
.
tagResource(params = {}, callback) ⇒ AWS.Request
Associates a specific tag with a resource. A tag is a key-value pair that adds as a metadata to a resource. For more information, see Tagging your resources.
translateDocument(params = {}, callback) ⇒ AWS.Request
Translates the input document from the source language to the target language. This synchronous operation supports text, HTML, or Word documents as the input document. TranslateDocument
supports translations from English to any supported language, and from any supported language to English. Therefore, specify either the source language code or the target language code as “en” (English).
If you set the Formality
parameter, the request will fail if the target language does not support formality. For a list of target languages that support formality, see Setting formality.
translateText(params = {}, callback) ⇒ AWS.Request
Translates input text from the source language to the target language. For a list of available languages and language codes, see Supported languages.
untagResource(params = {}, callback) ⇒ AWS.Request
Removes a specific tag associated with an Amazon Translate resource. For more information, see Tagging your resources.
updateParallelData(params = {}, callback) ⇒ AWS.Request
Updates a previously created parallel data resource by importing a new input file from Amazon S3.