@ablanc/translator

Node.js translator using puppeteer to scrape deepl.

Usage no npm install needed!

<script type="module">
  import ablancTranslator from 'https://cdn.skypack.dev/@ablanc/translator';
</script>

README


Logo

Translator

A node.js package to translate JSON files.

Table of Contents

About The Project

[Product Name Screen Shot]

Translator allows you to translate a JSON file and more specifically an array of values. Your JSON file must contain either an array of strings or an array of objects that you want to translate.

This project scrape https://www.deepl.com/fr/translator website to bypass it's pro API limitation. All deepl languages are available aswell as auto detection as input language.

You can either get the result of the translation printed out in the console or as a JSON file.

Built With

Installation

You can download it globally using

npm install -g @ablanc/translator

or add it as a devlopment dependency

npm install --save-dev @ablanc/translator

# or with yarn
yarn add -D @ablanc/translator

Usage

To use it type this in your terminal:

Usage: translator [options]

Options:
  -i, --input <input>                                 json file to process
  -o, --output <console|path-to-file>                 output display
  -li, --lang-input <lang_input>                      en | fr | de | es | pt | it | nl | pl | ru
  -lo, --lang-output <lang_output>                    en-US | fr-FR | de-DE | es-ES | pt-PT | it-IT | nl-NL | pl-PL | ru-RU
  -pt, --properties-to-translate <property,property>  specify your object properties you want to translate, separated by ,
  -skid --skip-until-id <id>                          it will start translating your objects from id
  -int, --interactive                                 interactive mode
  -h, --help                                          display help for command

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.