Console-Translate 0.2.3

dotnet add package Console-Translate --version 0.2.3                
NuGet\Install-Package Console-Translate -Version 0.2.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Console-Translate" Version="0.2.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Console-Translate --version 0.2.3                
#r "nuget: Console-Translate, 0.2.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Console-Translate as a Cake Addin
#addin nuget:?package=Console-Translate&version=0.2.3

// Install Console-Translate as a Cake Tool
#tool nuget:?package=Console-Translate&version=0.2.3                

GitHub Release NuGet Version GitHub top language GitHub License

PowerShell module for translating text directly in the console PowerShell.

💡 About

The module can be very useful if you spend a lot of time in the console or don't want to keep a third-party application open.

Used providers:

The work of the module is automated and free of charge, no additional intervention in the work of the module is required from you.

The process of language definition for the LanguageSource and LanguageTarget parameters is automated between Russian and English. This process can be automated for all languages.

Tested on Windows 10, Ubuntu Server 20.04 and 22.04 using PowerShell Core version 7.2 +.

🚀 Install module to Windows

Use the NuGet package manager:

Install-Module Console-Translate -Repository NuGet

💡 You must have a NuGet repository registered:

Register-PSRepository -Name "NuGet" -SourceLocation "" -InstallationPolicy Trusted

Or install a module from the GitHub repository (including dependencies, DeepLX binary) with a single command in the console:

Invoke-Expression(New-Object Net.WebClient).DownloadString("")

Import the module:

> Import-Module Console-Translate
> Get-Command -Module Console-Translate

CommandType     Name                  Version    Source
-----------     ----                  -------    ------
Function        Get-DeepLX            0.2        Console-Translate
Function        Get-LanguageCode      0.2        Console-Translate
Function        Get-Translate         0.2        Console-Translate
Function        Start-DeepLX          0.2        Console-Translate
Function        Stop-DeepLX           0.2        Console-Translate

🐧 Install module to Linux

Dependence: PowerShell Core

Example install to Ubuntu:

sudo apt-get install -y wget apt-transport-https software-properties-common
curl -s$(lsb_release -rs)/packages-microsoft-prod.deb -o packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y powershell

Install module:

pwsh -c 'Invoke-Expression(New-Object Net.WebClient).DownloadString("")'

Enter in to the PowerShell Core interpreter (pwsh) and import the module:

root@hv-devops-01:/home/lifailon# pwsh
PowerShell 7.4.1
PS /home/lifailon> Import-Module Console-Translate

All commands for Windows are identical for execution in Linux on PowerShell Core (pwsh).

🎉 Examples

Image alt

You can see in the right corner how long each translation request takes (this does not depend on the amount of text being transferred).

Module Get-Translate

To translate using Google Translate, a public API key has been added to the module (default for the parameter: -Key). To use your DeepL key, you must register on the provider website, create free token and specify it in the parameter: -Key.

> Get-Translate "Module for text translation"
Модуль для перевода текста

> Get-Translate "Модуль для перевода текста"
Text translation module

> Get-Translate "Привет world" -LanguageSelected
Language Source: RU
Language Target: EN
Hello world

> Get-Translate "Hello друг" -LanguageSelected
Language Source: EN
Language Target: RU
Привет друг

> Get-Translate -Text "Модуль для перевода текста" -LanguageSource ru -LanguageTarget tr # Russian -> Turkish
Metin çeviri modülü

> Get-Translate -Provider MyMemory -Text "MyMemory is the world's largest Translation Memory. It has been created collecting TMs from the European Union and United Nations, and aligning the best domain-specific multilingual websites."
MyMemory - крупнейшая в мире память переводов. Он был создан для сбора ТМ из Европейского Союза и Организации Объединенных Наций и согласования лучших многоязычных веб-сайтов, ориентированных на конкретные области.

> Get-Translate -Provider MyMemory -Text "Hello World" -Alternatives
Привет мир!
Всем привет!


Project source: DeepLX

The following cmdlets are used to start and access the DeepLX server:


Local server

When calling the module, if the remote server address is not specified (parameter: Server), the local server is started for the time of sending a request and receiving a response, after which the server stops, it allows not to keep resources and socket open.

> Get-DeepLX "Get select" de
Auswahl treffen

> Get-DeepLX "Get select" ru
Получить выбор

> Get-DeepLX "Получить выбор" en
Get Choice

> Get-DeepLX "Получить выбор" en -Alternatives
Get a choice
Get the choice
Get your choice

Remote server

If you need to use a single server to handle all requests from multiple clients on the network, you can use this construct:

📭 Start the server:

> Start-DeepLX -Job
> Start-DeepLX -Status

✉️ Execute a requests to the remote server:

> Get-DeepLX -Server -Text "Module for text translation" ru
Модуль для перевода текста

Server stop:

> Stop-DeepLX
> Start-DeepLX -Status
Not running

📑 Getting language codes

Getting language codes standart ISO-639-1:

> Get-LanguageCode

