=== AI Translator ===
Contributors: yodsira
Tags: translation, multilingual, ai, translation draft
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Translate posts and pages with AI into review-ready drafts. HTML structure is preserved and verified automatically. Your API key, your tokens - no markup.

== Description ==

AI translation is the cheap multilingual shortcut - but most tools either lock you into their ecosystem or their token pricing. AI Translator does it the Yodsira way:

* **Draft-first workflow.** Every translation lands as a draft with the language tag in the title. A human reads it, tweaks it, publishes it. The queue shows queued / done / failed states with one-click retry.
* **HTML safety, verified.** The prompt demands tag preservation, and the response is checked: the tag count must match the source. Mangled HTML is retried automatically, then failed loudly - never saved silently.
* **Your key, your tokens.** Any OpenAI-compatible endpoint (OpenAI, OpenRouter, Ollama). Optionally keep the key out of the database entirely with the AI_TRANSLATOR_KEY constant in wp-config.php.
* **Row action + editor button.** Start a translation from the posts list or from the editor sidebar.

The free version includes 5 translations per month. Pro adds unlimited translations, bulk translation by category, SEO meta and alt text translation, a brand glossary, hreflang integration with Hreflang Master and model selection.

== Installation ==

1. Upload the `ai-translator` folder to `/wp-content/plugins/` or install the ZIP via Plugins - Add New.
2. Open Tools - AI Translator, add your API base URL and key.
3. Use the "Translate" row action on any post, or the metabox in the editor.

== Frequently Asked Questions ==

= What happens to my drafts when I uninstall? =

Nothing - drafts are your content. Only the queue table and plugin options are removed.

= Why did my translation fail with a tag mismatch? =

The model broke the HTML structure. The plugin retried automatically; if it still fails, try again or use a stronger model.

== Changelog ==

= 1.0.0 =
* Initial release: translation queue, HTML tag-balance verification with retries, drafts with language tags, monthly limit.
