=== Tradu – Visual Website Translator ===
Contributors: pbdaemon
Tags: translation, multilingual, translate, woocommerce, language switcher
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Translate your whole site from the front end. Translations survive edits, sentences keep their bold text and links, and every feature is free.

== Description ==

Tradu translates the final page your visitors see, so it works with any theme and page builder and never duplicates your posts. Translate visually on the page or in a list view, by hand, or automatically with the optional Tradu Cloud service.

* **Translations survive edits.** When you change a sentence, its old translation stays on the page (marked "Needs review") and only that sentence is translated again.
* **Whole sentences.** Bold text, links and brand names stay inside the sentence they belong to.
* **Unlimited languages, all free:** translated URLs with automatic 301 redirects, hreflang and x-default, sitemaps, per-page control and a translator role.
* **Optional automatic translation** through Tradu Cloud, with a free monthly allowance for every site. Connect in one click from the settings.
* **Translate your whole site in the background:** every post, page, product, category and menu, at a steady pace, with progress, time left, pause and resume. Pages go live in each language as soon as they are translated, and anything you edit is translated first.
* **Usage control:**
	* hard monthly and daily caps
	* a ledger of every call
	* no duplicate calls
	* bots can never trigger machine translation
* **A glossary** for brand names and fixed terms.
* **WooCommerce-safe.** No markup is added to orders, e-mails, PDFs or the REST API. Customer e-mails go out in the customer's language, and customer data is never sent for machine translation.
* **Never touches page-builder editors** (Elementor, Divi, Bricks, Breakdance, Oxygen and others).
* **Fast:**
	* a per-page lookup cache
	* no database queries on a cache hit
	* works behind page caches and CDNs
* **No lock-in:**
	* XLIFF, PO and CSV export and import
	* importers for other multilingual plugins
	* a clean uninstall
* **Accessible:** a language switcher you can style (block, shortcode, widget, menu, floating).
* **WP-CLI** (`wp tradupress`) and a Health screen for diagnostics.

== Installation ==

1. Install Tradu from **Plugins → Add New**, or upload the `tradupress` folder to `/wp-content/plugins/`.
2. Activate it.
3. Go to **Tradu → Settings → Languages** and pick your languages.
4. Optional: in **Settings → Automatic translation**, click **Connect to Tradu Cloud**, set a monthly limit and click **Test**.
5. Open any page and click **Translate page** in the admin bar to translate visually, or use **Tradu → Translations** for the list view.

Pretty permalinks are recommended, so that each language gets its own folder (`/fr/`).

== Frequently Asked Questions ==

= Is the plugin free? =

Yes. Every feature of the plugin is free and unlocked: unlimited languages, the visual editor, translated URLs, SEO features, glossary, import and export, and WP-CLI.

= How does automatic translation work? =

Automatic translation is an optional external service, Tradu Cloud. Every connected site gets a free monthly allowance of words; larger allowances are available on cloud.tradupress.com. Translations are stored in your own database, so they stay on your site if you stop using the service.

= What if my Tradu Cloud plan doesn't cover one of my languages? =

If your current plan doesn't include automatic translation for a language, **Settings → Automatic translation** says so. You can still add that language and translate it by hand or import a file. Its text waits and is translated automatically once your plan covers it.

= Do I need Tradu Cloud? =

No. You can translate everything by hand in the visual editor or the list view, or import translations from XLIFF, PO or CSV files.

= Will it slow down my site? =

Translated pages use a per-page lookup cache: a repeat view needs no database queries. Automatic translation never runs during a page view; new text is translated in the background.

= What happens to my translations when I edit a page? =

Unchanged sentences keep their translation. An edited sentence keeps its previous translation, marked "Needs review", until it is reviewed or re-translated.

= Is it compatible with my SEO plugin and page cache? =

Each language has its own URL with self-referencing canonicals and hreflang, so page caches and CDNs work normally. hreflang is added either in the page head or in the sitemaps of WordPress, Yoast or Rank Math (one method at a time, as Google recommends).

= Can I export my translations? =

Yes. Use **Tradu → Import / Export** for XLIFF 1.2, PO or CSV, including translated URLs, or `wp tradupress export`.

= What is removed when I delete the plugin? =

By default, everything: tables, options, cache files and roles. You can switch this off under **Settings → Advanced**.

== External services ==

= Tradu Cloud =

Tradu Cloud is the optional automatic-translation service for this plugin, run by the Tradu team. Using it needs a Tradu Cloud account (free to create; every site gets a free monthly allowance). The plugin only contacts it after an administrator clicks **Connect to Tradu Cloud** (or pastes a site token) under *Settings → Automatic translation*. Nothing is sent before that, and nothing is sent after you disconnect.

What is sent, and when:

* **Connecting:** you are sent to `cloud.tradupress.com/connect` with your site address. On return, a one-time code and your site address are sent to `api.tradupress.com` to obtain the site token. While that request runs, the service reads a one-time confirmation (a hash of that code) from `/wp-json/tradupress/v1/cloud/verify` on your site, to make sure the request really came from it.
* **Translating:** only the text segments to translate (with numbered placeholders for inline markup), the source and target language codes, your glossary terms and your style instructions, plus your site address and the plugin version. Requests are made from the background queue (WP-Cron, the "Translate whole site" job or `wp tradupress translate`), one at a time and at the pace the service asks for, when an editor clicks **Machine translate**, and when a customer e-mail needs a translation that doesn't exist yet. Customer names, addresses, e-mail addresses and phone numbers are masked first and never sent. Page views by visitors never call the service.
* **Usage display:** the settings screen asks the service for the site's plan and remaining words. While a whole-site translation runs, the progress panel also sends the number of words still to translate, to get an estimate of the time left.
* **Disconnecting:** the service is told to revoke the site token.

Service hosts: `api.tradupress.com` (API) and `cloud.tradupress.com` (account and connect page). Terms of service: https://tradupress.com/terms – Privacy policy: https://tradupress.com/privacy

= Other services =

* **WordPress.org language packs.** When you add a language with "Use official WordPress translations" enabled, WordPress downloads that language's official translation files from `downloads.wordpress.org`, using WordPress's own update mechanism. Privacy: https://wordpress.org/about/privacy/

== Screenshots ==

1. The visual editor: click any text on the page and translate it in place; links and bold text stay in the sentence.
2. Translate whole site: a background job with progress per language, time left, pause and resume.
3. A translated page with the accessible language switcher open.
4. Languages: your site's language and any number of translation languages, each in its own folder.
5. Automatic translation: connect Tradu Cloud and see your plan and usage.
6. Import / Export: XLIFF, PO and CSV for translation agencies, and migration from another multilingual plugin.

== Changelog ==

= 0.1.2 =
* The public lookup endpoint returns only translations of text from public pages.

= 0.1.1 =
* Plugin renamed to Tradu (text domain tradu), plus fixes from the WordPress.org review: prefixed script data, a nonce on the lookup endpoint, output buffering and request sanitising.

= 0.1.0 =
* First release.

== Upgrade Notice ==

= 0.1.2 =
More fixes from the WordPress.org review.

= 0.1.1 =
Fixes from the WordPress.org review.

= 0.1.0 =
First release.
