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
-
Sign up for DeepL's API DeepL
-
Go to your account and copy Authentication Key for DeepL API.
-
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
-
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).
-
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);