@shamigondal/ai-translator

1.0.6 • Public • Published

Introduction

A lightWeighted npm package for AI-based translation.

Usage

const { translator } = require('@shamigondal/ai-translator');

// Example usage
const textToTranslate = 'Hello, how are you?';
const targetLanguage = 'es'; // Replace with the target language code (e.g., 'es' for Spanish)

translator(textToTranslate, targetLanguage)
  .then((translatedText) => {
    console.log(`Original: ${textToTranslate}`);
    console.log(`Translated: ${translatedText}`);
  })
  .catch((error) => {
    console.error('Translation error:', error.message);
  });

Features

  • Light/dark mode toggle
  • Live previews
  • Fullscreen mode
  • Cross platform

Deployment

To deploy this project run install node

  npm i nodemon

.then type this command in command prompt

  nodemon .\app.js

Documentation

  • Make sure to replace 'es' with the desired language code. You can find language codes in the ISO 639-1 standard.

  • translate(text, targetLanguage)

  • Translate the input text to the specified target language.

  • text (string): The text to be translated.

  • targetLanguage (string): The language code of the target language.

  • Returns a Promise that resolves to the translated text.

License

MIT

Authors

Readme

Keywords

Package Sidebar

Install

npm i @shamigondal/ai-translator

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

6.75 kB

Total Files

4

Last publish

Collaborators

  • shamigondal