India codes
This repository targets individuals in India who lack English proficiency and programming experience. The tools here allow writing and executing code solely in one's native language, eliminating the English language barrier. Our vision is to support all Indian languages and programming languages, enabling a diverse population to learn coding without linguistic constraints.
Features
- Translate & Transliterate individual code snippets or entire script files
- Support for multiple programming languages
- Support for multiple natural languages
- Currently supported languages:
- Programming languages
- Natural languages
Approach
Every language has their own set of keywords. All (major) programming languages have these keywords in English. Some programming languages (Python, Javascript, Rust) support unicode, and some (C, C++) don't.
Version 1 :
- User writes the entire code in their native language.
- The language supports unicode identifiers.
- One-to-one mapping for English keywords with native language keywords.
- The programming language keywords from the user code will be replaced to actual English keywords in the translated version.
- The identifiers in native language written by the user will also be transliterated in the translated version.
- The transliterations are returned in English (not in latinized english). This is done to support all languages, even the ones which do not support unicode identifiers.
- The exact opposite actions (English -> native language) happen when chosen to detransliterate.
- The translated and transliterated code are executable.
Version 2 (Next):
- Using Abstract Syntax Trees to make the syntax more sensible in native languages.
Usage
- Open the file in VS Code.
- Evoke Command Palette
⇧⌘P
.
- Supported commands:
- Posterior Python
nat_lang
to English
- If not available, creates two new files:
_lang.{ext}
and _eng.{ext}
- Posterior Python
English
to nat_lang
(It assumes filename to consist "_eng".)
- If not available, creates two new files:
_lang.{ext}
and .{ext}
- Posterior Preview
prog_lang
nat_lang
- It previews the transliterated code to the right. Live Preview.
- Supported
nat_lang
: Hindi
, Telugu
- Supported
prog_lang
: Python
- Supported
ext
: py
Posterior Python Hindi to English
& Posterior Python English to Hindi
Posterior Preview Python Hindi
Posterior Python Telugu to English
& Posterior Python English to Telugu
Posterior Preview Python Telugu
Example
Python code in native language.
చెల్లు = 5
సందర్భం = నిజము
ఐతే సందర్భం:
ముద్రించు("చెల్లు:", చెల్లు)
ముద్రించు("సందర్భం:", సందర్భం)
లేదా:
ముద్రించు("అబద్ధం: తప్పు")
సంఖ్యలు = [1, 2, 3, 4, 5]
మొత్తం = 0
ప్రతి సంఖ్య లో సంఖ్యలు:
మొత్తం += సంఖ్య
ముద్రించు("సంఖ్యల మొత్తం:", మొత్తం)
కౌంట్ = 10
ప్రతి సంఖ్య లో శ్రేణి(కౌంట్):
ముద్రించు(కౌంట్)
కౌంట్ += 1
वर्ग मेरी_कक्षा:
संदेश = "यह एक कक्षा है"
परिभाषा मुद्र_संदेश(खुद):
मुद्र(खुद.संदेश)
पथ = "/कक्षा/उदाहरण/पथ/फ़ाइल.टेक्स्ट"
प्रयास:
साथ खोलें(पथ) जैसा फ़ाइल:
चले
अपवाद:
मुद्र("फ़ाइल नहीं मिली")
Translated code.
చెల్లు = 5
సందర్భం = True
if సందర్భం:
print("చెల్లు:", చెల్లు)
print("సందర్భం:", సందర్భం)
else:
print("అబద్ధం: తప్పు")
సంఖ్యలు = [1, 2, 3, 4, 5]
మొత్తం = 0
for సంఖ్య in సంఖ్యలు:
మొత్తం += సంఖ్య
print("సంఖ్యల మొత్తం:", మొత్తం)
కౌంట్ = 10
for సంఖ్య in range(కౌంట్):
print(కౌంట్)
కౌంట్ += 1
class मेरी_कक्षा:
संदेश = "यह एक कक्षा है"
def print_संदेश(self):
print(self.संदेश)
पथ = "/कक्षा/उदाहरण/पथ/फ़ाइल.टेक्स्ट"
try:
with open(पथ) as फ़ाइल:
pass
except:
print("फ़ाइल नहीं मिली")
Transliterated code.
cellu = 5
saMdarbhaM = True
if saMdarbhaM:
print("cellu:", cellu)
print("saMdarbhaM:", saMdarbhaM)
else:
print("abaddhaM: tappu")
saMkhyalu = [1, 2, 3, 4, 5]
mottaM = 0
for saMkhya in saMkhyalu:
mottaM += saMkhya
print("saMkhyala mottaM:", mottaM)
kauMT = 10
for saMkhya in range(kauMT):
print(kauMT)
kauMT += 1
class merI_kakshA:
saMdeSa = "yaha eka kakshA hai"
def print_saMdeSa(self):
print(self.saMdeSa)
patha = "/kakshA/udAharaNa/patha/fAila.TeksTa"
try:
with open(patha) as fAila:
pass
except:
print("fAila nahIM milI")