=== OZY Translate ===
Contributors: idanishrangaiz
Tags: translation, multilingual, ai translation, language switcher, translate
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Context-aware AI translation with voice-first accessibility. Unlimited languages, four URL modes, eight switcher designs, and text-to-speech.

== Description ==

OZY Translate makes a WordPress site multilingual without metered word counts, per-language upsells, or a monthly subscription. Everything the plugin can do is available to everyone, for free.

Translation quality comes from modern context-aware language models rather than generic machine-translation endpoints. On WordPress 7.0 and later the plugin uses the AI Client built into WordPress, so whichever provider you have already connected under Settings, Connectors just works and this plugin never handles a key. Otherwise you bring your own API key from a provider you already trust, several of which have generous free tiers. The plugin is also fully usable with no AI provider at all: you can translate everything by hand through the built-in editors.

= Voice-first accessibility =

Every translated page can be read aloud in the active language using the browser's built-in speech synthesis. No external service, no API key, no per-character cost. Visitors get play, pause, speed, pitch, voice, and accent controls, plus word-level highlighting as the page is read.

This is paired with a wider accessibility toolkit: font size controls, high contrast mode, a dyslexia-friendly font, reduced motion enforcement, skip links, ARIA landmarks, and a correctly maintained `lang` attribute so operating-system screen readers switch pronunciation properly.

= What is included =

* Unlimited languages and unlimited translated content.
* Works with the AI Client built into WordPress 7.0, so no API key is needed here.
* Four URL modes: subdirectory, subdomain, query parameter, and cookie-only.
* Eight language switcher designs, including a searchable full-screen modal grid.
* Text-to-speech in 100+ languages through the browser Web Speech API.
* Accent selection for English, Spanish, French, Portuguese, Arabic, Chinese, and more.
* Translated URL slugs with three storage strategies to suit any site size.
* Hreflang tags, per-language canonicals, per-language XML sitemaps, and translated structured data.
* Native WooCommerce support: products, variations, cart, checkout, and order emails.
* Custom field support through seven adapters, including ACF, Meta Box, CMB2, and Carbon Fields.
* Glossary and do-not-translate rules so brand terms survive translation intact.
* Translation memory, approval workflow, and PO / XLIFF / CSV / JSON import and export.
* A string scanner for theme and plugin strings, with both file and runtime scanning.
* Usage insights, kept entirely in your own database, showing which pages to translate next.
* A/B testing of two wordings, with a winner declared only at 95% statistical confidence.
* Automatic right-to-left layout and CJK typography handling.
* Bulk approve, review, flag and delete, run in the background over a whole language.
* Optional visitor-submitted corrections, held for review and never published automatically.
* One-click migration from eight other translation plugins.
* Language switcher widgets for nine page builders, plus shortcodes and template functions.

= Accessibility statement =

OZY Translate targets WCAG 2.1 level AA for everything it renders, and reaches level AAA for contrast in most places. All switcher designs are keyboard operable, expose correct ARIA roles, trap focus in modal contexts, return focus to the trigger on close, announce language changes through a live region, and respect `prefers-reduced-motion`. Contrast is measured programmatically on every build, and the build fails if any pairing drops below AA.

= Privacy =

OZY Translate does not phone home, does not include analytics beacons, and does not transmit any data to OZY Solutions. Usage statistics, when enabled, are stored only in your own database. No external service is contacted unless you explicitly configure and enable it.

== External services ==

This plugin is fully functional without any external service. Nothing is sent anywhere by default. A service is contacted only after you have switched on the feature that uses it and entered your own credentials for it, and only at the moment that feature runs.

Every request below is made from your server to the named provider. Your visitors are never sent to a third party, and no data is ever sent to OZY Solutions.

= Translation providers =

You need at most one of these, and only if you want AI or machine translation. Manual translation, imports, the string scanner and browser text-to-speech all work with none of them.

**OpenAI**

* Endpoint contacted: https://api.openai.com/v1/chat/completions
* Purpose: translate content and interface strings
* Data sent: the source text, the source and target language codes, and the translation instructions you configured (brand name, tone, audience, glossary terms)
* When: only when AI translation is enabled and an OpenAI key is configured, at the moment a translation is generated
* Terms of service: https://openai.com/policies/terms-of-use
* Privacy policy: https://openai.com/policies/privacy-policy

**Anthropic**

