New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@aws-sdk/client-translate

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
a

@aws-sdk/client-translate

AWS SDK for JavaScript Translate Client for Node.js, Browser and React Native

3.49.0
98

Supply Chain Security

100

Vulnerability

100

Quality

99

Maintenance

100

License

Version published
Weekly downloads
421K
-0.86%
Maintainers
7
Weekly downloads
 
Created
Issues
220

What is @aws-sdk/client-translate?

@aws-sdk/client-translate is an AWS SDK for JavaScript package that allows developers to interact with the Amazon Translate service. This service provides real-time translation of text between multiple languages, making it useful for applications that require language translation capabilities.

What are @aws-sdk/client-translate's main functionalities?

Translate Text

This feature allows you to translate text from one language to another. The code sample demonstrates how to use the TranslateTextCommand to translate 'Hello, world!' from English to Spanish.

const { TranslateClient, TranslateTextCommand } = require('@aws-sdk/client-translate');

const client = new TranslateClient({ region: 'us-east-1' });

const translateText = async (text, sourceLang, targetLang) => {
  const command = new TranslateTextCommand({
    Text: text,
    SourceLanguageCode: sourceLang,
    TargetLanguageCode: targetLang
  });
  const response = await client.send(command);
  return response.TranslatedText;
};

translateText('Hello, world!', 'en', 'es').then(console.log).catch(console.error);

List Languages

This feature allows you to list all supported languages by Amazon Translate. The code sample demonstrates how to use the ListLanguagesCommand to retrieve and print the list of supported languages.

const { TranslateClient, ListLanguagesCommand } = require('@aws-sdk/client-translate');

const client = new TranslateClient({ region: 'us-east-1' });

const listLanguages = async () => {
  const command = new ListLanguagesCommand({});
  const response = await client.send(command);
  return response.Languages;
};

listLanguages().then(console.log).catch(console.error);

Other packages similar to @aws-sdk/client-translate

FAQs

Package last updated on 29 Jan 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts