Machine Translation
Machine translation (MT) lets you auto-translate new posts, existing posts in bulk, or untranslated strings with one click. PerfLocale supports five providers; pick the one that fits your quality + budget + compliance needs at Settings → Addons → Machine Translation.
Providers
- DeepL - best quality for European languages + Japanese. Paid (with a free tier: 500k chars/month). Supports glossaries (native + ours). EU data-residency by default. Start: deepl.com/pro.
- Google Cloud Translation - broadest language coverage (130+). Paid, metered. Google Cloud account required. Higher throughput than DeepL.
- Microsoft Azure Translator - comparable quality to Google; cheaper for high volume; requires Azure account. Custom Translator models supported.
- LibreTranslate - open-source, self-hosted. No per-character cost; you run the server. Quality is decent for EU languages, variable for non-EU. Best for privacy-sensitive or offline sites.
- External Translation Agency - generic HTTP endpoint for sending content to a human-translation service or custom workflow. You configure the URL + auth; PerfLocale sends the payload and receives completed translations asynchronously via a callback URL.
API keys
Every paid provider requires an API key. PerfLocale resolves it from three sources in priority order — env var > wp-config.php constant > database setting. The first non-empty source wins.
- Environment variable — e.g.
PERFLOCALE_DEEPL_API_KEY. Recommended for containers, CI, and managed hosts. Highest priority. wp-config.phpconstant — same canonical name (define( 'PERFLOCALE_DEEPL_API_KEY', '…' )). Recommended when env vars aren’t available.- Settings → Addons → Machine Translation — paste into the corresponding field. Stored in the
perflocale_settingsoption. Used when neither an env var nor a constant is set.
See API Keys: Environment Variables & Constants for the full canonical-name table and examples.
Auto-translate on publish
Toggle Auto-Translate on Publish to trigger MT for every non-default language when a source post is published. PerfLocale creates a translation shell for each language and populates it via the MT provider in the background (Action Scheduler). Failures don’t block the source publish; they’re logged and retryable from the Translations page.
Bulk translate
From the Translations page, multi-select rows and choose Bulk → Translate with MT. Small batches run inline; larger ones queue as a bulk_translate background job visible under PerfLocale → Jobs. The sync/async split is governed by the bulk_translate threshold under Settings → Performance → Background Thresholds (default 25, counted as source posts × target languages). The monthly character limit and per-user hourly cap apply either way. For very large batches you can also use WP-CLI: wp perflocale translate --all --to=de --post-type=post --skip-existing.
Monthly character limit
Optional cap on MT usage per calendar month. Hit the cap → auto-translate + bulk translate pause until next month (manual translate via the editor button still works, since you’re explicitly opting in). Raises a warning at 80% on the Dashboard.
Glossary integration
Enforce consistent translation of brand names, product SKUs, and industry terms across every MT provider. Toggle Glossary Integration; manage terms at PerfLocale → Glossary. Covered in detail at Translation Glossary.
Translation Memory
PerfLocale caches every translation it produces and reuses exact / fuzzy matches before spending MT credits on the same content twice. Transparent - no configuration required. Inspect via the Translation Memory API.
Privacy
When you trigger MT, the plugin sends the post’s title + content + excerpt to the provider you chose. See the External Services section of the plugin’s readme for each provider’s ToS / Privacy links + what data is sent. For fully-local translation, use self-hosted LibreTranslate.