* Endpoint contacted: https://api.anthropic.com/v1/messages
* Purpose: translate content and interface strings
* Data sent: the source text, the source and target language codes, and the translation instructions you configured
* When: only when AI translation is enabled and an Anthropic key is configured, at the moment a translation is generated
* Terms of service: https://www.anthropic.com/legal/consumer-terms
* Privacy policy: https://www.anthropic.com/legal/privacy

**Groq**

* Endpoint contacted: https://api.groq.com/openai/v1/chat/completions
* Purpose: translate content and interface strings
* Data sent: the source text, the source and target language codes, and the translation instructions you configured
* When: only when AI translation is enabled and a Groq key is configured, at the moment a translation is generated
* Terms of service: https://groq.com/terms-of-use/
* Privacy policy: https://groq.com/privacy-policy/

**Google Gemini**

* Endpoint contacted: https://generativelanguage.googleapis.com/v1beta/models/
* Purpose: translate content and interface strings
* Data sent: the source text, the source and target language codes, and the translation instructions you configured
* When: only when AI translation is enabled and a Gemini key is configured, at the moment a translation is generated
* Terms of service: https://ai.google.dev/gemini-api/terms
* Privacy policy: https://policies.google.com/privacy

**Mistral AI**

* Endpoint contacted: https://api.mistral.ai/v1/chat/completions
* Purpose: translate content and interface strings
* Data sent: the source text, the source and target language codes, and the translation instructions you configured
* When: only when AI translation is enabled and a Mistral key is configured, at the moment a translation is generated
* Terms of service: https://legal.mistral.ai/terms
* Privacy policy: https://legal.mistral.ai/terms/privacy-policy

**DeepL**

* Endpoints contacted: https://api.deepl.com/v2/translate and https://api-free.deepl.com/v2/translate
* Purpose: machine translation of content and interface strings
* Data sent: the source text and the source and target language codes
* When: only when DeepL is selected as a translation provider and a key is configured
* Terms of service: https://www.deepl.com/pro-license
* Privacy policy: https://www.deepl.com/privacy

**Google Cloud Translation**

* Endpoint contacted: https://translation.googleapis.com/language/translate/v2
* Purpose: machine translation of content and interface strings
* Data sent: the source text and the source and target language codes
* When: only when Google Cloud Translation is selected as a translation provider and a key is configured
* Terms of service: https://cloud.google.com/terms
* Privacy policy: https://policies.google.com/privacy

**Microsoft Translator**

* Endpoint contacted: https://api.cognitive.microsofttranslator.com/translate
* Purpose: machine translation of content and interface strings
* Data sent: the source text and the source and target language codes
* When: only when Microsoft Translator is selected as a translation provider and a key and region are configured
* Terms of service: https://azure.microsoft.com/en-us/support/legal/
* Privacy policy: https://www.microsoft.com/en-us/privacy/privacystatement

On WordPress 7.0 and later the plugin can use the AI Client built into WordPress instead of any of the above. In that case this plugin makes no request of its own and holds no key: WordPress contacts whichever provider you connected under Settings, Connectors, under that provider's own terms.

= Spoken audio =

The listen feature uses the visitor's own browser by default, through the Web Speech API. That is entirely local: no request leaves the site and none of the services below is used. They are alternatives you can switch to, and each returns audio that is then cached in your own uploads directory.

**ElevenLabs**

* Endpoint contacted: https://api.elevenlabs.io/v1/text-to-speech/
* Purpose: generate spoken audio of translated text
* Data sent: the text to be spoken, the language code and the chosen voice identifier
* When: only when the voice engine is switched from the browser to ElevenLabs and a key is configured
* Terms of service: https://elevenlabs.io/terms-of-use
* Privacy policy: https://elevenlabs.io/privacy-policy

**Microsoft Azure Speech**

* Endpoints contacted: https://REGION.tts.speech.microsoft.com/cognitiveservices/v1 and the matching /cognitiveservices/voices/list, where REGION is the Azure region you enter
* Purpose: generate spoken audio of translated text
* Data sent: the text to be spoken, the language code and the chosen voice identifier
* When: only when the voice engine is switched to Azure Speech and a key and region are configured
* Terms of service: https://azure.microsoft.com/en-us/support/legal/
* Privacy policy: https://www.microsoft.com/en-us/privacy/privacystatement

**Google Cloud Text-to-Speech**

* Endpoint contacted: https://texttospeech.googleapis.com/v1/text:synthesize
* Purpose: generate spoken audio of translated text
* Data sent: the text to be spoken, the language code and the chosen voice identifier
* When: only when the voice engine is switched to Google Cloud Text-to-Speech and a key is configured
* Terms of service: https://cloud.google.com/terms
* Privacy policy: https://policies.google.com/privacy

