Integrates the WEB-T translation API into the WordPress block editor so authors can translate posts (title and content) without leaving the editor.
- Sidebar panel in the block editor to trigger WEB-T translations.
- Supports both synchronous and asynchronous responses from WEB-T via custom REST endpoints.
- Translation history limited to the three most recent jobs per post with detailed status (pending/completed/failed).
- Manual source/target selections.
- Stores translations in post meta to keep context across sessions.
- WordPress 6.8 or newer.
- PHP 8.2 or newer.
- Valid WEB-T (eTranslation) API credentials (application name & password).
- Copy the plugin folder into
wp-content/plugins/. - Activate RRZE WEB-T Translator via Plugins → Installed Plugins in WordPress.
- Go to Settings → WEB-T Translator and configure your API endpoint, application name, and password.
- Open any post in the block editor, use the WEB-T Translation sidebar to request translations.
| Setting | Description |
|---|---|
| API Endpoint URL | Full URL to the WEB-T translate endpoint, e.g. https://webgate.ec.europa.eu/etranslation/si/translate. |
| Application Name | Application identifier provided by WEB-T. |
| Password | Password/secret for the application. |
- Edit or create a post using the block editor.
- Open the WEB-T Translation panel from the sidebar.
- Choose the target language (defaults to the site language).
- Choose a source language.
- Click Translate content. A job is created and monitored until WEB-T responds.
- When complete, the post title and content update automatically. The translation history shows job details.
- PHP autoloading follows PSR-4 via
spl_autoload_register(namespaceRRZE\WebT). - Source assets live in
src/(ESNext + SCSS). Compiled and minified files are emitted tobuild/by the npm scripts. - Translation jobs are stored in post meta (
_rrze_webt_job_*), with an index key_rrze_webt_jobs_index. - REST endpoints reside in
includes/RestController.php(namespacerrze-webt/v1).
npm run build– Bundlessrc/editor.jsandsrc/editor.scssintobuild/editor.jsandbuild/editor.css.npm run start– Watches the same sources and rebuilds intobuild/on changes.
This project is licensed under the MIT License - see the LICENSE file for details.