=== BallesDev LingoPress ===
Contributors: ballesdev
Tags: multilingual, translation, ai, seo, languages
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.1
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Multilingual content for WordPress with AI-powered, context-aware translations. SEO-first.

== Description ==

BallesDev LingoPress makes your WordPress site multilingual with a proven data model (languages and translation groups as taxonomies, no custom tables) and adds AI translation that actually understands your content. Every feature is included — there is no paid tier, license key or locked functionality.

**Multilingual core**

* Languages with directory-based URLs (/es/, /en/) and automatic rewrite rules.
* One post per language, linked as translation groups.
* Automatic hreflang tags, language-aware 301 canonicals and sitemap support.
* Language switcher as a Gutenberg block, shortcode, widget, menu item or PHP function.
* Menus per language, media translation with shared files, string translations.
* Template translations for block themes (FSE): each language gets its own copy of your templates and template parts.
* REST API: `lang` and `translations` fields on wp/v2, collection filtering with `?lang=`.

**AI translation (optional)**

* On WordPress 7.0+, LingoPress uses the AI provider you connected in **Settings → Connectors** through the WordPress AI Client — no extra API key in LingoPress.
* Or bring your own key: Claude (Anthropic), Gemini (Google), OpenAI (ChatGPT) and GroqCloud providers, selectable in settings (also on WordPress 6.5–6.9).
* Context-aware prompts: the AI reads the whole content, your site description and your glossary before translating a single word — so an ambiguous word like Spanish "muñeca" becomes "wrist" on a fitness blog, never "doll".
* Glossary with hard terminology rules.
* One-click translation from the editor, bulk translation with a background queue, automatic retry with backoff on provider saturation, and outdated-translation detection with one-click re-translation.
* Long content is automatically split into block-aligned chunks.
* Every AI translation is created as a draft for human review. Nothing is published automatically.

The multilingual features work fully without any API key. AI translation is an optional extra that only runs when you ask for it — see "External services" below.

**Developer friendly**

* Public API: `lingopress_set_post_language()`, `lingopress_get_post()`, `lingopress_the_languages()`, `lingopress_register_string()` and more.
* Hooks: `lingopress_language_defined`, `lingopress_ai_system_prompt`, `lingopress_ai_provider`, `lingopress_switcher_items`, `lingopress_sync_post_meta`.
* Polylang importer included (languages, content languages and translation groups).

= License =

Copyright 2026 balles.dev. BallesDev LingoPress is free software under the GPL, version 3 or later, with additional terms: copies and modified versions must keep the notice "Originally developed by balles.dev (https://balles.dev/)", and modified versions must use a different name, without "BallesDev", "balles.dev" or "LingoPress". See LICENSE.txt and NOTICE.txt.

== External services ==

LingoPress can translate your content with an AI provider of your choice. This is optional: no request is made to any AI service until a provider is set up — a connector in **Settings → Connectors** (WordPress 7.0+) or an API key in **LingoPress → AI translation** (or its constant in `wp-config.php`) — and a user with editing permissions starts a translation — from the post editor, the bulk action, the Queue, the Templates tab or the "Translate missing strings with AI" button. Queued jobs run in the background through WP-Cron, but only jobs that a user explicitly queued.

Only the provider selected in the settings receives data. Each request sends the text being translated (post title, content and excerpt; a theme template; or the registered strings), the source and target languages, your site name and tagline, the "Site context" and glossary settings, the post type and the names of the post's categories and tags, together with your API key to authenticate. No other site or visitor data is sent.