**Amazon Polly**

* Endpoint contacted: https://polly.REGION.amazonaws.com/v1/speech, where REGION is the AWS region you enter
* Purpose: generate spoken audio of translated text
* Data sent: the text to be spoken, the language code and the chosen voice identifier
* When: only when the voice engine is switched to Amazon Polly and AWS credentials are configured
* Terms of service: https://aws.amazon.com/service-terms/
* Privacy policy: https://aws.amazon.com/privacy/

= WooCommerce multi-currency =

**ExchangeRate-API**

* Endpoint contacted: https://open.er-api.com/v6/latest/
* Purpose: fetch currency exchange rates for the optional WooCommerce multi-currency feature
* Data sent: your shop base currency code only. No customer, order, visitor or site data is sent
* When: only when multi-currency is enabled with automatic exchange rates. Entering rates by hand avoids this entirely
* Terms of service: https://www.exchangerate-api.com/terms
* Privacy policy: https://www.exchangerate-api.com/privacy

= Migrating away from another plugin =

**Weglot**

* Endpoint contacted: https://api.weglot.com/
* Purpose: read your existing Weglot translations so they can be copied into your own database
* Data sent: your Weglot API key and the project identifier it belongs to
* When: only while you are running the Weglot migration, and only after you supply your key
* Terms of service: https://www.weglot.com/terms
* Privacy policy: https://weglot.com/privacy/

Every other migration importer (WPML, Polylang, TranslatePress, GTranslate, Loco Translate, qTranslate and MultilingualPress) reads your own database directly and contacts nothing.

= Country detection =

Country detection reads a header your CDN or proxy already sends, such as the CF-IPCountry header from Cloudflare. No lookup service is contacted and no visitor IP address is sent anywhere. Where no such header is present, country detection simply does nothing.

If none of the services above is configured, this plugin operates entirely on your own server and contacts nothing.

== Installation ==

1. Upload the `ozy-translate` folder to `/wp-content/plugins/`, or install the plugin through the Plugins screen.
2. Activate the plugin.
3. Open **OZY Translate** in the admin menu and follow the setup wizard.
4. Choose your languages, pick a URL mode, and place a language switcher.

== Frequently Asked Questions ==

= Does this cost anything? =

No. Every feature is free. If you enable AI translation you pay your chosen AI provider directly for the tokens you use, which on free-tier providers is typically nothing.

= Do I have to enter an API key? =

No. On WordPress 7.0 and later, if you have already connected an AI provider under Settings, Connectors, the plugin uses the AI Client built into WordPress. WordPress keeps the credentials, and this plugin never sees a key. Entering a key here is only needed if you would rather not use the core AI Client, or you are on an older WordPress version.

= Does it work without an AI provider? =

Yes. Manual translation, imports, the string scanner, the visual editor, all switcher designs, and browser-based text-to-speech all work with no external service configured.

= Will it duplicate my posts? =

No. Translations are stored in dedicated tables keyed by a hash of the source text. Your original content is never modified.

= Which URL mode should I choose? =

Subdirectory (`/es/page/`) is recommended and gives the best search engine results. Cookie-only mode changes no URLs at all, which is convenient but means search engines only ever see your default language.

= Is it compatible with caching plugins? =

Yes. The plugin ships integrations for WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, and WP Fastest Cache, and sets correct `Vary` headers for CDN edge caching.

== Screenshots ==

1. Add a language and the slug, direction and flag are set for you. Four ways to carry the language in the address, each with a worked example and its search engine trade-off stated plainly
2. Eight switcher designs, previewed live with your own languages and settings. All keyboard operable and screen-reader labelled
3. The full screen switcher on the front end, with a search box for sites that offer more than a handful of languages
4. The SEO screen states what is set up and what still needs attention, and works alongside the SEO plugin you already run
5. Insights stay in your own database and tell you which pages to translate next
6. Pin your brand names so a machine never translates them into something else, or force one agreed wording per language
7. Detection is checked in a stated order, and every option says plainly what it does and why it is on or off by default

== Changelog ==

= 1.0.1 =
* Fixed: a switcher placed with the shortcode, the widget or a template tag, and left on the site's own design, did not load the script it needs. A modal grid, sliding panel, floating button or mega menu placed that way had nothing to open it.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.1 =
Fixes a language switcher that would not open when placed by shortcode, widget or template tag.

= 1.0.0 =
Initial release.
