$ npm i -g translingual
Via bash:
$ trans 'Hello world!' en ru
# "Эллoу Вoурлд!"
As code:
const trans = require('translingual');
var result = trans.ling('Hello world!', 'en', 'ru');
console.log(result); // This will print: "Эллoу Вoурлд!"
Using vanilla JS in your browser:
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/translingual@1.1.7/dist/translingual.min.js"></script>
<script type="text/javascript">
var result = Trans.ling('Hello world!', 'en', 'ru');
console.log(result); // This will print: "Эллoу Вoурлд!"
</script>
Or even, using Docker:
$ docker run --rm evgy/translingual 'Hello world!' en ru
This small and cool module can phonatically visualize a sentence from one language to another. For this I use transcription. I translate a sentence from any of the supported original languages to transcription, and from that I form back a sentence on any currently supported language.
NOTE: Semitic languages like Hebrew and Arabic are really problematic to translate into transcription without vowelizations.
Language | Source |
---|---|
"en" - English | English orthography |
"ru" - Russian | Russian alphabet |
"es" - Spanish | Spanish orthography |
"de" - German | German orthography |
"el" - Greek | Greek orthography |
"sr" - Serbian | Serbian Cyrillic alphabet |
"fr" - French | French orthography |
"uk" - Ukrainian | Ukrainian alphabet |
"he" - Hebrew | Hebrew spelling (only "to" - can't read, can only write) |
"trans" - Transcription | IPA |
- Add more languages.
APACHE-2.0 (see the LICENSE files in the repository).
Have fun and if you like it, leave a tip for a cup of beer or directly donate to our cause