WP Manifestindependent plugin directory
manifest / i18n / matecat-translator-for-wordpress

Matecat Translator

Free Matecat.com translation service for Wordpress

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/nik-coder/matecat-translator-for-wordpress/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Translate Pages, Posts and Custom Post Types with the free Matecat CAT/MT service (https://www.matecat.com), from inside the WordPress editor — Gutenberg, Elementor and Divi all supported, with a generic fallback for everything else (classic editor, other builders, etc.).

What this plugin does

  1. Adds a "Matecat Translator" box to the edit screen of Posts, Pages and any Custom Post Type you enable (Settings > Matecat Translator).
  2. For each target language you configure, a "Send to Matecat" button:
    • detects which builder produced the content (Elementor / Divi / Gutenberg / plain content),
    • extracts every piece of translatable text into numbered segments while keeping a "skeleton" of the original structure (blocks, Elementor JSON tree, Divi shortcodes...),
    • packages the segments into a small HTML file and uploads it to Matecat via their REST API (POST /new), where it becomes a normal Matecat project you (or your translators) can open, machine-translate and/or post-edit like any other Matecat job.
  3. A "Check status" button (and an hourly WP-Cron job) polls Matecat (GET /status) for progress.
  4. Once a job is DONE, "Import translation" (or the cron job, automatically) downloads the translated file (GET /url + the returned download link), re-inserts the translated text back into the original structure, and creates (or updates) a translated copy of the post — as a Draft by default, so you can review before publishing.

Before you start: you need a Matecat API key

Matecat's REST API requires an API key issued by Translated srl. Request one from support@matecat.com (mention you're integrating a WordPress plugin), or generate one yourself from your Matecat account's Profile page once logged in. See: https://guides.matecat.com/obtaining-api-credentials

Paste the key into Settings > Matecat Translator > API Key.

A note on the API base URL / field names: Matecat only publishes the full REST reference (https://www.matecat.com/api/docs) together with an issued key. This plugin ships with the base URL and field names documented publicly (POST /new with x-matecat-key header and multipart/form-data; project_name, source_lang, target_lang, files[]; GET /status, /stats, /url, /comment). If the reference you receive with your key shows different field names, everything Matecat-API-related lives in one file: includes/class-mt-api-client.php — that's the only place you'd need to adjust.

Setup

  1. Upload and activate the plugin.
  2. Go to Settings > Matecat Translator:
    • paste your API key
    • pick your site's source language
    • tick the target languages you want available
    • tick which post types (Posts, Pages, any CPT) should show the translator box
    • choose whether imported translations land as Draft, Pending or Published
  3. Open any Post/Page/CPT of an enabled type. In the "Matecat Translator" box in the sidebar, click "Send to Matecat" next to a language.
  4. Work the job in Matecat as usual (machine translation, post-editing, revision...).
  5. Back in WordPress, click "Check status", then "Import translation" once it shows DONE — or just wait, the hourly cron job will import it for you automatically. A translated post is created/updated and linked to the original.

Builder support notes

  • Gutenberg: parsed with parse_blocks()/serialize_blocks(), so block attributes/comments stay intact; only the human-readable text changes.
  • Elementor: the _elementor_data JSON tree is walked recursively; a filterable allow-list of setting keys (title, editor, text, description, button_text, etc. — see matecat_translator_elementor_translatable_fields) decides which fields are translated. Add your own keys via that filter if a specific widget's field isn't picked up.
  • Divi: post_content shortcode markup is tokenized and rebuilt; a filterable allow-list of attributes is translated (matecat_translator_divi_translatable_attrs), plus the text inside each module.
  • Anything else (classic editor, other builders that store HTML in post_content): handled by the generic HTML text-node extractor, which should work for most third-party builders that ultimately render to post_content HTML.

Files

matecat-translator.php Plugin bootstrap includes/class-mt-api-client.php Matecat REST API wrapper (all HTTP calls) includes/class-mt-languages.php Language list includes/class-mt-content-extractor.php Shared extractor base class includes/class-mt-extractor-generic.php Fallback handler includes/class-mt-extractor-gutenberg.php Gutenberg handler includes/class-mt-extractor-elementor.php Elementor handler includes/class-mt-extractor-divi.php Divi handler includes/class-mt-post-translator.php Orchestrates send/check/import includes/class-mt-admin.php Settings page includes/class-mt-metabox.php Edit-screen translation box includes/class-mt-ajax.php AJAX endpoints for the box's buttons includes/class-mt-cron.php Hourly auto status-check + auto-import assets/js/admin.js, assets/css/admin.css uninstall.php