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

```bash
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:

```python
import helptranslator
helptranslator.set_help_lang('german')
```

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

```python
import helptranslator
helptranslator.set_help_lang('german')

help(sum)
>> 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:

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

help(sum)
>> Hilfe zur eingebauten Funktionssumme in den eingebauten Modulen:

帮助内置函数总和模块builtins:

sum(iterable,start = 0,/)
    返回“开始”值(默认值:0)加上可迭代的数字的总和
    
    当迭代器为空时,返回起始值。
    此功能专门用于数字值和可能
    拒绝非数字类型。

```

Or Russian:

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

help(sum)
>> Справка по встроенной функции 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.

Source Distribution

helptranslator-0.0.1.linux-x86_64.tar.gz (3.5 kB view details)

Uploaded Source

Built Distributions

helptranslator-0.0.1-py3.6.egg (4.0 kB view details)

Uploaded Source

helptranslator-0.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file helptranslator-0.0.1.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for helptranslator-0.0.1.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 af86a73596f590d4c42f9579fd1d969aa74e007e8aad6387fbaff69190465566
MD5 701f53f334a53454345e7b067bbcffe2
BLAKE2b-256 944afb0c82dd2bb9751942c02a85f4f62ad2127d188cf8e52e17c5a275c2601e

See more details on using hashes here.

File details

Details for the file helptranslator-0.0.1-py3.6.egg.

File metadata

File hashes

Hashes for helptranslator-0.0.1-py3.6.egg
Algorithm Hash digest
SHA256 11b38b8ba58d53912bebc14682b5ca76dda262f058b9b914b95b86d2056e6da5
MD5 0e4c7421e7642c28259f41b4771cc58e
BLAKE2b-256 34384bdb3d5bfaca7929df3d241463a0cc6c7d68f42a052028888ef8e85d6ae0

See more details on using hashes here.

File details

Details for the file helptranslator-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for helptranslator-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e23bc87a1f412ab6af79b10df1b3b88dc8f67dbe613b64f1206206af982eec40
MD5 d02446c32e4fb24c17a360a2109ff7a7
BLAKE2b-256 e2288ecaf27dfb1ac2522f1553485e0d9a9111a4bb5ca4f4d121c135acabbf76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page