=== LATW AI Translation for Loco Translate ===
Contributors: szymon0zawadzki
Tags: loco translate, translation, openai, automatic translation, po
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically translate your Loco Translate PO/MO files with OpenAI. A background WP-Cron worker does the heavy lifting.

== Description ==

LATW AI Translation for Loco Translate adds AI-powered automatic translation to the popular Loco Translate plugin.

Instead of translating strings one by one, you queue an entire PO file (from the plugin's Translations tab or with a single button right inside the Loco editor). A background WP-Cron worker submits the untranslated strings to OpenAI's Responses API, polls for completion, and writes the results back into your `.po` file — recompiling the matching `.mo` automatically.

= Features =

* **Dashboard** — translation stats, cost, queue status and WP-Cron health at a glance.
* **Translations** — browse translatable PO files grouped by bundle (plugins, themes, WordPress core) and queue them with one click. The target language is taken from each file's own locale.
* **Auto Translate button** — appears directly on the Loco Translate file editor and queues the current file.
* **History** — every job with its model, token usage, cost and the raw request/response.
* **Logs** — file-based logs with an optional verbose debug mode.
* **Settings** — OpenAI API key, model, reasoning effort and source language.

= Requirements =

* WordPress 6.2 or higher
* PHP 7.4 or higher
* The free [Loco Translate](https://wordpress.org/plugins/loco-translate/) plugin must be installed and active.
* An OpenAI API key.

= LATW AI Translation for Loco Translate Versions =

**LATW AI Translation for Loco Translate:**
* Translate content into any language
* Full access to the translation workflow
* No time, usage or language limits

**LATW AI Translator for Loco Translate Pro (Optional):**
* Custom translation prompts
* Glossary with CSV import/export
* Website context for better translations
* Priority support
* Commercial use

[More information about the Pro version](https://llm-automatic-translation.top/latw-ai-translation-for-loco-translate)

= Third-Party Services =

This plugin connects to the following external services:

**OpenAI API**
This plugin sends content to OpenAI's API for translation processing.

* Service URL: [https://api.openai.com/](https://api.openai.com/)
* Privacy Policy: [https://openai.com/privacy/](https://openai.com/privacy/)
* Terms of Use: [https://openai.com/terms/](https://openai.com/terms/)

Your content is sent to OpenAI only when you initiate a translation. No data is sent without user action.
All requests are sent directly from the user's WordPress server to OpenAI.

== Installation ==

1. Install and activate Loco Translate.
2. Upload this plugin to `/wp-content/plugins/` and activate it.
3. Go to **AI Loco Translator → Settings** and enter your OpenAI API key.
4. Open **AI Loco Translator → Translations**, pick a PO file and click **Translate** — or open any file in the Loco editor and click **Auto Translate (AI)**.
5. Translations are processed in the background by WP-Cron. Reload after a minute to see the results.

== Frequently Asked Questions ==

= What can I do with the free version? =

This plugin lets you translate all your content into any language. All features are available, with no time, usage, or language limits.

= How do I get a Pro version? =

Visit [our website](https://llm-automatic-translation.top/latw-ai-translation-for-loco-translate) to purchase a Pro license.

= Do I need Loco Translate to use this plugin? =

Yes, Loco Translate is required. This plugin extends Loco Translate's translation capabilities with AI-powered automatic translations.

= Where do I get an OpenAI API key? =

You can get an API key from [OpenAI's website](https://platform.openai.com/api-keys). You'll need to create an account and add billing information.

= How much does translation cost? =

Translation costs depend on the OpenAI model you choose and the amount of content. GPT-5.4-nano is the most cost-effective option. The plugin shows estimated costs before translation. Note: OpenAI API costs are separate from the Pro license.

= Which OpenAI models are supported? =

The plugin supports GPT-5, GPT-5-mini, GPT-5-nano, GPT-5.4, GPT-5.4-mini, GPT-5.4-nano and GPT-5.5. The default model is GPT-5.4-nano, the fastest and most cost-effective option.

= Where do the translations come from? =

From OpenAI, using the model and prompt you configure in Settings.

= Does it overwrite my existing translations? =

No. Only strings that are currently untranslated (empty `msgstr`) are sent and filled in.

= Can I customize translation prompts? =

This plugin uses a carefully tuned built-in prompt. Custom prompts, glossary and website context are available in the separate [Pro version](https://llm-automatic-translation.top/latw-ai-translation-for-loco-translate).

= My host disables WP-Cron. What can I do? =

Enable "Manual Check Responses" in Settings → Advanced to get a button that dispatches and checks jobs on demand, or configure a real server cron that hits `wp-cron.php`.

== Screenshots ==

1. Main translation dashboard
2. Translation history page

== Changelog ==

= 1.0.0 =
* Initial release.