Country                                             Code
-------                                             ----
Abkhaz                                              ab
Afar                                                aa
Afrikaans                                           af
Akan                                                ak
Albanian                                            sq
Amharic                                             am
Arabic                                              ar
Aragonese                                           an
Armenian                                            hy
Assamese                                            as
Avaric                                              av
Avestan                                             ae
Aymara                                              ay
Azerbaijani                                         az
Bambara                                             bm
Bashkir                                             ba
Basque                                              eu
Belarusian                                          be
Bengali, Bangla                                     bn
Bihari                                              bh
Bislama                                             bi
Bosnian                                             bs
Breton                                              br
Bulgarian                                           bg
Burmese                                             my
Catalan                                             ca
Chamorro                                            ch
Chechen                                             ce
Chichewa, Chewa, Nyanja                             ny
Chinese                                             zh
Chuvash                                             cv
Cornish                                             kw
Corsican                                            co
Cree                                                cr
Croatian                                            hr
Czech                                               cs
Danish                                              da
Divehi, Dhivehi, Maldivian                          dv
Dutch                                               nl
Dzongkha                                            dz
Eastern Punjabi, Eastern Panjabi                    pa
English                                             en
Esperanto                                           eo
Estonian                                            et
Ewe                                                 ee
Faroese                                             fo
Fijian                                              fj
Finnish                                             fi
French                                              fr
Fula, Fulah, Pulaar, Pular                          ff
Galician                                            gl
Ganda                                               lg
Georgian                                            ka
German                                              de
Greek                                               el
Guarani                                             gn
Gujarati                                            gu
Haitian, Haitian Creole                             ht
Hausa                                               ha
Hebrew                                              he
Herero                                              hz
Hindi                                               hi
Hiri Motu                                           ho
Hungarian                                           hu
Icelandic                                           is
Ido                                                 io
Igbo                                                ig
Indonesian                                          id
Interlingua                                         ia
Interlingue                                         ie
Inuktitut                                           iu
Inupiaq                                             ik
Irish                                               ga
Italian                                             it
Japanese                                            ja
Javanese                                            jv
Kalaallisut, Greenlandic                            kl
Kannada                                             kn
Kanuri                                              kr
Kashmiri                                            ks
Kazakh                                              kk
Khmer                                               km
Kikuyu, Gikuyu                                      ki
Kinyarwanda                                         rw
Kirundi                                             rn
Komi                                                kv
Kongo                                               kg
Korean                                              ko
Kurdish                                             ku
Kwanyama, Kuanyama                                  kj
Kyrgyz                                              ky
Lao                                                 lo
Latin                                               la
Latvian                                             lv
Limburgish, Limburgan, Limburger                    li
Lingala                                             ln
Lithuanian                                          lt
Luba-Katanga                                        lu
Luxembourgish, Letzeburgesch                        lb
Macedonian                                          mk
Malagasy                                            mg
Malay                                               ms
Malayalam                                           ml
Maltese                                             mt
Manx                                                gv
Marathi                                             mr
Marshallese                                         mh
Mongolian                                           mn
Maori                                               mi
Nauruan                                             na
Navajo, Navaho                                      nv
Ndonga                                              ng
Nepali                                              ne
Northern Ndebele                                    nd
Northern Sami                                       se
Norwegian                                           no
Norwegian Bokmal                                    nb
Norwegian Nynorsk                                   nn
Nuosu                                               ii
Occitan                                             oc
Ojibwe, Ojibwa                                      oj
Old Church Slavonic, Church Slavonic, Old Bulgarian cu
Oriya                                               or
Oromo                                               om
Ossetian, Ossetic                                   os
Pashto, Pushto                                      ps
Persian                                             fa
Polish                                              pl
Portuguese                                          pt
Pali                                                pi
Quechua                                             qu
Romanian                                            ro
Romansh                                             rm
Russian                                             ru
Samoan                                              sm
Sango                                               sg
Sanskrit                                            sa
Sardinian                                           sc
Scottish Gaelic, Gaelic                             gd
Serbian                                             sr
Shona                                               sn
Sindhi                                              sd
Sinhalese, Sinhala                                  si
Slovak                                              sk
Slovene                                             sl
Somali                                              so
Southern Ndebele                                    nr
Southern Sotho                                      st
Spanish                                             es
Sundanese                                           su
Swahili                                             sw
Swati                                               ss
Swedish                                             sv
Tagalog                                             tl
Tahitian                                            ty
Tajik                                               tg
Tamil                                               ta
Tatar                                               tt
Telugu                                              te
Thai                                                th
Tibetan Standard, Tibetan, Central                  bo
Tigrinya                                            ti
Tonga                                               to
Tsonga                                              ts
Tswana                                              tn
Turkish                                             tr
Turkmen                                             tk
Twi                                                 tw
Ukrainian                                           uk
Urdu                                                ur
Uyghur                                              ug
Uzbek                                               uz
Venda                                               ve
Vietnamese                                          vi
Volapuk                                             vo
Walloon                                             wa
Welsh                                               cy
Western Frisian                                     fy
Western Frisian                                     wo
Xhosa                                               xh
Yiddish                                             yi
Yoruba                                              yo
Zhuang, Chuang                                      za
Zulu                                                zu

📢 Module not using API

You can use a module that dont use an API, instead using Selenium to compose requests directly to the application:

Repository: Selenium-Modules

Module: Get-Translate

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.3 333 2/3/2024
0.2.2 146 2/3/2024