Polyglot

The script translates text into other languages from stdin (via pipe), from a file, or from script arguments. Fast, easy to use, free to use.

release date: 2025-09-11

GitHub - GO
GitHub - Python
GitHub - PHP
GitHub - Bash

about

Polyglot is a program/script released by me in several languages (each with different execution time, compatibility, and simplicity of dependency installation), whose purpose is to translate text in the terminal.

It is characterized by high speed, compatibility, and ease of use - just type a command through a pipe to capture and translate the text from the stdout of the previous command! It is that simple.

The program/script is written in GO, PHP, Python, and Bash. The GO script better checks the network connection status and the response of the translation endpoint; PHP is very fast but requires PHP installation; Python is similar - characterized by flexibility and speed; and Bash is the slowest, but requires almost no additional installations - it is wonderfully lightweight.

features

The first and most important feature to highlight is the ability of the script to translate text from stdin. What does that mean? It means you can very easily translate the output of another command through a pipe. Below is a quick and simple demonstration of this functionality.

In addition, Polyglot can translate text from a file as well as from a command line argument. Simply use the -h option to learn more.

There is also a parameter that allows you to declare the input language of the text, however by default detection is automatic and works quite well.

The most important and required parameter in every configuration is the -t parameter, which is used to choose the target language in which the output will be displayed.

compatibility

Polyglot does not require much configuration or dependencies. Each version works on modern Linux, MacOS, and Windows terminals. The appropriate runtime environment is required for the chosen script version - GO runtime, Python, PHP, or Bash. Bash additionally requires curl and jq. The rest are built-in and environment options.