gt.el  by lorniu

Emacs package for text translation, offering high configurability

created 4 years ago
317 stars

Top 86.5% on sourcepulse

GitHubView on GitHub
Project Summary

This Emacs Lisp package provides a highly configurable translation framework for Emacs users, supporting numerous translation engines and flexible output methods. It aims to offer a seamless translation experience within the editor, catering to users who frequently translate text snippets, paragraphs, or entire buffers.

How It Works

The framework is built around three core components: Taker, Engine, and Render, all implemented using Emacs Lisp Object System (eieio/CLOS). The Taker captures text and language information, the Engine performs the actual translation using various services (Google, DeepL, ChatGPT, etc.), and the Render displays the results in different ways (buffer, overlay, posframe, etc.). This modular design allows for extensive customization and extension, enabling users to tailor the translation workflow to their specific needs.

Quick Start & Requirements

  • Install: Via MELPA or other Emacs package managers.
  • Prerequisites: curl is highly recommended for improved HTTP requests via plz.el. Some engines like StarDict require external programs (sdcv) and dictionary files. DeepL and ChatGPT require API keys.
  • Configuration: Basic setup involves setting gt-langs and gt-default-translator in your Emacs configuration.

Highlighted Details

  • Supports a wide array of translation engines, including LLMs like ChatGPT and DeepSeek.
  • Offers diverse rendering options: buffer, posframe, overlay, kill ring, and system notifications.
  • Features a flexible Taker component for capturing text (word, paragraph, buffer) and languages.
  • Supports asynchronous and non-blocking HTTP requests for a smooth user experience.
  • Extensible architecture allows for custom engines, takers, and renderers, and even non-translation text-to-text tasks.

Maintenance & Community

The project is actively maintained. Further details on community and roadmap can be found via MELPA links.

Licensing & Compatibility

The README does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The default HTTP client (url.el) is noted as inefficient; curl via plz.el is recommended. Some advanced features or specific engines (e.g., DeepL, ChatGPT, StarDict) require external dependencies or API keys. The extensibility, while powerful, may introduce complexity for novice users.

Health Check
Last commit

6 days ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
4
Star History
19 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.