This little piece of code lets you write python code in any language you deem fit. This is meant as a tool to teach people programming without having to teach them English first.
Python3.x is supported.
The basic python language is translated and ready for offline use. You can add your own languages. Non standard libraries are not yet supported.
There is an article for this on my blog.
This is a simple transliteration program. The idea is as follows.
git clone https://github.com/theSage21/pytongue.git cd pytongue git submodule init git submodule update
In order to train a new language use the Wikipedia list of ISO-codes
The codes must be supported by Google Translate
Get new languages by:
lang_codemust be supported by translate.google.com
lang_codemust be specified in the source file
./pytongue.sh my_code.pyinstead of
If you were to write a useless example in Hindi it might be something like this.
# HI छाप('नमस्ते दुनिया!') के_लिए i में range(10): छाप(i) जबकि 1: छाप('नमस्ते दुनिया!')
This translates to
# HI print('Hello world!') for i in range(10): print(i) while 1: print('Hello World!')
To generate examples in other languages:
To generate a different example edit the
If the translation provided by Google feels wrong there is nothing to worry about. Since the translation is actually implemented using a dictionary, all you have to do is change the key-value pairs.
That is to automate the process of translation mapping. Translating a lot of words gets tiring very quickly.
You can create your own mapping if you want in any language you want.