=== Polylang AI ===
Contributors: lewebsimple
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically translate Polylang content with the OpenAI API when the source language is edited.

== Description ==

Polylang AI watches for edits to your source-language content and keeps the other
languages in sync by translating changed strings with the OpenAI API — in a
self-dispatching background process, so nothing blocks the editor and no scheduled
cron is required.

It is site-agnostic and auto-detects what it can translate:

* Core post fields — title, content, excerpt (and optionally the slug).
* ACF fields flagged "Translate" in Polylang — prose text/textarea/wysiwyg fields,
  plus the link text of link fields. Non-textual fields (images, relationships,
  choices, numbers, URLs) are ignored by construction.
* ACF options pages (via acf-options-for-polylang).
* Rank Math SEO title/description and OG/Twitter title & description.

Rich HTML/WYSIWYG content is segmented so only the prose text is sent to the model —
tags and attributes are preserved exactly, saving tokens and guaranteeing the markup
cannot be corrupted.

Features:

* Settings → Polylang AI: API key (stored encrypted), model selection, an additional
  context prompt, source/target languages, and a per-period cost limit.
* Live token usage and cost tracking with an editable price table.
* A translation log with per-string manual override (sticky until the source changes)
  and re-translate.
* A "Translate all missing / outdated" bulk backfill action.

== Requirements ==

* Polylang or Polylang Pro (required).
* An OpenAI API key.
* Optional integrations: Advanced Custom Fields, acf-options-for-polylang, Rank Math.

== Changelog ==

= 0.1.0 =
* Initial release.
