=== Multilanga – AI Translation & Multilingual Language Switcher ===
Contributors: aleksandrgol
Tags: translate, translation, multilingual, ai translation, language switcher
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.45.20
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI translation for WordPress and WooCommerce that stores every translation in YOUR database. SEO-friendly language URLs, no lock-in.

== Description ==

**AI translation for WordPress that you actually own.** Multilanga translates your whole WordPress & WooCommerce site with AI and stores every translation in **your own database** — not a vendor cloud. Stop paying and your site stays multilingual, forever. It's the fast, private, no-lock-in alternative to cloud translation services.

Everything runs inside wp-admin — no external dashboard, no separate account — and nothing is sent to our servers until you connect to the AI service.

**Features**

* 🌍 **Unlimited languages** — translate into 35+ languages, with no cap on how many you use, on every plan (including the free one).
* 🔒 **You own the translations** — they live in your WordPress database, not our cloud. No lock-in, trivial backups; cancel anytime and your translated site keeps working.
* 🤖 **Automatic AI translation** — new content is translated in the background; change a setting or a glossary term and re-translate everything in one click — your manual edits are always kept.
* 👁️ **Visual in-context editor** — open a live preview and click any text to translate it in place, with a Page & SEO side panel — or review element-by-element in a clean list.
* ⚡ **Served 100% locally** — no external API call per visit, no flicker, and no per-view fees; a viral page costs nothing extra and your cache plugin keeps working.
* 🔍 **Real SEO** — dedicated language URLs (`/de/`, `/fr/`), automatic hreflang + x-default, translated titles, meta, Open Graph and slugs, localized canonicals, and a **per-language XML sitemap**.
* 🛒 **WooCommerce ready** — products, cart and modern block checkout translate out of the box via the Store API, plus per-language product images.
* 🎨 **Brand-aware AI + glossary** — set tone, audience and site context; pin an exact translation or keep brand names untranslated, per language.
* 🧩 **Works with any builder** — Elementor, Divi, Gutenberg, shortcodes, widgets and theme strings are all covered, because Multilanga translates the rendered page.
* 🎚️ **Flexible language switcher** — a lightweight floating button, the `[multilanga_switcher]` shortcode, or a menu item, with your colours, flags (rectangular or round) and names.

**How it's different from cloud translators**

Cloud translation services keep your translations on their own servers and charge by words, by page views and by the number of languages. Multilanga keeps everything in your own database, serves pages locally, and never meters your traffic — at a flat yearly price with unlimited AI words on paid plans.

== External Services ==

This plugin connects to the Multilanga API (a service by DoubleCoded) to machine-translate your content. The following data is sent:

* **Content for translation:** the text segments of your public pages that need translating, plus the source and target language codes. Sent by a background task when new or changed content is found — never during a regular visitor page view.
* **License & site info:** your license key, site URL, plugin and WordPress version, and whether WooCommerce is active. Sent only after you connect to the service (create or enter a license key): when you verify your license and once a day as a heartbeat, so your license can be validated and moved between sites you own. Nothing is sent to our servers before you connect.
* **Sign-up (optional):** when you start a free license (the "Start translating for free" button, or the field on the settings screen), the email address shown/entered and your site URL are sent to create the license. Nothing is sent until you click.
* **Checkout (optional):** when you choose a paid plan, your license key is sent so we can create a secure Stripe checkout session; payment is handled entirely by Stripe.

No visitor personal data is transmitted, and customer data in WooCommerce emails is never sent for translation. Translations are stored locally in your WordPress database.

