translator-for-you

1.0.1 • Public • Published

translator-for-you

A simple npm package to translate words to the specified language using Google Translate API.

Installation

npm install translator-for-you

Usage

const translate = require('translator-for-you');

// Translate 'hello' to Hindi
translate('hello', 'hi')
  .then(result => console.log(result))
  .catch(err => console.log(err));

The translate function takes two arguments:

word: The word you want to translate. language: The language you want to translate to. You can use ISO 639-1 language codes.

The language argument should be in form of ISO 639-1 codes.
Few of language ISO codes are below in the table but if the language you want is not available then click here to view more

Language ISO 639-1
English en
Hindi hi
Arabic ar
Chinese (Simplified) zh-CN
Chinese (Traditional) zh-TW
Dutch nl
French fr
German de
Italian it
Japanese ja
Korean ko
Portuguese (Brazil) pt-BR
Russian ru
Spanish es
Turkish tr

Readme

Keywords

Package Sidebar

Install

npm i translator-for-you

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

2.82 kB

Total Files

5

Last publish

Collaborators

  • the_mohit_2003