Welcome to Unelma-Code Translator, an open-source tool that uses AI to translate code between programming languages. Whether you're porting a Python script to JavaScript, adapting C++ to Java, or exploring a new language, this project aims to save you time and effort with smart, context-aware translations. Built by Unelma Platforms, it's free, collaborative, and ready for your input!
- AI-Powered: Goes beyond syntax—understands logic and intent.
- Multi-Language: Supports a growing list of languages (Python, Java, C++, JS, COBOL, and more).
- API Access: Built-in REST API for programmatic access.
- Open-Source: Free to use, modify, and improve under the MIT License.
Try it online at translate.u16p.com or dive into the code right here!
Unelma Code Translate provides a comprehensive REST API for programmatic access to code translation capabilities. The API is versioned and follows RESTful principles.
- Production:
https://translate.u16p.com
- Development:
http://localhost:3000
(when running locally)
Some endpoints require authentication using an API key:
Authorization: Bearer YOUR_API_KEY
Explore the API interactively using our Swagger UI:
Check if the API is running.
GET /api/v1/health
Response:
{
"status": "ok",
"timestamp": "2025-06-05T07:45:00.000Z"
}
Get a list of all supported language pairs for translation.
GET /api/v1/translate
Response:
{
"languages": [
"python",
"javascript",
"typescript",
"java"
]
}
Translate code between supported programming languages.
POST /api/v1/translate
Request Body:
{
"source_code": "def hello():\n print('Hello, World!')",
"from_lang": "python",
"to_lang": "javascript"
}
Response:
{
"source_code": "def hello():\n print('Hello, World!')",
"from_lang": "python",
"to_lang": "javascript",
"translated_code": "function hello() {\n console.log('Hello, World!');\n}"
}
This is the legacy endpoint for backward compatibility.
POST /api/translate
Request Body:
{
"inputLanguage": "python",
"outputLanguage": "javascript",
"inputCode": "def hello():\n print('Hello, World!')",
"model": "gpt-4",
"apiKey": "your_openai_api_key_here"
}
{
"error": "Missing required fields: source_code, from_lang, to_lang"
}
{
"error": "Invalid or missing API key"
}
{
"error": "Endpoint not found"
}
{
"error": "An error occurred while processing your request"
}
- Public API: 60 requests per minute per IP address
- Authenticated API: 1000 requests per minute per API key
Set up webhooks to receive notifications about translation events. Contact support for more information.
For API support, please contact info@unelmaplatforms.com.
-
Clone the repository:
git clone https://github.com/unelmacoin/unelma-code-translate.git cd unelma-code-translate
-
Install dependencies:
npm install
-
Create a
.env.local
file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_key_here
-
Start the development server:
npm run dev
-
The API will be available at
http://localhost:3000/api/v1
- Visit translate.u16p.com.
- Paste your code, select the source and target languages, and hit "Translate."
- Done!
- Clone the repo:
git clone https://github.com/unelmacoin/unelma-code-translate.git
- Follow the Installation steps below.
- Launch and start translating!
Prerequisites
Node.js (v16+ recommended)
Python (v3.8+ for AI components)
Git
Steps
- Clone the repository:
git clone https://github.com/unelmacoin/unelma-code-translate.git
cd unelma-code-translate
- Install dependencies:
npm install
- Run the application:
npm start
- Open localhost:3000 in your browser
Python to JavaScript
Input (Python):
def greet(name):
return f"Hello, {name}!"
print(greet("World"))
Output (JavaScript):
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
Experiment with your own code at translate.u16p.com!
We’d love your help to make Unelma-Code Translator better! Here’s how to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-idea
- Make your changes and commit:
git commit -m "Add feature: your-idea"
- Push to your fork:
git push origin feature/your-idea
- Open a Pull Request—we’ll review it ASAP!
Twitter: Follow Unelma Platforms for updates. Facebook: Join us at facebook.com/unelmaplatforms. Support: DM us on socials or open an issue here.
This project is licensed under the MIT License—feel free to use, modify, and share it!
Built with ❤️ by the Unelma Platforms team. Special thanks to our contributors and the open-source community!