Project description

py-translate

A Translation Tool For Humans

Translate Lewis Carroll: Alice in Wonderland

The end goal is a simple application for translating text in the
terminal. Text can be generated interactively or programmatically in the
shell environment. Through command line arguments, file descriptors or
pipes generating translated output that can be piped to a file or
displayed on the terminal.

Features

Fast! Translate an entire book in less than 5 seconds.

Made for Python 3 but still works on Python 2

Fast and easy to install, easy to use

Supports translation from any language

Highly composable interface, the power of Unix pipes and filters.

Simple API and documentation

Installation

From PyPI with pip (easy)

$ pip install py-translate

From Source at Github

Clone the repository

$ git clone https://github.com/jjangsangy/py-translate.git

Install with setup.py

$ python setup.py install

Usage

translate [--flags] [source] dest

Arguments

Positional

dest

Destination language code

source

Source language code

Optional

-h,–help

Show this help message and exit

-v, –version

Show program’s version number and exit

-l,–list [code]

Enumerate the name of country and language code pair.

[ Optionally specify output language format ]

–translit

Print out the transliteration of the text

Examples

Hello World from English to Traditional Chinese

$ translate en zh-TW <<<'Hello World!'
你好世界！

Hello World

Just as easily specify a source language by providing it as first
argument

# Translate Hello from French to English
$ translate fr en <<<'Bonjour, comment allez-vous!'
Hello, how are you?

Smart Language Detection

Omitting the source language will try to detect it based on the text
content