PiedWeb AI Polyglot

توضیحات

PiedWeb AI Polyglot is the multilingual infrastructure for your WordPress + WooCommerce site — routing, SEO, admin UI, virtualized stock and reviews — without duplicating content. It does not translate text itself: you bring your own translation provider (an LLM, a translation API, or a human translator), and the plugin handles everything else.

It uses a Master/Shadow architecture: you manage content in your primary language, and the plugin creates linked shadow copies for each target locale. Each language gets its own domain (or subdomain), with full SEO support out of the box. WP-CLI commands expose the master content as JSON so you can pipe it into any LLM or translation API and push the result back.

Designed to fit AI-powered translation workflows — but works just as well with human translators or a flat-file editing loop.

Why PiedWeb AI Polyglot?

  • No content duplication — shadows are linked copies, not clones. Update the master, shadows follow.
  • No separate database — everything lives in a single WordPress install. No sync headaches.
  • No performance penalty — stock, images, and reviews are virtualized at query time, not copied.
  • No plugin lock-in — all data is stored as standard WordPress post meta. Remove the plugin, your content stays.
  • AI-ready — WP-CLI commands expose master content as JSON, ready to pipe into any translation API or LLM.

Features

  • Domain-based routing — one domain per language, detected via HTTP_HOST. Each domain serves only its locale’s content.
  • Virtualized stock — shadow products read stock from the master in real time. Orders on any domain decrement the same inventory.
  • Virtualized reviews — reviews submitted on any domain are stored on the master product. Star ratings are aggregated across all locales.
  • Virtualized images — shadow products inherit the master’s featured image and gallery without duplicating media files.
  • Hreflang SEO — automatic <link rel="alternate" hreflang="..."> tags plus sitemap annotations with xhtml:link.
  • Locale-filtered sitemaps and RSS — each domain’s sitemap and feed only expose its own content.
  • WooCommerce i18n — shipping labels, checkout legal texts, cart product names, and permalink slugs are all translated per locale.
  • Human lock — manually edited translations are protected from automated overwrite (unless you --force).
  • Language suggestion banner — auto-detects the visitor’s browser language and suggests switching locale, with dismiss + localStorage persistence.
  • Draft link handling — internal links pointing to drafts are auto-hidden for public visitors and re-activate once the target is published. Editors keep working links.
  • Language switcher — drop-in function for your theme with WooCommerce cart session transfer across domains.
  • Admin UI — locale filter dropdown, language badge column, shadow warning banner, and translations metabox on masters.
  • Flat-file export/import — bulk export all translations to TSV + HTML files, edit offline, re-import.
  • WP-CLI powered — list untranslated content, push translations, manage slugs — all from the command line.

Works without WooCommerce

All WooCommerce features (stock, reviews, cart, slugs) activate only when WooCommerce is present. On a standard WordPress site, the plugin handles routing, hreflang, admin UI, and translation management with no extra dependencies.

Full documentation

For the complete documentation (data model, WP-CLI command reference, hooks, draft link handler, configuration examples), see the README on GitHub.

Credits

Brought to you by Robin (Pied Web), inspired by Pushword CMS, sponsored by Woodrock Climbing.

Country flag SVGs in assets/flags/ are from flag-icons by Panayiotis Lipiridis, licensed under the MIT License.

عکس‌های صفحه

نصب

  1. Upload the plugin folder to wp-content/plugins/wp-ai-polyglot/, or install it through the WordPress plugin screen.
  2. Before activating, define the POLYGLOT_LOCALES constant in wp-config.php:

    define(‘POLYGLOT_LOCALES’, [ ‘www.example.com’ => [‘locale’ => ‘fr_FR’, ‘hreflang’ => ‘fr’, ‘label’ => ‘Français’, ‘currency’ => ‘EUR’, ‘master’ => true], ‘en.example.com’ => [‘locale’ => ‘en_GB’, ‘hreflang’ => ‘en’, ‘label’ => ‘English’, ‘currency’ => ‘GBP’], ‘es.example.com’ => [‘locale’ => ‘es_ES’, ‘hreflang’ => ‘es’, ‘label’ => ‘Español’, ‘currency’ => ‘EUR’], ]);

  3. Configure your web server (Apache or Nginx) to serve the same WordPress document root for every language domain.

  4. Set WP_HOME and WP_SITEURL dynamically in wp-config.php based on $_SERVER['HTTP_HOST'].
  5. Activate the plugin through the Plugins screen.

See the GitHub README for DNS, SSL, and local-development setup.

