tmgmt_tolgee
This module provides a Tolgee translator plugin for the Translation Management Tool (TMGMT).
It enables a robust, automated "Continuous Translation" workflow between Drupal and the Tolgee platform.
Key Features
- Robust JSON Export: Uses Tolgee's native JSON export format to strictly preserve translation keys and metadata, bypassing fragile XLIFF header limitations.
- Reverse Sync (New in v1.1.0): Bidirectional synchronization! Local Drupal edits can be configured to trigger a "Needs Review" state and pushed back to Tolgee, enabling a true "Latest Edit Wins" workflow.
-
Continuous Translation (Automation):
- Auto-Push: Optional setting to automatically upload new content (Unprocessed jobs) to Tolgee via Cron.
- Auto-Pull: Optional setting to automatically fetch completed translations (Active jobs) via Cron.
- Auto-Accept: Optional setting to automatically approve imported translations, enabling zero-click publishing.
- High Scalability: Supports massive datasets (e.g., 5000+ terms) via automatic Job pagination and Cron Batching to prevent timeouts.
- Bandwidth Efficiency: Implements HTTP Conditional Requests (ETags). If translations haven't changed in Tolgee, the module skips downloading and parsing, making frequent Cron polling extremely cheap and efficient.
- Manual Control: Includes a "Pull from Tolgee" button for on-demand synchronization.
Compatibility
This module has been tested on self hosted Tolgee but is (should be) fully compatible with:
- Tolgee Cloud (app.tolgee.io)
- Self-Hosted Instances (Custom domains)
- All Pricing Tiers (Free/Community, Business, Enterprise) via an active polling architecture that respects API rate limits.
Installation
Install via Composer to ensure all dependencies are loaded:
composer require drupal/tmgmt_tolgee drush en tmgmt_tolgee
Configuration
- API Key: Add your Tolgee API Key in Configuration > System > Keys.
- Provider: Add a "Tolgee" provider in Translation > Providers and select your API Key.
- Mapping: (Optional) Configure "Namespace Mapping" to organize your content (e.g., map "Nodes" to
the "content" namespace).
Full Documentation:
For detailed configuration options, tagging strategies, and technical details, please view the Full README and Documentation.
Roadmap & Remaining Tasks
[ ] Webhooks Integration (Real-Time Sync): Current status: Uses efficient Cron polling (ETags).
Goal: Implement a Webhook receiver to support immediate "Push" updates from Tolgee. This is vital for high-volume Business/Enterprise workflows where instant propagation is required without waiting for Cron runs.
[ ] Context & Screenshots (Enterprise):
Automate the uploading of screenshots from Drupal to Tolgee. This allows translators to see the exact visual context of strings (e.g., "Menu Link" vs "Button"), a key feature for ensuring quality in large-scale Enterprise projects.
[ ] Advanced In-Context Editing: Deepen the integration with the Tolgee JS SDK to enable full "Alt+Click" translation editing directly within the Drupal front-end.