* **WordPress AI Client (Settings → Connectors)** — used when the provider is set to "WordPress (Connectors)". LingoPress hands the request to WordPress core, which sends it to the AI service the site owner connected (for example Anthropic, Google or OpenAI) under that service's terms and privacy policy; LingoPress itself does not contact any external server in this mode.
* **Anthropic Claude API** (`api.anthropic.com`) — used when the provider is set to Claude. [Terms of service](https://www.anthropic.com/legal/commercial-terms), [Privacy policy](https://www.anthropic.com/legal/privacy).
* **Google Gemini API** (`generativelanguage.googleapis.com`) — used when the provider is set to Gemini. [Terms of service](https://ai.google.dev/gemini-api/terms), [Privacy policy](https://policies.google.com/privacy).
* **OpenAI API** (`api.openai.com`) — used when the provider is set to OpenAI. [Terms of service](https://openai.com/policies/business-terms/), [Privacy policy](https://openai.com/policies/privacy-policy/).
* **GroqCloud API** (`api.groq.com`) — used when the provider is set to Groq. [Terms of service](https://groq.com/terms-of-use), [Privacy policy](https://groq.com/privacy-policy).

== Installation ==

1. In your WordPress dashboard go to **Plugins → Add New**, search for "BallesDev LingoPress", then install and activate it.
2. Go to **LingoPress → Languages** and create your languages (the first one becomes the default).
3. Optional: for AI translation, connect a provider in **Settings → Connectors** (WordPress 7.0+) or add your own API key under **LingoPress → AI translation**; then describe your site in "Site context" and add glossary rules.
4. Assign a language to existing content, or run the Polylang importer if you are migrating.

The **Getting started** tab walks you through these steps and shows what is still pending.

== Frequently Asked Questions ==

= Do I need an AI provider to use LingoPress? =

No. Languages, URLs, hreflang, the language switcher, menus, media and string translations all work without any API key. AI translation is optional.

= Does the AI publish translations automatically? =

No. Every translation is created as a draft, linked to the original, for a human to review and publish.

= What happens if the AI provider is saturated? =

Jobs are retried automatically with increasing backoff. You can also retry failed jobs manually from LingoPress → Queue.

= Where do the API keys live? =

With the "WordPress (Connectors)" provider (WordPress 7.0+), in **Settings → Connectors**: WordPress manages the credentials and LingoPress stores none. With your own key, in the plugin settings, or preferably in `wp-config.php` via the `LINGOPRESS_ANTHROPIC_API_KEY`, `LINGOPRESS_GEMINI_API_KEY`, `LINGOPRESS_OPENAI_API_KEY` or `LINGOPRESS_GROQ_API_KEY` constants (constants take precedence).

= Can I migrate from Polylang? =

Yes. LingoPress ships an idempotent importer that migrates languages, post/term languages and translation groups.

== Changelog ==

= 1.0.1 =
* License: added LICENSE.txt (full GPLv3 text) and NOTICE.txt with additional terms under GPLv3 section 7 — keep the "Originally developed by balles.dev" notice, mark modified versions as changed, and use a different name (without BallesDev, balles.dev or LingoPress) for modified versions.
* No functional changes.

= 1.0.0 =
* First release on WordPress.org, as BallesDev LingoPress.
* New "WordPress (Connectors)" AI provider: on WordPress 7.0+ translations use the AI provider configured in Settings → Connectors through the WordPress AI Client (default on new installs). Claude, Gemini, OpenAI and Groq with your own key remain available.
* Public API and stored data use the `lingopress_` prefix, e.g. `lingopress_get_post()`, `lingopress_set_post_language()`.
* Admin styles and scripts load only on LingoPress screens; inline scripts moved to enqueued files.
* Translations are now delivered through translate.wordpress.org.
* Removed the licensing system and the self-hosted update channel: every feature is free and updates are delivered through WordPress.org.
* Security hardening: AI provider responses are sanitized before they are saved (posts, templates and string translations), and the language switcher output is escaped where it is printed.

== Upgrade Notice ==

= 1.0.1 =
Adds the license files (GPLv3 with additional terms). No functional changes.

= 1.0.0 =
First WordPress.org release. Licensing has been removed: all features are free and updates now come from WordPress.org.
