Skip to main content

A Python module that uses Google Translate to automatically translate Python help text to any language.

Project description

# helptranslator: help() for everyone.

This is an experimental python package that translates Python's **help()** text
to any language using Google Translate!

Why? Because learning Python shouldn't require fluency in English, and the help() function
is the most language-intensive part of the early programming language learning experience.
Plus, Python 3 fully supports Unicode, so why not?

## Installation

pip install helptranslator

## Example

Calling the **set_help_lang()** function overrides the built-in **help()** function,
so working with helptranslator is essentially a two-liner:

import helptranslator

That's it! Let's change the help text to German and look at the sum() function:

import helptranslator

>> Hilfe zur eingebauten Funktionssumme in den eingebauten Modulen:

Summe (iterierbar, Start = 0, /)
    Gibt die Summe eines "Start" -Werts (Standard: 0) plus einer Anzahl von Zahlen zurück
    Wenn das iterable leer ist, geben Sie den Startwert zurück.
    Diese Funktion ist speziell für die Verwendung mit numerischen Werten und möglicherweise vorgesehen
    lehnen Sie nicht-numerische Typen ab.


Or Chinese:

import helptranslator
helptranslator.set_help_lang('chinese (simplified)')

>> Hilfe zur eingebauten Funktionssumme in den eingebauten Modulen:


sum(iterable,start = 0,/)


Or Russian:

import helptranslator

>> Справка по встроенной функции sum в встроенных модулях:

sum (iterable, start = 0, /)
    Возвращает сумму значения «start» (по умолчанию: 0) плюс итерабельность чисел
    Когда итерабельность пуста, верните начальное значение.
    Эта функция предназначена специально для использования с числовыми значениями и может
    отклонять нечисловые типы.

## Todos

Well, clearly this is a limited approach. It requires an internet connection, long
texts fail in their connections, and I haven't added IPython support yet. The last
two can be fixed pretty easily (if you are interested in having this, let me know!) but
the first requires a more thoughtful approach. Personally, I'm imagining some kind of
stub file that package developers can create for their packages.

Hopefully, this is useful, and generates some conversation about increasing programming
education around the world!

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for helptranslator, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size helptranslator-0.0.2-py3-none-any.whl (6.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size helptranslator-0.0.2.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page