An unofficial Node package to translate text using DeepL by porting OwO-Network/DeepLX.
https://deeplx.vercel.app/translate
# npm
npm i deeplx
# pnpm
pnpm add deeplx
# yarn
yarn add deeplx
# or install `@deeplx/core` for only API usage, or install `@deeplx/cli` for only CLI usage
Currently the following languages are supported:
Abbreviation | Language | Writing in own language |
---|---|---|
BG | Bulgarian | Български |
ZH | Chinese | 中文 |
CS | Czech | Česky |
DA | Danish | Dansk |
NL | Dutch | Nederlands |
EN | English | English |
ET | Estonian | Eesti |
FI | Finnish | Suomi |
FR | French | Français |
DE | German | Deutsch |
EL | Greek | Ελληνικά |
HU | Hungarian | Magyar |
IT | Italian | Italiano |
JA | Japanese | 日本語 |
LV | Latvian | Latviešu |
LT | Lithuanian | Lietuvių |
PL | Polish | Polski |
PT | Portuguese | Português |
RO | Romanian | Română |
RU | Russian | Русский |
SK | Slovak | Slovenčina |
SL | Slovenian | Slovenščina |
ES | Spanish | Español |
SV | Swedish | Svenska |
UK | Ukrainian | Українська Мова |
You can either input the abbreviation or the language written in english.
deeplx -h
Usage: deeplx [options]
The cli for [`@deeplx/core`](https://github.com/un-ts/deeplx/blob/master/packages/@deeplx/core).
Options:
-V, --version output the version number
-s, --source <text> Source language of your text
-t, --target <text> Target language of your desired text
--text <text> Text to be translated
-f, --file <path> File to be translated
--formal [boolean] Whether to use formal (true) or informal (false) tone in translation. Default `undefined` respects source text tone.
--no-formal
-h, --help display help for command
This will translate a Spanish (ES
) text into Russian (RU
):
deeplx -t russian --text "¡Buenos días!"
Доброе утро!
This will translate the file (test.txt
) text from Italian (IT
) into Portuguese (PT
):
deeplx -t PT -f test.txt
This will translate a Spanish (ES
) text into Russian (RU
) in formal tone:
deeplx -t RU --text "¿Cómo te llamas?" --formal
Как Вас зовут?
Note: informal would be "Как тебя зовут?"
This will translate a Japanese (JA
) text into German (DE
) in informal tone:
deeplx -t DE --text "お元気ですか?" --no-formal
Wie geht es dir?
Note: formal would be "Wie geht es Ihnen?"
This will translate a Chinese (ZH
) text into Dutch (NL
):
import { translate } from 'deeplx'
await translate('你好', 'NL')
'Hallo'
This will translate a danish
text into german
in informal tone:
import { translate } from 'deeplx'
await translate('Ring til mig!', 'german', 'danish', false)
'Ruf mich an!'
1stG | RxTS | UnTS |
---|---|---|
1stG | RxTS | UnTS |
---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.