* **Service provider:** Multilanga / DoubleCoded — [Terms of Service](https://multilanga.com/terms/), [Privacy Policy](https://multilanga.com/privacy/).

== Installation ==

1. Install and activate the plugin — you land on the Multilanga dashboard.
2. In **Settings**, pick your original language and the languages to translate into. The switcher, language URLs and manual editing work right away.
3. To have new content machine-translated automatically, connect to the AI translation service — click **Start translating for free** for a key, or paste an existing one (optional; everything above works without it).
4. Open your site with a language prefix (e.g. `/ru/`) or run a full scan. Review and polish under **Multilanga → Translations**.

== Screenshots ==

1. Dashboard: translation progress per language, what needs your attention, license and usage — all in wp-admin.
2. Translations by page: filter by content type, see progress per page, and jump into the editor or the visual editor.
3. Page editor: review every element side by side with the original; AI translations and your own edits are marked clearly.
4. Visual editor: open a live preview and click any text to translate it in place, with a Page & SEO side panel.
5. Settings: choose languages with a tag multiselect, and style the language switcher (colors, flags, position).
6. The language switcher on the front end, with real flag icons.
7. Translation quality (AI): describe your site, pick a tone of voice and audience, and add custom instructions so translations match your brand.
8. Glossary: keep brand or product names untranslated, or pin a preferred translation for a term per language.

== Frequently Asked Questions ==

= What happens if I cancel my subscription? =

Your site stays multilingual. All translations are stored in your WordPress database and keep being served. Only automatic translation of *new* content stops.

= Does it create duplicate posts or pages? =

No. Language URLs are virtual — nothing is duplicated in your database, and uninstalling leaves your content untouched.

= Which page builders are supported? =

All of them. Multilanga works on the rendered HTML of your pages, so it does not depend on how the page was built.

= Can I edit translations manually? =

Yes — open **Multilanga → Translations**, pick a page and edit any segment side by side with the original. Manual edits are never overwritten automatically.

== Changelog ==

= 0.45.20 =
* Every built-in feature is now fully functional without any key: the Settings and Translations screens, language routing, the switcher and manual editing are always available. Connecting to the AI translation service is optional and only powers automatic machine translation.
* Hardened the page-map throttle to key on the resolved post/term instead of the request path, so it can never create unbounded transients.

= 0.45.19 =
* The admin-bar "Translate" link now opens the editor in the language you are viewing (click it on the Russian page and it opens Russian, not the first language); on the source page it still opens the first target language.

= 0.45.18 =
* Really fixed the admin-bar "Translate" link on translated pages: it now reverts the translated slug to the original page, so it always opens that page's editor (0.45.16 stripped only the language prefix).

= 0.45.17 =
* SEO: new /multilanga-sitemap.xml listing every page and its language versions with hreflang alternates (works even when Yoast/Rank Math replace the core sitemap), advertised in robots.txt. hreflang tags now point each language at its translated-slug URL and include the source language.

= 0.45.16 =
* Fixed the admin-bar "Translate" link opening an empty editor ("No elements recorded") when clicked while viewing a translated page — it now always opens the correct source page.

= 0.45.15 =
* Dashboard clarity: elements left untranslated because the free word limit was reached now show as a distinct "Needs upgrade" segment on the progress bar (with a count), instead of looking like plain "Not translated" — so the dashboard and the per-page list no longer appear to disagree.

= 0.45.14 =
* New: re-apply your settings to content already translated. Adding a glossary rule now re-translates existing text that uses the term, and a new "Re-translate all AI content" button in Settings refreshes everything with your current description, tone and glossary. Manual edits are always kept.
* Better AI terminology: the translator is told to use the established term in each language and never translate discipline/category names literally, which noticeably improves domain terms.

= 0.45.13 =
* No limit on the number of languages — the switcher, language URLs and stored translations are fully functional for everyone; only the AI translation service itself is metered by a word quota.
* Nothing is sent to our servers until you connect to the service (get or enter a license key): no activation ping, and the daily heartbeat only runs once a license exists.
* All database queries now use prepared statements with bound parameters throughout.

= 0.45.12 =
* Hardening pass before review: safer cookie/request handling, a longer scan lock so multi-language crawls don't overlap, and the background progress poller now stops cleanly instead of retrying forever when translation can't proceed.

= 0.45.11 =
* Background translation now finishes on its own and the progress bars update live (no refresh), even on hosts where WP-Cron is disabled.
* Fixed the per-row "Translate with AI" button in the list not responding on some sites.

= 0.45.10 =
* Important fix: a full scan is now strictly additive and never deletes existing translations. A previous version could wrongly drop translated content as "stale" on some hosts.

= 0.45.9 =
* Whole-site translation now progresses reliably even on hosts where WP-Cron is disabled (it advances while you watch the dashboard), and no longer stalls at 0.
* Fixed pages showing as both "not scanned" and already-scanned (duplicate rows) and the "N pages not scanned" notice never clearing.

= 0.45.8 =
* The whole-site translation progress now updates live (no need to refresh), and the description makes clear it only translates new/missing text — finished pages are not re-translated.

= 0.45.7 =
* Page-builder templates (Elementor library, reusable blocks, header/footer templates, etc.) are no longer listed or auto-translated as pages — only real content is.

= 0.45.6 =
* Fixed non-Latin translated URLs (e.g. Cyrillic slugs) redirecting to the homepage instead of opening the page.

= 0.45.5 =
* Clearer wording: the whole-site action is now labelled "Translate entire site" (it was "Scan"), so it is obvious how to translate the whole site at once.

= 0.45.4 =
* More reliable AI translation of long content, and clicking "Translate with AI" now retries items that were parked at the word limit.

= 0.45.3 =
* Fixed the open-page icon button and a few list/dashboard elements that could look misaligned (same inline-style filtering cause as the step icons).

= 0.45.2 =
* Really fixed the setup step icons (the previous fix was undermined by inline-style filtering); layout moved to the stylesheet.

= 0.45.1 =
* Fixed the alignment and shape of the setup step icons on the dashboard.

= 0.45.0 =
* You now choose which content types the whole-site auto-translate covers (Pages, Posts, Products…), so the free word quota is not spent on your blog.
* Smarter order: menus and main pages are translated first, blog posts last, so the visible site switches language sooner. Only published content is auto-translated.

= 0.44.0 =
* Cleaner first run: the Settings and Translations screens stay hidden until you get a license, so setup follows one simple path from the dashboard.

= 0.43.0 =
* Fixed the dashboard sometimes showing "License not verified / API unreachable" right after getting a free license; the plan now shows immediately.
* Fixed the alignment of the open-page icon button in the translations list.

= 0.42.0 =
* New "Translate" shortcut in the admin toolbar: on any page, post or product (front-end or while editing) it jumps straight to that page's translation editor.

= 0.41.1 =
* The "Upgrade to Pro" hint in the language picker now scrolls to the plan options on the same screen instead of opening the website.

= 0.41.0 =
* Clearer language picker on the Free plan: it now stops at your plan's language limit and shows an upgrade hint, instead of silently keeping only the first language.

= 0.40.0 =
* When the free word limit is reached, remaining text is marked "Needs upgrade" instead of "Failed"; upgrading to a paid plan automatically translates it.

= 0.39.0 =
* Magic setup: choosing a language now automatically crawls and translates your whole site in the background — no clicking through pages. New and changed content on language URLs is translated automatically too.
* Added a "Translate with AI" button directly in the translations list, next to each page.

= 0.38.0 =
* The page editor now shows every scanned element right away, and "Translate with AI" translates immediately (no waiting for a background cron).
* Fixed pages that showed a count but an empty editor and could not be translated.

= 0.37.1 =
* Fixed a misaligned external-link icon on the "View page" button in the translation editor.

= 0.37.0 =
* Fixed: on the free plan AI translation could get stuck showing "in queue" forever. The queue now drains reliably (with a background safety-net), and the "Translate with AI" button appears whenever a page has anything left to translate.
* Cleaner translations: auto-generated post dates, the "written by / author / category" byline and the comments section are no longer collected as translatable text.

= 0.36.0 =
* Reinstalling on the same site now restores your existing free license automatically instead of showing an "email already used" dead-end.

= 0.35.0 =
* Faster first run: start translating for free with one click on the dashboard — no need to find a field or paste anything.
* Your data now survives a reinstall: deleting the plugin keeps your translations, license and settings by default, so reinstalling on the same site restores everything. A new Settings option lets you opt into a full clean-up on deletion instead.

= 0.34.0 =
* Internal hardening for the WordPress.org directory: late output escaping, longer unique code prefixes, and standard full data cleanup on uninstall. No user-facing changes.

= 0.33.0 =
* Per-language image replacement is now available on every plan.
* The language switcher's colors, border, corner radius and background toggle are unchanged; the free-form "Custom CSS" box has been removed — style .mlg-switcher from your theme's stylesheet instead.
* Housekeeping: admin and front-end styles and scripts are now loaded the standard WordPress way (enqueued).

= 0.32.0 =
* Upgrade to Pro or Agency straight from Settings — secure Stripe Checkout, yearly billing, cancel anytime. Your translations always stay in your own database.

= 0.31.0 =
* New "Translation quality (AI)" settings: describe your site, pick a tone of voice and audience, and add custom instructions to guide the AI.
* New Glossary: keep brand or product names untranslated ("never translate"), or pin a preferred translation for a term per language ("always translate as").
* Faster, cheaper AI translation with no quality loss (low-latency model settings).
* Language switcher: a Background on/off toggle — turn it off for a transparent button that blends into your design.

= 0.30.2 =
* Internal: unified admin design tokens (colors, radii, card styling) into one source of truth.

= 0.30.1 =
* Every page in the translations list now has an "open in a new tab" button to preview the translated page.

= 0.30.0 =
* "Translate missing with AI" now shows live progress and refreshes when it finishes, instead of a timed reload.
* Clearer visual-editor toolbar ("Outline text": All / Untranslated only / Off) and a highlighted "Not translated" status.
* Short strings (menu items, buttons) are edited in a single-line field; long text keeps the resizable box.

= 0.29.0 =
* A full site scan now tidies up: text that no longer exists on your site (removed content or an old theme) is dropped from the translation list automatically.

= 0.28.0 =
* Polish pass: native WordPress icons and loading spinners, and inline error messages instead of pop-up alerts.

= 0.27.0 =
* Style the language switcher: pick button background, text and border colors and a corner radius, or add your own CSS in a syntax-highlighted editor.

= 0.26.0 =
* Language switcher upgrades: four corner positions (top/bottom, left/right), an inline "row" mode that shows every language at once, and placement inside a menu (Custom Link `#multilanga`).

= 0.25.0 =
* Flags are now crisp SVG icons — round or rectangular — that render identically on every operating system, Windows included.

= 0.23.0 =
* Refreshed admin design across the dashboard, translations list, editor, visual editor and settings, plus a clearer setup stepper.

= 0.22.0 =
* Language switcher design options: show flags and/or language names, with a live preview. Place the switcher anywhere with the [multilanga_switcher] shortcode.

= 0.21.0 =
* Languages are now chosen with a tag multiselect (type to add, click × to remove). Clearer, higher-contrast progress readout in the translations list.

= 0.20.3 =
* Clearer translations list: explains scanned vs unscanned pages and the Auto/Custom columns; empty state offers a one-click scan.

= 0.20.2 =
* Visual editor works on narrow screens (panel stacks under the preview). Language switcher shows a dropdown arrow.

= 0.20.1 =
* Clearer translation statuses (AI translated / Your edit / In queue…), calmer progress-bar colors, and upgrade/settings links where relevant.

= 0.20.0 =
* Onboarding: pick target languages from a checklist of named languages (no more ISO codes), and a Get started checklist guides the first setup. Opens automatically after activation.

= 0.19.5 =
* Dashboard: simplified the translations card heading.

= 0.19.4 =
* Visual editor: selecting an element expands the Selected element section if it was collapsed.

= 0.19.3 =
* Visual editor: collapsible sections restyled as an accordion with the toggle arrow at the right edge.

= 0.19.2 =
* Visual editor: side panel sections (Page & SEO, Selected element, Not visible) are collapsible.

= 0.19.1 =
* Fixed the Replace image button not opening the media library.

= 0.19.0 =
* Media translation (Pro): replace an image with a language-specific version — click any image in the visual editor and pick a replacement. Great for banners with baked-in text.

= 0.18.1 =
* Visual editor: the Save confirmation resets when you edit a field again.

= 0.18.0 =
* Visual editor: page metadata (browser-tab title, meta description) and the URL slug are now edited in a dedicated Page & SEO block instead of appearing as clickable text in the preview.

= 0.17.2 =
* Visual editor: hide the admin bar inside the preview.

= 0.17.1 =
* Visual editor now distinguishes page content from site-wide elements (menus, header, footer): those are marked separately and edited under Shared elements.

= 0.17.0 =
* Visual translation: open any page in a live preview and click text to translate it in place. Elements not visible on the page (image alt text, meta tags) are editable in a side list.

= 0.16.0 =
* Scan entire site: one click crawls every page in the background so the whole site is discovered (and, on paid plans, translated) without visiting each page. Uses no AI words by itself.

= 0.15.0 =
* Edit a page's translated URL slug by hand in the translation editor. WooCommerce cart/checkout/account pages are excluded from slug translation.

= 0.14.1 =
* Translated slugs now appear on catalog/listing links before a page is first opened, and resolve regardless of URL encoding.

= 0.14.0 =
* Translated URL slugs: a post's address in each language uses its translated title (e.g. /ru/product/proteinovyj-miks/), improving SEO. Generated automatically; the original address keeps working.

= 0.13.2 =
* Editor notifications and permission messages are now translatable; removed a leftover internal variable.

= 0.13.1 =
* Internal hardening follow-up: shared text-normalization helper, HTTPS-only API endpoint, SameSite cookie, and extra fail-safes around the switcher and links.

= 0.13.0 =
* Hardening & performance pass: translations are sanitized before display, product/UI text stays out of the request path (background translation only), database indexes added for large catalogs, and cleaner uninstall. No visible behavior change.

= 0.12.1 =
* Cart page now shows translated products on first load, not only after cart updates.

= 0.12.0 =
* Product names and descriptions in the cart, mini-cart and checkout blocks are now translated (Store API responses go through your dictionary).

= 0.11.4 =
* Fixed garbled characters in client-rendered blocks (mini-cart drawer): non-ASCII text is no longer entity-encoded inside script data.

= 0.11.3 =
* Fixed a fatal error on language URLs introduced in 0.11.2.

= 0.11.2 =
* Admin-bar strings no longer leak into translations via their accessibility attributes.
* UI strings already translated by official language packs are kept out of your dictionary and editor.
* Shared elements threshold raised to 80% of scanned pages — product repeats stay on their own pages.

= 0.11.1 =
* Links inside JavaScript-rendered blocks (cart's "Proceed to Checkout", store pages) now keep the selected language.

= 0.11.0 =
* Native locale switching: language URLs now run WordPress under the matching official locale, with language packs downloaded automatically. WooCommerce cart, checkout, My account and all plugin UI render in the visitor's language natively — including JavaScript-rendered blocks.
* Server redirects keep visitors inside the language version.

= 0.10.1 =
* Shared elements now require an element to appear on at least half of scanned pages — per-product strings no longer pollute the group on large catalogs.

= 0.10.0 =
* The translations list now shows every published page of your site — including ones never visited yet, with a one-click "Scan & translate" button.
* Page editors show only the page's own content; site-wide elements (menus, header, footer, popups) are edited once under Shared elements.

= 0.9.0 =
* Translations list: filter pages by content type (pages, posts, products, any custom post type), sort by name or translation progress, search, and pagination.

= 0.8.0 =
* Free plan: 10,000 AI-translated words included (lifetime), with a usage bar on the dashboard. Built-in official translations stay free and unlimited.

= 0.7.0 =
* Plan capabilities: language count and automatic translation now follow your plan; the Free plan includes one language with manual translation.
* The daily license check also refreshes your plan, so upgrades apply automatically.

= 0.6.0 =
* Shared elements: menus, header and footer strings are grouped into one virtual page — edit them once instead of on every page.
* Approve all AI translations of a page with one click.

= 0.5.0 =
* Get a free license right from the settings screen — enter your email, no account needed.
* Fair-use rate limiting on the translation API.
* Fixed: the Release license button action was not registered.

= 0.4.0 =
* License binding: automatic domain-move detection, daily heartbeat, and a Release button to move your license to another site.
* Dashboard shows "Licensed for this site" for single-site licenses.

= 0.2.0 =
* First public development build: AI translation pipeline, SEO layer (hreflang, meta, canonical), background translation queue, language switcher, page-centric translation editor.
