-
-
Notifications
You must be signed in to change notification settings - Fork 33
feat: Add multilingual support for image generation (en, hin, marathi) #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Add multilingual support for image generation (en, hin, marathi) #143
Conversation
|
@Diksha78-bot is attempting to deploy a commit to the vansh-codes1's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements multilingual support for GitHub profile image generation, allowing users to specify a language for stat labels using a lang query parameter. The feature supports English, Hindi, and Marathi with automatic fallback to English for unsupported languages.
- Adds a type-safe translation system with support for three languages (en, hin, marathi)
- Integrates language parameter extraction and validation in the API route
- Updates SVG rendering to use translated labels based on the specified language
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/libs/translations.ts | Core translation module providing translation mappings and utility functions |
| src/components/RenderSVG.jsx | Updated to use translated labels from the translation module |
| src/app/api/image/route.jsx | Extracts and validates the language query parameter |
| test-translations.js | Standalone test runner with comprehensive test coverage |
| src/libs/translations.test.ts | TypeScript test file for the translation module |
| src/app/test-multilingual/page.jsx | Visual test page demonstrating multilingual support |
| package-lock.json | Package dependency updates (removed dev-only flags) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * To run these tests, execute them in Node.js with the translation module | ||
| * This demonstrates how the translation functions work |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states these tests should be run in Node.js, but the file imports from '@/libs/translations' which is a TypeScript path alias that requires a bundler/transpiler. This documentation is misleading as the tests won't run directly in Node.js without additional tooling.
| * To run these tests, execute them in Node.js with the translation module | |
| * This demonstrates how the translation functions work | |
| * To run these tests, you must use Node.js with additional tooling (such as a bundler, transpiler, or runtime configuration) | |
| * that supports TypeScript path aliases (e.g., '@/libs/translations'). Otherwise, the imports will not resolve. | |
| * This demonstrates how the translation functions work. |
|
@Diksha78-bot Good work! But the aim was to automate it using some library or api & not doing it manually! |
Sure, I'll do those changes using libraries. |
|
@Diksha78-bot Are you still working on it? any updates from your side? |
Sorry for late reply. |
|
@Diksha78-bot Any progress on this? |
🌍 Description
Implements multilingual support for GitHub profile image generation. Users can now specify the language for stat labels using the
langquery parameter.✨ Features
📁 Changes
New Files:
src/libs/translations.ts- Core translation module with language supporttest-translations.js- Comprehensive test suite (42 tests, all passing)src/app/test-multilingual/page.jsx- Visual test page with examplessrc/libs/translations.test.ts- Jest test examplesModified Files:
src/app/api/image/route.jsx- Extract and validate lang parametersrc/components/RenderSVG.jsx- Use translated stat labels📊 Translation Mappings
🧪 Testing
✅ Quality Assurance
Closes #21