سوالات متداول

Do I need WooCommerce?

No. WooCommerce features (stock virtualization, review aggregation, slug translation) activate only when WooCommerce is present. On a standard WordPress site, the plugin handles routing, hreflang, admin UI, and translation management.

Can I use subdirectories like example.com/en/ instead of subdomains?

No. PiedWeb AI Polyglot uses one domain (or subdomain) per language. Subdirectory routing is not supported by design — it keeps the routing logic fast and the SEO model clean.

Is this compatible with WordPress Multisite?

No. The plugin is single-site only and will display an admin notice on Multisite installs.

How do I disable the language suggestion banner?

Add define('POLYGLOT_BAR', false); to your wp-config.php. Both the asset enqueue and the HTML rendering are skipped.

What happens to my content if I deactivate the plugin?

All translation data is stored as standard WordPress post meta. Your shadow posts remain in the database and can be managed manually. Domain routing stops, so each domain will serve the same content until you remove the alias.

How does the AI translation workflow work?

The WP-CLI command wp polyglot untranslated --type=product lists posts needing translation. wp polyglot translate <id> --target=<locale> returns the master content as JSON — pipe that into any LLM or translation API, then push the result back with --payload='{...}'. The plugin does not call any third-party API itself; you control the translation provider.

Are manual translations safe from being overwritten?

Yes. Any translation edited through wp-admin (or marked with _translation_mode = manual) is protected from automated re-translation. Pass --force to override.

نقد و بررسی‌ها

نقد و بررسی‌ای برای این افزونه یافت نشد.

توسعه دهندگان و همکاران

“PiedWeb AI Polyglot” نرم افزار متن باز است. افراد زیر در این افزونه مشارکت کرده‌اند.

مشارکت کنندگان

ترجمه “PiedWeb AI Polyglot” به زبان شما.

علاقه‌ مند به توسعه هستید؟

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

گزارش تغییرات

2.3.0

  • check-links --fix now runs automatically after import and translate (opt out with --no-fix-links)
  • New wp polyglot doctor — one-screen health-check: locale config, master/shadow drift (orphans, status parity), hreflang uniqueness, exchange-rate coverage/freshness, and per-locale feed endpoints (--quick to skip HTTP). --format=json, non-zero exit on failure.
  • New wp polyglot lint — translation QA per master/shadow: names the exact links a shadow is missing (resolving localized slugs) or has in excess, plus missing shortcodes/placeholders (fail), image/heading/length drift, residual French and stale src_hash (warn). Grouped table view; --format=json carries the missing/extra lists per finding. --locale to scope.
  • Admin: the translations metabox is now a cross-locale switcher shown on shadow edit screens too (jump to the master or any sibling locale in one click); the language-column badge links to the master.

2.2.0

  • Flat-file write API: wp polyglot write (stdin JSON) applies one flat file to the DB under an optimistic lock (etag compare-and-swap)
  • Frontmatter flat format (YAML-ish front matter + HTML body) replaces the TSV — one file per locale per entity
  • Terms (taxonomy) adopt the same model: term-{taxonomy}-{id}/{locale}.html, body = description
  • import is now flat-driven and etag-locked (--force to override); translate --payload gains --if-match
  • New wp polyglot push [--all] reconciles out-of-band edits (vim, git pull, batch)
  • Staleness tracking via content-hash meta (untranslated --stale)
  • Stable folder layout {type}-{id} + read-only _index.md
  • Dev tooling: php-cs-fixer + phpstan (WordPress/WooCommerce stubs); CI runs phpstan

2.1.0

  • Google product feed (Merchant Center): per-domain /polyglot-feed/google.xml endpoint, one feed per locale/currency/URL
  • Variations virtualized from the master on shadow domains (shared item_group_id)
  • Per-domain currency (woocommerce_currency filter) + ECB daily FX conversion of master prices
  • New WP-CLI commands: wp polyglot update-exchange-rates and wp polyglot feed

2.0.0

  • Initial public release on WordPress.org
  • Master/Shadow architecture with domain-based routing
  • WooCommerce support: virtualized stock, reviews, images, translated slugs
  • WP-CLI commands for AI-powered translation workflows
  • Flat-file export/import (TSV + HTML) with concurrency lock
  • Hreflang SEO with sitemap and RSS annotations
  • Draft link handler — hide links to unpublished targets, restore on publish
  • Native permalink resolver (no Custom Permalinks plugin required)
  • check-links WP-CLI command for detecting mislocalized internal links