JC Translate Peek | Translate Without Breaking Your FlowRead and translate code snippets or documentation without losing focus in your editor.
Purpose and MotivationDuring daily programming and technical writing, there is a frequent need to translate words or sentences from English to Portuguese. Typically, this requires leaving VS Code to open a browser or an external tool, which breaks the reading flow and distracts from the current task. To address this problem, this project was created: to select a word or phrase and immediately view the translation alongside the original text without modifying the file. During development, several existing extensions were tested but did not meet the required usability. The initial implementation used the Google Translate API. While functional, it occasionally failed with HTTP 429 errors (Too Many Requests) due to the strict rate limits of the free public API. Consequently, a Fallback mechanism to OpenRouter was implemented. OpenRouter provides free LLM (AI) requests, ensuring service continuity and enabling context-aware translations. Features
Usage
How to Change the Target LanguageBy default, the extension translates text into Portuguese. If you need to translate to another language, follow these steps:
Example:
If you select "English", the next time you select a Portuguese text and press The extension will remember this choice globally, so you only need to set it once. Configuring the OpenRouter API KeyTo ensure the extension continues to function if Google blocks requests, configure your free OpenRouter API key:
Technical DocumentationFor details on architecture and security decisions, refer to the Roadmap (Future Implementations)The project is under active development. The next milestones include:
ContributingIssues and Pull Requests are welcome. The project uses GitHub Actions to automatically validate the code (TypeScript). LicenseDistributed under the MIT License. See LICENSE for more information. AuthorJacivaldo Carvalho Telecommunications Engineer | DevOps Engineer | SRE | Networking |