外掛標籤
開發者團隊
② 後台搜尋「Polyglot Translate Connector」→ 直接安裝(推薦)
原文外掛簡介
Polyglot Translate Connector plugs the Polyglot Translate cloud into the brand-new WordPress 7.0 Connectors API — the same screen where you configure Anthropic, OpenAI, and Google. One API key, securely stored, available to every plugin on your site that needs translation.
Why this exists
WordPress 7.0 introduced a native way for plugins to share credentials for external services. Instead of every translation-aware plugin shipping its own settings page and asking you to paste the same key over and over, this connector lets you set it once in Settings → Connectors and have it just work everywhere.
What makes Polyglot Translate different
Polyglot is not “another machine translation API.” It’s a translation memory that learns from every edit anyone makes on your site or across the network. Translations get better the more they’re used — the system remembers good phrasings, learns your terminology, and progressively replaces machine output with verified high-quality results. You pay per character, not per call, and your translation memory belongs to you (cancel anytime — your data stays).
What this plugin actually does
Registers Polyglot Translate as a translation-type connector in the WordPress 7.0 Connectors registry.
Adds the Polyglot card to Settings → Connectors, with a logo, description, “Get your API key” link, and credential field.
Validates your API key against Polyglot Cloud on save (warns you, doesn’t block, if the cloud is unreachable).
Exposes 5 stable PHP helper functions (polyglot_get_api_key(), polyglot_is_connected(), polyglot_get_api_base_url(), etc.) that any other plugin on your site can use to consume Polyglot transparently.
Adds a Site Health check so you can verify the connection state anytime.
Supports environment variables and PHP constants for credentials — enterprise-friendly, no API keys in your database if your security policy forbids it.
What this plugin does NOT do
It does not translate content. It’s a credential + discovery layer. For an end-to-end translation experience (front-end language switcher, glossary, post editor), install the main Polyglot Translate plugin alongside this one.
It does not add visible admin UI beyond the native Connectors screen and one small Advanced settings sub-page for endpoint overrides.
It does not ship any AJAX handlers or REST endpoints of its own.
For plugin developers — discover Polyglot from your plugin
If you’re building a WordPress plugin (AI content generator, SEO tool, WooCommerce extension, multilingual workflow…) and you want to use Polyglot Cloud as your translation backend, you no longer need to ship your own settings UI or ask users for an API key. This connector handles credential discovery:
if ( function_exists( 'polyglot_is_connected' ) && polyglot_is_connected() ) {
$api_key = polyglot_get_api_key();
$base_url = polyglot_get_api_base_url();
// Make REST calls against $base_url/v1/translate, etc.
}
For higher-level conveniences (batching, retry policy, response DTOs), an official polyglot/wp-sdk Composer package is planned as a separate library that wraps this connector. Until released, consume the Polyglot Cloud REST API directly using the helpers above.
Credential precedence
Highest to lowest:
POLYGLOT_TRANSLATE_API_KEY environment variable (set in your hosting panel)
POLYGLOT_TRANSLATE_API_KEY PHP constant (defined in wp-config.php)
Database option (set via Settings → Connectors)
Advanced — custom API endpoint
If you operate a self-hosted Polyglot deployment, a reverse-proxy gateway (Cloudflare Workers, AWS Lambda…), or a staging environment, you can override the API base URL via Settings → Polyglot Translate. HTTPS-only.
