0.3.1 • Published 3 years ago

translate-nonsense v0.3.1

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

Translate Nonsense

This is a package that can automatically translate text through many different random languages, and then back to English.

It uses the package google-translate-free as a dependency to achieve this.

Install

npm i translate-nonsense

Usage

translateNonsense

This is the main function, translate the specified string through many languages and back to English.

// translate the text "Hello, I like cheese" through 10 different languages

const translateNonsense = require("translate-nonsense")

translateNonsense("Hello, I like cheese", 10)
	.then(res=>console.log(res))

// example output: "Hey, I am cheese"

Details

translateNonsense(text, iterations, [finalLanguage])
text

Type: string

The text to be translated and made into nonsense.

iterations

Type: integer

How many random languages to translate the text through.

finalLanguage (optional)

Type: string

The key of the language to give the final translation in.
If not provided, defaults to english (en). The different language keys can be found by running translateNonsense.getLangs() or here

translateNonsense.getLangs

This returns an object containing all the used languages.

// get an object containing all the used languages, and print it to the console

const translateNonsense = require("translate-nonsense")

const langs = translateNonsense.getLangs()

console.log(langs)

// example output: "Hey, I am cheese"
0.3.1

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago