Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aws-sdk/client-translate

Package Overview
Dependencies
Maintainers
5
Versions
424
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-translate

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

  • 3.712.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created

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 13 Dec 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc