- ✅ Core Idea:
- 🧠 Basic Example
- 🔧 System Architecture
- 🛠️ Tools & Technologies that we can Use
- 🏗️ Step-by-Step Implementation Plan
- 🌍 Multilingual Support
⚠️ Key Challenges- ✅ MVP Features
- 🧪 Simple Proof-of-Concept Code
- 🔐 Contribution & Branch Protection Policy
Let users write code in their native language, and then translate it into real code (like Python, Java, etc.) that can be executed.
Let’s say someone writes this in Hindi:
यदि x > 10 तब:
प्रिंट("बड़ा है")
अन्यथा:
प्रिंट("छोटा है")
This would be translated to:
if x > 10:
print("बड़ा है")
else:
print("छोटा है")- Input Parser (in native language)
Reads code written in a user's language. - Translator / Mapper
Maps native keywords to equivalent programming keywords. - Code Generator
Outputs valid Python/Java/etc. code. - Interpreter/Executor
Runs the translated code and returns the output.
| Task | Tools |
|---|---|
| Language Parsing | ANTLR, Lark, PLY, regex |
| Translation | Custom dictionary / NLP |
| Execution | exec() in Python, JVM for Java |
| Frontend (optional) | Web-based editor with native script support |
| Backend | Python or Java-based translator engine |
- Define what keywords people can use in their language (Hindi, Tamil, etc.)
- Example:
यदि→ifतब→:प्रिंट→print
Use a dictionary or rule-based approach to convert native-language code into Python.
native_to_python = {
"यदि": "if",
"तब": ":",
"प्रिंट": "print",
"अन्यथा": "else"
}Translate line by line using replacements.
Use regex to identify parts of the syntax:
यदि x > 5 तब:→if x > 5:जबतक i < 10:→while i < 10:
Use Python's exec() safely (with caution).
translated_code = translate(hindi_code)
exec(translated_code)Make a web app or desktop app with:
- Text area for native code input
- Display translated Python
- Show execution result/output
To support multiple Indian languages:
- Create language packs (Hindi, Tamil, Kannada, etc.)
- Define translation dictionaries for each
- Choose language at the start or auto-detect
- Ambiguity in natural language
- Managing indentation, syntax errors
- Handling different scripts (Devanagari, Tamil, etc.)
- Security in execution (
exec()is dangerous without sandboxing)
| Feature | Description |
|---|---|
| 🈶 Native language code input | Code written in Hindi or other language |
| 🔁 Translator | Maps native words to Python |
| ⚙️ Executor | Runs the translated code |
| 🖥️ Web Interface | Optional for ease of access |
def translate(hindi_code):
dictionary = {
"यदि": "if",
"तब": ":",
"प्रिंट": "print",
"अन्यथा": "else"
}
for hindi, python in dictionary.items():
hindi_code = hindi_code.replace(hindi, python)
return hindi_code
user_code = """
यदि x > 5 तब:
प्रिंट("बड़ा")
अन्यथा:
प्रिंट("छोटा")
"""
x = 7
exec(translate(user_code))💡 Note: For more details and step-by-step instructions for contributing, refer CONTRIBUTING page.
To maintain a high-quality and collaborative codebase, the main branch of this repository is protected. Please follow the simple workflow below when contributing:
- Create a new branch from
main. Make your contributions in that branch. - Push your changes to your branch.
- Open a Pull Request (PR) targeting
main. - Your PR must:
- ✅ Receive at least 1 code review approval. Feel free to request the collaborators for the review.
- 🚫 Not be merged by the same person who made the last commit to
main
- Once approved, another contributor (not the last committer) would soon merge the PR.
The collaborators would try their best to review and resolve the contribution as soon as possible.
Feel free to reach out to the collaborators for any queries.
- Ensures peer review for better code quality.
- Prevents accidental or unilateral changes to the main branch.
- Encourages shared responsibility and collaboration.
💡 Note: PRs that do not follow this process will be blocked automatically by GitHub branch protection rules.
