Languages

Node.js - translate text from one language to another

3 points
Asked by:
Diana
720

What is the easiest way to translate some text from one language to another using Node.js?

2 answers
3 points
Answered by:
Admin Dirask Community
4380

You can use translate package to do so.

Practical example

1. Install translate package.

2. Create a function that translates text passed as the first argument to the language of your choice.

Result:

Note:

By default, from option is set to english, so you can simply use:

 

References

  1. translate - npm
0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join