@indepthwebsolutions/translate

1.0.5 • Public • Published

AI Translation for Node

Usage

This is package for node. It uses DeepL AI to translate source language into target language.

You need to make a registration and get a token from DeepL to run this package.

We will go through all steps in the installation process.

Installation

NPM

  npm i @indepthwebsolutions/translate

YARN

  yarn add @indepthwebsolutions/translate
  1. Sign up for DeepL's API DeepL

  2. Go to your account and copy Authentication Key for DeepL API.

  3. In your .env file add DEEP_L_API_ADDRESS and DEEP_L_API_AUTH_KEY.

  DEEP_L_API_ADDRESS=https://api-free.deepl.com/v2/translate
  DEEP_L_API_AUTH_KEY=your_key
  1. Use your key as a value to DEEP_L_API_AUTH_KEY and use the correct api address (there is a free and premium address - look at their docs).

  2. Send text to your API using POST request with the following properties: text, source_lang, target_lang.

text and target_lang and mandatory. If you skip source_lang, the source language will be detected automatically.

Usage

  import zazaDescriptionValidation from '@indepthwebsolutions/zaza-description-validation';

  const translateResponse = await translate(req.body);

Readme

Keywords

none

Package Sidebar

Install

npm i @indepthwebsolutions/translate

Weekly Downloads

9

Version

1.0.5

License

MIT

Unpacked Size

2.52 kB

Total Files

3

Last publish

Collaborators

  • entrpyc